@codingame/monaco-vscode-language-detection-worker-service-override 5.3.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-language-detection-worker-service-override",
3
- "version": "5.3.0",
3
+ "version": "6.0.1",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -29,7 +29,7 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "vscode": "npm:@codingame/monaco-vscode-api@5.3.0",
32
+ "vscode": "npm:@codingame/monaco-vscode-api@6.0.1",
33
33
  "@vscode/vscode-languagedetection": "npm:@codingame/vscode-languagedetection@1.0.23"
34
34
  }
35
35
  }
@@ -5,6 +5,8 @@ import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
5
5
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
6
6
  import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
7
7
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
8
+ import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
9
+ import { StatusbarAlignment } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar';
8
10
  import { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar.service';
9
11
  import { LanguageDetectionLanguageEventSource } from 'vscode/vscode/vs/workbench/services/languageDetection/common/languageDetectionWorkerService';
10
12
  import { ILanguageDetectionService } from 'vscode/vscode/vs/workbench/services/languageDetection/common/languageDetectionWorkerService.service';
@@ -14,7 +16,9 @@ import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/
14
16
  import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
15
17
  import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
16
18
  import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
19
+ import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
17
20
  import { NOTEBOOK_EDITOR_EDITABLE } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
21
+ import { KeyCode, KeyMod } from 'vscode/vscode/vs/base/common/keyCodes';
18
22
  import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextKeys';
19
23
  import { Schemas } from 'vscode/vscode/vs/base/common/network';
20
24
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
@@ -86,7 +90,7 @@ let LanguageDetectionStatusContribution = class LanguageDetectionStatusContribut
86
90
  text: '$(lightbulb-autofix)',
87
91
  };
88
92
  if (!this._combinedEntry) {
89
- this._combinedEntry = this._statusBarService.addEntry(props, LanguageDetectionStatusContribution_1._id, 1 , { id: 'status.editor.mode', alignment: 1 , compact: true });
93
+ this._combinedEntry = this._statusBarService.addEntry(props, LanguageDetectionStatusContribution_1._id, StatusbarAlignment.RIGHT, { id: 'status.editor.mode', alignment: StatusbarAlignment.RIGHT, compact: true });
90
94
  }
91
95
  else {
92
96
  this._combinedEntry.update(props);
@@ -107,7 +111,7 @@ LanguageDetectionStatusContribution = LanguageDetectionStatusContribution_1 = (
107
111
  ( (__param(4, ILanguageService))),
108
112
  ( (__param(5, IKeybindingService)))
109
113
  ], LanguageDetectionStatusContribution)));
110
- ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(LanguageDetectionStatusContribution, 3 );
114
+ ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(LanguageDetectionStatusContribution, LifecyclePhase.Restored);
111
115
  registerAction2(class extends Action2 {
112
116
  constructor() {
113
117
  super({
@@ -118,7 +122,7 @@ registerAction2(class extends Action2 {
118
122
  (NOTEBOOK_EDITOR_EDITABLE.toNegated()),
119
123
  EditorContextKeys.editorTextFocus
120
124
  ))),
121
- keybinding: { primary: 34 | 512 | 1024 , weight: 200 }
125
+ keybinding: { primary: KeyCode.KeyD | KeyMod.Alt | KeyMod.Shift, weight: KeybindingWeight.WorkbenchContrib }
122
126
  });
123
127
  }
124
128
  async run(accessor) {
@@ -8,6 +8,7 @@ import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/c
8
8
  import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
9
9
  import { URI } from 'vscode/vscode/vs/base/common/uri';
10
10
  import { isWeb } from 'vscode/vscode/vs/base/common/platform';
11
+ import 'vscode/vscode/vs/platform/instantiation/common/extensions';
11
12
  import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
12
13
  import { SimpleWorkerClient } from 'vscode/vscode/vs/base/common/worker/simpleWorker';
13
14
  import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
@@ -16,6 +17,7 @@ import { ILanguageConfigurationService } from 'vscode/vscode/vs/editor/common/la
16
17
  import { IDiagnosticsService } from 'vscode/vscode/vs/platform/diagnostics/common/diagnostics.service';
17
18
  import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
18
19
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
20
+ import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
19
21
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
20
22
  import { LRUCache } from 'vscode/vscode/vs/base/common/map';
21
23
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
@@ -119,14 +121,14 @@ let LanguageDetectionService = class LanguageDetectionService extends Disposable
119
121
  }
120
122
  initEditorOpenedListeners(storageService) {
121
123
  try {
122
- const globalLangHistoryData = JSON.parse(storageService.get(LanguageDetectionService_1.globalOpenedLanguagesStorageKey, 0 , '[]'));
124
+ const globalLangHistoryData = JSON.parse(storageService.get(LanguageDetectionService_1.globalOpenedLanguagesStorageKey, StorageScope.PROFILE, '[]'));
123
125
  this.historicalGlobalOpenedLanguageIds.fromJSON(globalLangHistoryData);
124
126
  }
125
127
  catch (e) {
126
128
  console.error(e);
127
129
  }
128
130
  try {
129
- const workspaceLangHistoryData = JSON.parse(storageService.get(LanguageDetectionService_1.workspaceOpenedLanguagesStorageKey, 1 , '[]'));
131
+ const workspaceLangHistoryData = JSON.parse(storageService.get(LanguageDetectionService_1.workspaceOpenedLanguagesStorageKey, StorageScope.WORKSPACE, '[]'));
130
132
  this.historicalWorkspaceOpenedLanguageIds.fromJSON(workspaceLangHistoryData);
131
133
  }
132
134
  catch (e) {
@@ -138,8 +140,8 @@ let LanguageDetectionService = class LanguageDetectionService extends Disposable
138
140
  this.sessionOpenedLanguageIds.add(activeLanguage);
139
141
  this.historicalGlobalOpenedLanguageIds.set(activeLanguage, true);
140
142
  this.historicalWorkspaceOpenedLanguageIds.set(activeLanguage, true);
141
- storageService.store(LanguageDetectionService_1.globalOpenedLanguagesStorageKey, JSON.stringify(this.historicalGlobalOpenedLanguageIds.toJSON()), 0 , 1 );
142
- storageService.store(LanguageDetectionService_1.workspaceOpenedLanguagesStorageKey, JSON.stringify(this.historicalWorkspaceOpenedLanguageIds.toJSON()), 1 , 1 );
143
+ storageService.store(LanguageDetectionService_1.globalOpenedLanguagesStorageKey, JSON.stringify(this.historicalGlobalOpenedLanguageIds.toJSON()), StorageScope.PROFILE, StorageTarget.MACHINE);
144
+ storageService.store(LanguageDetectionService_1.workspaceOpenedLanguagesStorageKey, JSON.stringify(this.historicalWorkspaceOpenedLanguageIds.toJSON()), StorageScope.WORKSPACE, StorageTarget.MACHINE);
143
145
  this.dirtyBiases = true;
144
146
  }
145
147
  }));