@codingame/monaco-vscode-language-detection-worker-service-override 4.5.1 → 4.5.2

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": "4.5.1",
3
+ "version": "4.5.2",
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@4.5.1",
32
+ "vscode": "npm:@codingame/monaco-vscode-api@4.5.2",
33
33
  "@vscode/vscode-languagedetection": "npm:@codingame/vscode-languagedetection@1.0.23"
34
34
  }
35
35
  }
@@ -20,6 +20,7 @@ import { Schemas } from 'vscode/vscode/vs/base/common/network';
20
20
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
21
21
 
22
22
  var LanguageDetectionStatusContribution_1;
23
+ const _moduleId = "vs/workbench/contrib/languageDetection/browser/languageDetection.contribution";
23
24
  const detectLanguageCommandId = 'editor.detectLanguage';
24
25
  let LanguageDetectionStatusContribution = class LanguageDetectionStatusContribution {
25
26
  static { LanguageDetectionStatusContribution_1 = this; }
@@ -31,9 +32,9 @@ let LanguageDetectionStatusContribution = class LanguageDetectionStatusContribut
31
32
  this._editorService = _editorService;
32
33
  this._languageService = _languageService;
33
34
  this._keybindingService = _keybindingService;
34
- this._disposables = ( new DisposableStore());
35
- this._delayer = ( new ThrottledDelayer(1000));
36
- this._renderDisposables = ( new DisposableStore());
35
+ this._disposables = ( (new DisposableStore()));
36
+ this._delayer = ( (new ThrottledDelayer(1000)));
37
+ this._renderDisposables = ( (new DisposableStore()));
37
38
  _editorService.onDidActiveEditorChange(() => this._update(true), this, this._disposables);
38
39
  this._update(false);
39
40
  }
@@ -71,29 +72,15 @@ let LanguageDetectionStatusContribution = class LanguageDetectionStatusContribut
71
72
  const existing = editorModel.getLanguageId();
72
73
  if (lang && lang !== existing && skip[existing] !== lang) {
73
74
  const detectedName = this._languageService.getLanguageName(lang) || lang;
74
- let tooltip = ( localizeWithPath(
75
- 'vs/workbench/contrib/languageDetection/browser/languageDetection.contribution',
76
- 'status.autoDetectLanguage',
77
- "Accept Detected Language: {0}",
78
- detectedName
79
- ));
75
+ let tooltip = ( localizeWithPath(_moduleId, 0, "Accept Detected Language: {0}", detectedName));
80
76
  const keybinding = this._keybindingService.lookupKeybinding(detectLanguageCommandId);
81
77
  const label = keybinding?.getLabel();
82
78
  if (label) {
83
79
  tooltip += ` (${label})`;
84
80
  }
85
81
  const props = {
86
- name: ( localizeWithPath(
87
- 'vs/workbench/contrib/languageDetection/browser/languageDetection.contribution',
88
- 'langDetection.name',
89
- "Language Detection"
90
- )),
91
- ariaLabel: ( localizeWithPath(
92
- 'vs/workbench/contrib/languageDetection/browser/languageDetection.contribution',
93
- 'langDetection.aria',
94
- "Change to Detected Language: {0}",
95
- lang
96
- )),
82
+ name: ( localizeWithPath(_moduleId, 1, "Language Detection")),
83
+ ariaLabel: ( localizeWithPath(_moduleId, 2, "Change to Detected Language: {0}", lang)),
97
84
  tooltip,
98
85
  command: detectLanguageCommandId,
99
86
  text: '$(lightbulb-autofix)',
@@ -112,26 +99,25 @@ let LanguageDetectionStatusContribution = class LanguageDetectionStatusContribut
112
99
  }
113
100
  }
114
101
  };
115
- LanguageDetectionStatusContribution = LanguageDetectionStatusContribution_1 = ( __decorate([
116
- ( __param(0, ILanguageDetectionService)),
117
- ( __param(1, IStatusbarService)),
118
- ( __param(2, IConfigurationService)),
119
- ( __param(3, IEditorService)),
120
- ( __param(4, ILanguageService)),
121
- ( __param(5, IKeybindingService))
122
- ], LanguageDetectionStatusContribution));
123
- ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(LanguageDetectionStatusContribution, 3 );
102
+ LanguageDetectionStatusContribution = LanguageDetectionStatusContribution_1 = ( (__decorate([
103
+ ( (__param(0, ILanguageDetectionService))),
104
+ ( (__param(1, IStatusbarService))),
105
+ ( (__param(2, IConfigurationService))),
106
+ ( (__param(3, IEditorService))),
107
+ ( (__param(4, ILanguageService))),
108
+ ( (__param(5, IKeybindingService)))
109
+ ], LanguageDetectionStatusContribution)));
110
+ ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(LanguageDetectionStatusContribution, 3 );
124
111
  registerAction2(class extends Action2 {
125
112
  constructor() {
126
113
  super({
127
114
  id: detectLanguageCommandId,
128
- title: ( localize2WithPath(
129
- 'vs/workbench/contrib/languageDetection/browser/languageDetection.contribution',
130
- 'detectlang',
131
- "Detect Language from Content"
132
- )),
115
+ title: ( localize2WithPath(_moduleId, 3, "Detect Language from Content")),
133
116
  f1: true,
134
- precondition: ( ContextKeyExpr.and(( NOTEBOOK_EDITOR_EDITABLE.toNegated()), EditorContextKeys.editorTextFocus)),
117
+ precondition: ( (ContextKeyExpr.and(
118
+ (NOTEBOOK_EDITOR_EDITABLE.toNegated()),
119
+ EditorContextKeys.editorTextFocus
120
+ ))),
135
121
  keybinding: { primary: 34 | 512 | 1024 , weight: 200 }
136
122
  });
137
123
  }
@@ -147,11 +133,7 @@ registerAction2(class extends Action2 {
147
133
  editor.getModel()?.setLanguage(lang, LanguageDetectionLanguageEventSource);
148
134
  }
149
135
  else {
150
- notificationService.warn(( localizeWithPath(
151
- 'vs/workbench/contrib/languageDetection/browser/languageDetection.contribution',
152
- 'noDetection',
153
- "Unable to detect editor language"
154
- )));
136
+ notificationService.warn(( localizeWithPath(_moduleId, 4, "Unable to detect editor language")));
155
137
  }
156
138
  }
157
139
  }
@@ -74,7 +74,7 @@ class LanguageDetectionSimpleWorker extends EditorSimpleWorker {
74
74
  }
75
75
  catch (e) {
76
76
  const message = `Failed to parse model JSON.`;
77
- throw new Error(message);
77
+ throw ( new Error(message));
78
78
  }
79
79
  },
80
80
  weightsLoaderFunc: async () => {