@codingame/monaco-vscode-snippets-service-override 1.83.2 → 1.83.3-next.0

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-snippets-service-override",
3
- "version": "1.83.2",
3
+ "version": "1.83.3-next.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,7 +18,7 @@
18
18
  "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@1.83.2",
21
+ "vscode": "npm:@codingame/monaco-vscode-api@1.83.3-next.0",
22
22
  "monaco-editor": "0.44.0"
23
23
  }
24
24
  }
@@ -1,10 +1,10 @@
1
1
  import { EditorAction2 } from 'monaco-editor/esm/vs/editor/browser/editorExtensions.js';
2
- import { localize } from 'monaco-editor/esm/vs/nls.js';
2
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
3
3
  import { Action2 } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
4
4
 
5
5
  const defaultOptions = {
6
6
  category: {
7
- value: ( localize('snippets', 'Snippets')),
7
+ value: localizeWithPath('vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions', 'snippets', 'Snippets'),
8
8
  original: 'Snippets'
9
9
  },
10
10
  };
@@ -56,19 +56,14 @@ async function computePicks(snippetService, userDataProfileService, languageServ
56
56
  label: basename(file.location),
57
57
  filepath: file.location,
58
58
  description: names.size === 0
59
- ? ( nls.localize('global.scope', "(global)"))
60
- : ( nls.localize('global.1', "({0})", [...names].join(', ')))
59
+ ? nls.localizeWithPath('vs/workbench/contrib/snippets/browser/commands/configureSnippets', 'global.scope', "(global)")
60
+ : nls.localizeWithPath('vs/workbench/contrib/snippets/browser/commands/configureSnippets', 'global.1', "({0})", [...names].join(', '))
61
61
  };
62
62
  existing.push(snippet);
63
63
  if (!source) {
64
64
  continue;
65
65
  }
66
- const detail = ( nls.localize(
67
- 'detail.label',
68
- "({0}) {1}",
69
- source,
70
- labelService.getUriLabel(file.location, { relative: true })
71
- ));
66
+ const detail = nls.localizeWithPath('vs/workbench/contrib/snippets/browser/commands/configureSnippets', 'detail.label', "({0}) {1}", source, labelService.getUriLabel(file.location, { relative: true }));
72
67
  const lastItem = added.get(basename(file.location));
73
68
  if (lastItem) {
74
69
  snippet.detail = detail;
@@ -125,16 +120,16 @@ async function createSnippetFile(scope, defaultPath, quickInputService, fileServ
125
120
  }
126
121
  await fileService.createFolder(defaultPath);
127
122
  const input = await quickInputService.input({
128
- placeHolder: ( nls.localize('name', "Type snippet file name")),
123
+ placeHolder: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/commands/configureSnippets', 'name', "Type snippet file name"),
129
124
  async validateInput(input) {
130
125
  if (!input) {
131
- return ( nls.localize('bad_name1', "Invalid file name"));
126
+ return nls.localizeWithPath('vs/workbench/contrib/snippets/browser/commands/configureSnippets', 'bad_name1', "Invalid file name");
132
127
  }
133
128
  if (!isValidBasename(input)) {
134
- return ( nls.localize('bad_name2', "'{0}' is not a valid file name", input));
129
+ return nls.localizeWithPath('vs/workbench/contrib/snippets/browser/commands/configureSnippets', 'bad_name2', "'{0}' is not a valid file name", input);
135
130
  }
136
131
  if (await fileService.exists(createSnippetUri(input))) {
137
- return ( nls.localize('bad_name3', "'{0}' already exists", input));
132
+ return nls.localizeWithPath('vs/workbench/contrib/snippets/browser/commands/configureSnippets', 'bad_name3', "'{0}' already exists", input);
138
133
  }
139
134
  return undefined;
140
135
  }
@@ -194,15 +189,12 @@ class ConfigureSnippetsAction extends SnippetsAction {
194
189
  super({
195
190
  id: 'workbench.action.openSnippets',
196
191
  title: {
197
- value: ( nls.localize('openSnippet.label', "Configure User Snippets")),
192
+ value: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/commands/configureSnippets', 'openSnippet.label', "Configure User Snippets"),
198
193
  original: 'Configure User Snippets'
199
194
  },
200
195
  shortTitle: {
201
- value: ( nls.localize('userSnippets', "User Snippets")),
202
- mnemonicTitle: ( nls.localize(
203
- { key: 'miOpenSnippets', comment: ['&& denotes a mnemonic'] },
204
- "User &&Snippets"
205
- )),
196
+ value: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/commands/configureSnippets', 'userSnippets', "User Snippets"),
197
+ mnemonicTitle: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/commands/configureSnippets', { key: 'miOpenSnippets', comment: ['&& denotes a mnemonic'] }, "User &&Snippets"),
206
198
  original: 'User Snippets'
207
199
  },
208
200
  f1: true,
@@ -225,27 +217,27 @@ class ConfigureSnippetsAction extends SnippetsAction {
225
217
  const picks = await computePicks(snippetService, userDataProfileService, languageService, labelService);
226
218
  const existing = picks.existing;
227
219
  const globalSnippetPicks = [{
228
- scope: ( nls.localize('new.global_scope', 'global')),
229
- label: ( nls.localize('new.global', "New Global Snippets file...")),
220
+ scope: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/commands/configureSnippets', 'new.global_scope', 'global'),
221
+ label: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/commands/configureSnippets', 'new.global', "New Global Snippets file..."),
230
222
  uri: userDataProfileService.currentProfile.snippetsHome
231
223
  }];
232
224
  const workspaceSnippetPicks = [];
233
225
  for (const folder of workspaceService.getWorkspace().folders) {
234
226
  workspaceSnippetPicks.push({
235
- scope: ( nls.localize('new.workspace_scope', "{0} workspace", folder.name)),
236
- label: ( nls.localize('new.folder', "New Snippets file for '{0}'...", folder.name)),
227
+ scope: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/commands/configureSnippets', 'new.workspace_scope', "{0} workspace", folder.name),
228
+ label: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/commands/configureSnippets', 'new.folder', "New Snippets file for '{0}'...", folder.name),
237
229
  uri: folder.toResource('.vscode')
238
230
  });
239
231
  }
240
232
  if (existing.length > 0) {
241
- existing.unshift({ type: 'separator', label: ( nls.localize('group.global', "Existing Snippets")) });
242
- existing.push({ type: 'separator', label: ( nls.localize('new.global.sep', "New Snippets")) });
233
+ existing.unshift({ type: 'separator', label: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/commands/configureSnippets', 'group.global', "Existing Snippets") });
234
+ existing.push({ type: 'separator', label: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/commands/configureSnippets', 'new.global.sep', "New Snippets") });
243
235
  }
244
236
  else {
245
- existing.push({ type: 'separator', label: ( nls.localize('new.global.sep', "New Snippets")) });
237
+ existing.push({ type: 'separator', label: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/commands/configureSnippets', 'new.global.sep', "New Snippets") });
246
238
  }
247
239
  const pick = await quickInputService.pick([].concat(existing, globalSnippetPicks, workspaceSnippetPicks, picks.future), {
248
- placeHolder: ( nls.localize('openSnippet.pickLanguage', "Select Snippets File or Create Snippets")),
240
+ placeHolder: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/commands/configureSnippets', 'openSnippet.pickLanguage', "Select Snippets File or Create Snippets"),
249
241
  matchOnDescription: true
250
242
  });
251
243
  if (globalSnippetPicks.indexOf(pick) >= 0) {
@@ -3,7 +3,7 @@ import { compare } from 'monaco-editor/esm/vs/base/common/strings.js';
3
3
  import { getCodeEditor } from 'monaco-editor/esm/vs/editor/browser/editorBrowser.js';
4
4
  import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
5
5
  import { SnippetController2 } from 'monaco-editor/esm/vs/editor/contrib/snippet/browser/snippetController2.js';
6
- import { localize } from 'monaco-editor/esm/vs/nls.js';
6
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
7
7
  import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
8
8
  import { SnippetsAction } from './abstractSnippetsActions.js';
9
9
  import { ISnippetsService } from 'vscode/vscode/vs/workbench/contrib/snippets/browser/snippets';
@@ -15,7 +15,7 @@ class ApplyFileSnippetAction extends SnippetsAction {
15
15
  super({
16
16
  id: ApplyFileSnippetAction.Id,
17
17
  title: {
18
- value: ( localize('label', 'Fill File with Snippet')),
18
+ value: localizeWithPath('vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets', 'label', 'Fill File with Snippet'),
19
19
  original: 'Fill File with Snippet'
20
20
  },
21
21
  f1: true,
@@ -79,7 +79,7 @@ class ApplyFileSnippetAction extends SnippetsAction {
79
79
  }
80
80
  }
81
81
  const pick = await quickInputService.pick(picks, {
82
- placeHolder: ( localize('placeholder', 'Select a snippet')),
82
+ placeHolder: localizeWithPath('vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets', 'placeholder', 'Select a snippet'),
83
83
  matchOnDetail: true,
84
84
  });
85
85
  return pick?.snippet;
@@ -38,7 +38,7 @@ class InsertSnippetAction extends SnippetEditorAction {
38
38
  super({
39
39
  id: 'editor.action.insertSnippet',
40
40
  title: {
41
- value: ( nls.localize('snippet.suggestions.label', "Insert Snippet")),
41
+ value: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/commands/insertSnippet', 'snippet.suggestions.label', "Insert Snippet"),
42
42
  original: 'Insert Snippet'
43
43
  },
44
44
  f1: true,
@@ -1,6 +1,6 @@
1
1
  import { EditorContextKeys } from 'monaco-editor/esm/vs/editor/common/editorContextKeys.js';
2
2
  import { SnippetController2 } from 'monaco-editor/esm/vs/editor/contrib/snippet/browser/snippetController2.js';
3
- import { localize } from 'monaco-editor/esm/vs/nls.js';
3
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
4
4
  import { IClipboardService } from 'monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js';
5
5
  import { ContextKeyExpr } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
6
6
  import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
@@ -19,7 +19,7 @@ class SurroundWithSnippetEditorAction extends SnippetEditorAction {
19
19
  static { this.options = {
20
20
  id: 'editor.action.surroundWithSnippet',
21
21
  title: {
22
- value: ( localize('label', 'Surround With Snippet...')),
22
+ value: localizeWithPath('vs/workbench/contrib/snippets/browser/commands/surroundWithSnippet', 'label', 'Surround With Snippet...'),
23
23
  original: 'Surround With Snippet...'
24
24
  }
25
25
  }; }
@@ -3,7 +3,7 @@ import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
3
3
  import { Selection } from 'monaco-editor/esm/vs/editor/common/core/selection.js';
4
4
  import { ILanguageFeaturesService } from 'monaco-editor/esm/vs/editor/common/services/languageFeatures.js';
5
5
  import { CodeActionKind } from 'monaco-editor/esm/vs/editor/contrib/codeAction/common/types.js';
6
- import { localize } from 'monaco-editor/esm/vs/nls.js';
6
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
7
7
  import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
8
8
  import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
9
9
  import { ApplyFileSnippetAction } from './commands/fileTemplateSnippets.js';
@@ -41,7 +41,7 @@ let SurroundWithSnippetCodeActionProvider = class SurroundWithSnippetCodeActionP
41
41
  break;
42
42
  }
43
43
  actions.push({
44
- title: ( localize('codeAction', "Surround With: {0}", snippet.name)),
44
+ title: localizeWithPath('vs/workbench/contrib/snippets/browser/snippetCodeActionProvider', 'codeAction', "Surround With: {0}", snippet.name),
45
45
  kind: CodeActionKind.SurroundWith.value,
46
46
  edit: asWorkspaceEdit(model, range, snippet)
47
47
  });
@@ -59,7 +59,7 @@ let FileTemplateCodeActionProvider = class FileTemplateCodeActionProvider {
59
59
  static { FileTemplateCodeActionProvider_1 = this; }
60
60
  static { this._MAX_CODE_ACTIONS = 4; }
61
61
  static { this._overflowCommandCodeAction = {
62
- title: ( localize('overflow.start.title', 'Start with Snippet')),
62
+ title: localizeWithPath('vs/workbench/contrib/snippets/browser/snippetCodeActionProvider', 'overflow.start.title', 'Start with Snippet'),
63
63
  kind: CodeActionKind.SurroundWith.value,
64
64
  command: {
65
65
  id: ApplyFileSnippetAction.Id,
@@ -82,7 +82,7 @@ let FileTemplateCodeActionProvider = class FileTemplateCodeActionProvider {
82
82
  break;
83
83
  }
84
84
  actions.push({
85
- title: ( localize('title', 'Start with: {0}', snippet.name)),
85
+ title: localizeWithPath('vs/workbench/contrib/snippets/browser/snippetCodeActionProvider', 'title', 'Start with: {0}', snippet.name),
86
86
  kind: CodeActionKind.SurroundWith.value,
87
87
  edit: asWorkspaceEdit(model, model.getFullModelRange(), snippet)
88
88
  });
@@ -29,13 +29,13 @@ async function pickSnippet(accessor, languageIdOrSnippets) {
29
29
  let label = '';
30
30
  switch (snippet.snippetSource) {
31
31
  case 1 :
32
- label = ( nls.localize('sep.userSnippet', "User Snippets"));
32
+ label = nls.localizeWithPath('vs/workbench/contrib/snippets/browser/snippetPicker', 'sep.userSnippet', "User Snippets");
33
33
  break;
34
34
  case 3 :
35
35
  label = snippet.source;
36
36
  break;
37
37
  case 2 :
38
- label = ( nls.localize('sep.workspaceSnippet', "Workspace Snippets"));
38
+ label = nls.localizeWithPath('vs/workbench/contrib/snippets/browser/snippetPicker', 'sep.workspaceSnippet', "Workspace Snippets");
39
39
  break;
40
40
  }
41
41
  result.push({ type: 'separator', label });
@@ -45,14 +45,14 @@ async function pickSnippet(accessor, languageIdOrSnippets) {
45
45
  if (isEnabled) {
46
46
  pick.buttons = [{
47
47
  iconClass: ThemeIcon.asClassName(Codicon.eyeClosed),
48
- tooltip: ( nls.localize('disableSnippet', 'Hide from IntelliSense'))
48
+ tooltip: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/snippetPicker', 'disableSnippet', 'Hide from IntelliSense')
49
49
  }];
50
50
  }
51
51
  else {
52
- pick.description = ( nls.localize('isDisabled', "(hidden from IntelliSense)"));
52
+ pick.description = nls.localizeWithPath('vs/workbench/contrib/snippets/browser/snippetPicker', 'isDisabled', "(hidden from IntelliSense)");
53
53
  pick.buttons = [{
54
54
  iconClass: ThemeIcon.asClassName(Codicon.eye),
55
- tooltip: ( nls.localize('enable.snippet', 'Show in IntelliSense'))
55
+ tooltip: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/snippetPicker', 'enable.snippet', 'Show in IntelliSense')
56
56
  }];
57
57
  }
58
58
  }
@@ -62,7 +62,7 @@ async function pickSnippet(accessor, languageIdOrSnippets) {
62
62
  return result;
63
63
  };
64
64
  const picker = quickInputService.createQuickPick();
65
- picker.placeholder = ( nls.localize('pick.placeholder', "Select a snippet"));
65
+ picker.placeholder = nls.localizeWithPath('vs/workbench/contrib/snippets/browser/snippetPicker', 'pick.placeholder', "Select a snippet");
66
66
  picker.matchOnDetail = true;
67
67
  picker.ignoreFocusOut = false;
68
68
  picker.keepScrollPosition = true;
@@ -73,7 +73,7 @@ async function pickSnippet(accessor, languageIdOrSnippets) {
73
73
  });
74
74
  picker.items = makeSnippetPicks();
75
75
  if (!picker.items.length) {
76
- picker.validationMessage = ( nls.localize('pick.noSnippetAvailable', "No snippet available"));
76
+ picker.validationMessage = nls.localizeWithPath('vs/workbench/contrib/snippets/browser/snippetPicker', 'pick.noSnippetAvailable', "No snippet available");
77
77
  }
78
78
  picker.show();
79
79
  await Promise.race([Event.toPromise(picker.onDidAccept), Event.toPromise(picker.onDidHide)]);
@@ -25,10 +25,7 @@ workbenchContribRegistry.registerWorkbenchContribution(SnippetCodeActions, 3 );
25
25
  ...editorConfigurationBaseNode,
26
26
  'properties': {
27
27
  'editor.snippets.codeActions.enabled': {
28
- 'description': ( nls.localize(
29
- 'editor.snippets.codeActions.enabled',
30
- 'Controls if surround-with-snippets or file template snippets show as Code Actions.'
31
- )),
28
+ 'description': nls.localizeWithPath('vs/workbench/contrib/snippets/browser/snippets.contribution', 'editor.snippets.codeActions.enabled', 'Controls if surround-with-snippets or file template snippets show as Code Actions.'),
32
29
  'type': 'boolean',
33
30
  'default': true
34
31
  }
@@ -37,31 +34,22 @@ workbenchContribRegistry.registerWorkbenchContribution(SnippetCodeActions, 3 );
37
34
  const languageScopeSchemaId = 'vscode://schemas/snippets';
38
35
  const snippetSchemaProperties = {
39
36
  prefix: {
40
- description: ( nls.localize(
41
- 'snippetSchema.json.prefix',
42
- 'The prefix to use when selecting the snippet in intellisense'
43
- )),
37
+ description: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/snippets.contribution', 'snippetSchema.json.prefix', 'The prefix to use when selecting the snippet in intellisense'),
44
38
  type: ['string', 'array']
45
39
  },
46
40
  isFileTemplate: {
47
- description: ( nls.localize(
48
- 'snippetSchema.json.isFileTemplate',
49
- 'The snippet is meant to populate or replace a whole file'
50
- )),
41
+ description: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/snippets.contribution', 'snippetSchema.json.isFileTemplate', 'The snippet is meant to populate or replace a whole file'),
51
42
  type: 'boolean'
52
43
  },
53
44
  body: {
54
- markdownDescription: ( nls.localize(
55
- 'snippetSchema.json.body',
56
- 'The snippet content. Use `$1`, `${1:defaultText}` to define cursor positions, use `$0` for the final cursor position. Insert variable values with `${varName}` and `${varName:defaultText}`, e.g. `This is file: $TM_FILENAME`.'
57
- )),
45
+ markdownDescription: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/snippets.contribution', 'snippetSchema.json.body', 'The snippet content. Use `$1`, `${1:defaultText}` to define cursor positions, use `$0` for the final cursor position. Insert variable values with `${varName}` and `${varName:defaultText}`, e.g. `This is file: $TM_FILENAME`.'),
58
46
  type: ['string', 'array'],
59
47
  items: {
60
48
  type: 'string'
61
49
  }
62
50
  },
63
51
  description: {
64
- description: ( nls.localize('snippetSchema.json.description', 'The snippet description.')),
52
+ description: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/snippets.contribution', 'snippetSchema.json.description', 'The snippet description.'),
65
53
  type: ['string', 'array']
66
54
  }
67
55
  };
@@ -70,11 +58,11 @@ const languageScopeSchema = {
70
58
  allowComments: true,
71
59
  allowTrailingCommas: true,
72
60
  defaultSnippets: [{
73
- label: ( nls.localize('snippetSchema.json.default', "Empty snippet")),
61
+ label: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/snippets.contribution', 'snippetSchema.json.default', "Empty snippet"),
74
62
  body: { '${1:snippetName}': { 'prefix': '${2:prefix}', 'body': '${3:snippet}', 'description': '${4:description}' } }
75
63
  }],
76
64
  type: 'object',
77
- description: ( nls.localize('snippetSchema.json', 'User snippet configuration')),
65
+ description: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/snippets.contribution', 'snippetSchema.json', 'User snippet configuration'),
78
66
  additionalProperties: {
79
67
  type: 'object',
80
68
  required: ['body'],
@@ -88,21 +76,18 @@ const globalSchema = {
88
76
  allowComments: true,
89
77
  allowTrailingCommas: true,
90
78
  defaultSnippets: [{
91
- label: ( nls.localize('snippetSchema.json.default', "Empty snippet")),
79
+ label: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/snippets.contribution', 'snippetSchema.json.default', "Empty snippet"),
92
80
  body: { '${1:snippetName}': { 'scope': '${2:scope}', 'prefix': '${3:prefix}', 'body': '${4:snippet}', 'description': '${5:description}' } }
93
81
  }],
94
82
  type: 'object',
95
- description: ( nls.localize('snippetSchema.json', 'User snippet configuration')),
83
+ description: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/snippets.contribution', 'snippetSchema.json', 'User snippet configuration'),
96
84
  additionalProperties: {
97
85
  type: 'object',
98
86
  required: ['body'],
99
87
  properties: {
100
88
  ...snippetSchemaProperties,
101
89
  scope: {
102
- description: ( nls.localize(
103
- 'snippetSchema.json.scope',
104
- "A list of language names to which this snippet applies, e.g. 'typescript,javascript'."
105
- )),
90
+ description: nls.localizeWithPath('vs/workbench/contrib/snippets/browser/snippets.contribution', 'snippetSchema.json.scope', "A list of language names to which this snippet applies, e.g. 'typescript,javascript'."),
106
91
  type: 'string'
107
92
  }
108
93
  },