@codingame/monaco-vscode-snippets-service-override 9.0.3 → 10.0.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": "9.0.3",
3
+ "version": "10.0.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -26,7 +26,7 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@9.0.3",
30
- "@codingame/monaco-vscode-files-service-override": "9.0.3"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@10.0.0",
30
+ "@codingame/monaco-vscode-files-service-override": "10.0.0"
31
31
  }
32
32
  }
package/snippets.js CHANGED
@@ -8,7 +8,10 @@ import { registerServiceInitializeParticipant } from 'vscode/lifecycle';
8
8
  import './vscode/src/vs/workbench/contrib/snippets/browser/snippets.contribution.js';
9
9
 
10
10
  registerServiceInitializeParticipant(async (accessor) => {
11
- void accessor.get(ILifecycleService).when(2 ).then(() => {
11
+ void accessor
12
+ .get(ILifecycleService)
13
+ .when(2 )
14
+ .then(() => {
12
15
  StandaloneServices.get(ISnippetsService);
13
16
  });
14
17
  });
@@ -13,7 +13,6 @@ import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/
13
13
  import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
14
14
  import { SnippetsAction } from 'vscode/vscode/vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions';
15
15
  import { ISnippetsService } from 'vscode/vscode/vs/workbench/contrib/snippets/browser/snippets.service';
16
- import { SnippetSource } from 'vscode/vscode/vs/workbench/contrib/snippets/browser/snippetsFile';
17
16
  import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles.service';
18
17
  import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
19
18
 
@@ -30,7 +29,7 @@ async function computePicks(snippetService, userDataProfileService, languageServ
30
29
  const seen = ( (new Set()));
31
30
  const added = ( (new Map()));
32
31
  for (const file of await snippetService.getSnippetFiles()) {
33
- if (file.source === SnippetSource.Extension) {
32
+ if (file.source === 3 ) {
34
33
  continue;
35
34
  }
36
35
  if (file.isGlobalSnippets) {
@@ -58,15 +57,15 @@ async function computePicks(snippetService, userDataProfileService, languageServ
58
57
  label: basename(file.location),
59
58
  filepath: file.location,
60
59
  description: names.size === 0
61
- ? ( localize(6770, "(global)"))
62
- : ( localize(6771, "({0})", [...names].join(', ')))
60
+ ? ( localize(6652, "(global)"))
61
+ : ( localize(6653, "({0})", [...names].join(', ')))
63
62
  };
64
63
  existing.push(snippet);
65
64
  if (!source) {
66
65
  continue;
67
66
  }
68
67
  const detail = ( localize(
69
- 6772,
68
+ 6654,
70
69
  "({0}) {1}",
71
70
  source,
72
71
  labelService.getUriLabel(file.location, { relative: true })
@@ -128,16 +127,16 @@ async function createSnippetFile(scope, defaultPath, quickInputService, fileServ
128
127
  }
129
128
  await fileService.createFolder(defaultPath);
130
129
  const input = await quickInputService.input({
131
- placeHolder: ( localize(6773, "Type snippet file name")),
130
+ placeHolder: ( localize(6655, "Type snippet file name")),
132
131
  async validateInput(input) {
133
132
  if (!input) {
134
- return ( localize(6774, "Invalid file name"));
133
+ return ( localize(6656, "Invalid file name"));
135
134
  }
136
135
  if (!isValidBasename(input)) {
137
- return ( localize(6775, "'{0}' is not a valid file name", input));
136
+ return ( localize(6657, "'{0}' is not a valid file name", input));
138
137
  }
139
138
  if (await fileService.exists(createSnippetUri(input))) {
140
- return ( localize(6776, "'{0}' already exists", input));
139
+ return ( localize(6658, "'{0}' already exists", input));
141
140
  }
142
141
  return undefined;
143
142
  }
@@ -196,10 +195,10 @@ class ConfigureSnippetsAction extends SnippetsAction {
196
195
  constructor() {
197
196
  super({
198
197
  id: 'workbench.action.openSnippets',
199
- title: ( localize2(6777, "Configure Snippets")),
198
+ title: ( localize2(6659, "Configure Snippets")),
200
199
  shortTitle: {
201
- ...( localize2(6778, "Snippets")),
202
- mnemonicTitle: ( localize(6779, "&&Snippets")),
200
+ ...( localize2(6660, "Snippets")),
201
+ mnemonicTitle: ( localize(6661, "&&Snippets")),
203
202
  },
204
203
  f1: true,
205
204
  menu: [
@@ -221,27 +220,27 @@ class ConfigureSnippetsAction extends SnippetsAction {
221
220
  const picks = await computePicks(snippetService, userDataProfileService, languageService, labelService);
222
221
  const existing = picks.existing;
223
222
  const globalSnippetPicks = [{
224
- scope: ( localize(6780, 'global')),
225
- label: ( localize(6781, "New Global Snippets file...")),
223
+ scope: ( localize(6662, 'global')),
224
+ label: ( localize(6663, "New Global Snippets file...")),
226
225
  uri: userDataProfileService.currentProfile.snippetsHome
227
226
  }];
228
227
  const workspaceSnippetPicks = [];
229
228
  for (const folder of workspaceService.getWorkspace().folders) {
230
229
  workspaceSnippetPicks.push({
231
- scope: ( localize(6782, "{0} workspace", folder.name)),
232
- label: ( localize(6783, "New Snippets file for '{0}'...", folder.name)),
230
+ scope: ( localize(6664, "{0} workspace", folder.name)),
231
+ label: ( localize(6665, "New Snippets file for '{0}'...", folder.name)),
233
232
  uri: folder.toResource('.vscode')
234
233
  });
235
234
  }
236
235
  if (existing.length > 0) {
237
- existing.unshift({ type: 'separator', label: ( localize(6784, "Existing Snippets")) });
238
- existing.push({ type: 'separator', label: ( localize(6785, "New Snippets")) });
236
+ existing.unshift({ type: 'separator', label: ( localize(6666, "Existing Snippets")) });
237
+ existing.push({ type: 'separator', label: ( localize(6667, "New Snippets")) });
239
238
  }
240
239
  else {
241
- existing.push({ type: 'separator', label: ( localize(6785, "New Snippets")) });
240
+ existing.push({ type: 'separator', label: ( localize(6667, "New Snippets")) });
242
241
  }
243
242
  const pick = await quickInputService.pick([].concat(existing, globalSnippetPicks, workspaceSnippetPicks, picks.future), {
244
- placeHolder: ( localize(6786, "Select Snippets File or Create Snippets")),
243
+ placeHolder: ( localize(6668, "Select Snippets File or Create Snippets")),
245
244
  matchOnDescription: true
246
245
  });
247
246
  if (globalSnippetPicks.indexOf(pick) >= 0) {
@@ -7,7 +7,7 @@ import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/c
7
7
  import { SnippetEditorAction } from 'vscode/vscode/vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions';
8
8
  import { pickSnippet } from '../snippetPicker.js';
9
9
  import { ISnippetsService } from 'vscode/vscode/vs/workbench/contrib/snippets/browser/snippets.service';
10
- import { Snippet, SnippetSource } from 'vscode/vscode/vs/workbench/contrib/snippets/browser/snippetsFile';
10
+ import { Snippet } from 'vscode/vscode/vs/workbench/contrib/snippets/browser/snippetsFile';
11
11
 
12
12
  class Args {
13
13
  static fromUser(arg) {
@@ -39,7 +39,7 @@ class InsertSnippetAction extends SnippetEditorAction {
39
39
  constructor() {
40
40
  super({
41
41
  id: 'editor.action.insertSnippet',
42
- title: ( localize2(6789, "Insert Snippet")),
42
+ title: ( localize2(6671, "Insert Snippet")),
43
43
  f1: true,
44
44
  precondition: EditorContextKeys.writable,
45
45
  metadata: {
@@ -84,7 +84,7 @@ class InsertSnippetAction extends SnippetEditorAction {
84
84
  '',
85
85
  snippet,
86
86
  '',
87
- SnippetSource.User,
87
+ 1 ,
88
88
  `random/${Math.random()}`
89
89
  ))));
90
90
  }
@@ -18,7 +18,7 @@ async function getSurroundableSnippets(snippetsService, model, position, include
18
18
  class SurroundWithSnippetEditorAction extends SnippetEditorAction {
19
19
  static { this.options = {
20
20
  id: 'editor.action.surroundWithSnippet',
21
- title: ( localize2(6790, "Surround with Snippet..."))
21
+ title: ( localize2(6672, "Surround with Snippet..."))
22
22
  }; }
23
23
  constructor() {
24
24
  super({
@@ -16,7 +16,7 @@ let SurroundWithSnippetCodeActionProvider = class SurroundWithSnippetCodeActionP
16
16
  static { this._MAX_CODE_ACTIONS = 4; }
17
17
  static { this._overflowCommandCodeAction = {
18
18
  kind: CodeActionKind.SurroundWith.value,
19
- title: ( localize(6791, "More...")),
19
+ title: ( localize(6673, "More...")),
20
20
  command: {
21
21
  id: SurroundWithSnippetEditorAction.options.id,
22
22
  title: SurroundWithSnippetEditorAction.options.title.value,
@@ -41,7 +41,7 @@ let SurroundWithSnippetCodeActionProvider = class SurroundWithSnippetCodeActionP
41
41
  break;
42
42
  }
43
43
  actions.push({
44
- title: ( localize(6792, "{0}", snippet.name)),
44
+ title: ( localize(6674, "{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(6793, 'Start with Snippet')),
62
+ title: ( localize(6675, '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(6794, 'Start with: {0}', snippet.name)),
85
+ title: ( localize(6676, 'Start with: {0}', snippet.name)),
86
86
  kind: CodeActionKind.SurroundWith.value,
87
87
  edit: asWorkspaceEdit(model, model.getFullModelRange(), snippet)
88
88
  });
@@ -1,6 +1,5 @@
1
1
  import { localize } from 'vscode/vscode/vs/nls';
2
2
  import { ISnippetsService } from 'vscode/vscode/vs/workbench/contrib/snippets/browser/snippets.service';
3
- import { SnippetSource } from 'vscode/vscode/vs/workbench/contrib/snippets/browser/snippetsFile';
4
3
  import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
5
4
  import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
6
5
  import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
@@ -30,31 +29,31 @@ async function pickSnippet(accessor, languageIdOrSnippets) {
30
29
  if (!prevSnippet || prevSnippet.snippetSource !== snippet.snippetSource || prevSnippet.source !== snippet.source) {
31
30
  let label = '';
32
31
  switch (snippet.snippetSource) {
33
- case SnippetSource.User:
34
- label = ( localize(10581, "User Snippets"));
32
+ case 1 :
33
+ label = ( localize(10654, "User Snippets"));
35
34
  break;
36
- case SnippetSource.Extension:
35
+ case 3 :
37
36
  label = snippet.source;
38
37
  break;
39
- case SnippetSource.Workspace:
40
- label = ( localize(10582, "Workspace Snippets"));
38
+ case 2 :
39
+ label = ( localize(10655, "Workspace Snippets"));
41
40
  break;
42
41
  }
43
42
  result.push({ type: 'separator', label });
44
43
  }
45
- if (snippet.snippetSource === SnippetSource.Extension) {
44
+ if (snippet.snippetSource === 3 ) {
46
45
  const isEnabled = snippetService.isEnabled(snippet);
47
46
  if (isEnabled) {
48
47
  pick.buttons = [{
49
48
  iconClass: ThemeIcon.asClassName(Codicon.eyeClosed),
50
- tooltip: ( localize(10583, 'Hide from IntelliSense'))
49
+ tooltip: ( localize(10656, 'Hide from IntelliSense'))
51
50
  }];
52
51
  }
53
52
  else {
54
- pick.description = ( localize(10584, "(hidden from IntelliSense)"));
53
+ pick.description = ( localize(10657, "(hidden from IntelliSense)"));
55
54
  pick.buttons = [{
56
55
  iconClass: ThemeIcon.asClassName(Codicon.eye),
57
- tooltip: ( localize(10585, 'Show in IntelliSense'))
56
+ tooltip: ( localize(10658, 'Show in IntelliSense'))
58
57
  }];
59
58
  }
60
59
  }
@@ -65,7 +64,7 @@ async function pickSnippet(accessor, languageIdOrSnippets) {
65
64
  };
66
65
  const disposables = ( (new DisposableStore()));
67
66
  const picker = disposables.add(quickInputService.createQuickPick({ useSeparators: true }));
68
- picker.placeholder = ( localize(10586, "Select a snippet"));
67
+ picker.placeholder = ( localize(10659, "Select a snippet"));
69
68
  picker.matchOnDetail = true;
70
69
  picker.ignoreFocusOut = false;
71
70
  picker.keepScrollPosition = true;
@@ -76,7 +75,7 @@ async function pickSnippet(accessor, languageIdOrSnippets) {
76
75
  }));
77
76
  picker.items = makeSnippetPicks();
78
77
  if (!picker.items.length) {
79
- picker.validationMessage = ( localize(10587, "No snippet available"));
78
+ picker.validationMessage = ( localize(10660, "No snippet available"));
80
79
  }
81
80
  picker.show();
82
81
  await Promise.race([Event.toPromise(picker.onDidAccept), Event.toPromise(picker.onDidHide)]);
@@ -1,7 +1,6 @@
1
1
  import { localize } from 'vscode/vscode/vs/nls';
2
2
  import { registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
3
3
  import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
4
- import 'vscode/vscode/vs/platform/instantiation/common/extensions';
5
4
  import { Extensions as Extensions$2 } from 'vscode/vscode/vs/platform/jsonschemas/common/jsonContributionRegistry';
6
5
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
7
6
  import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
@@ -12,7 +11,6 @@ import { SurroundWithSnippetEditorAction } from './commands/surroundWithSnippet.
12
11
  import { SnippetCodeActions } from './snippetCodeActionProvider.js';
13
12
  import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
14
13
  import 'vscode/vscode/vs/workbench/contrib/snippets/browser/snippetsService';
15
- import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
16
14
  import { Extensions as Extensions$1 } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
17
15
  import 'vscode/vscode/vs/workbench/contrib/snippets/browser/tabCompletion';
18
16
  import { editorConfigurationBaseNode } from 'vscode/vscode/vs/editor/common/config/editorConfigurationSchema';
@@ -23,7 +21,7 @@ registerAction2(SurroundWithSnippetEditorAction);
23
21
  registerAction2(ApplyFileSnippetAction);
24
22
  registerAction2(ConfigureSnippetsAction);
25
23
  const workbenchContribRegistry = ( (Registry.as(Extensions.Workbench)));
26
- workbenchContribRegistry.registerWorkbenchContribution(SnippetCodeActions, LifecyclePhase.Restored);
24
+ workbenchContribRegistry.registerWorkbenchContribution(SnippetCodeActions, 3 );
27
25
  ( (Registry
28
26
  .as(Extensions$1.Configuration)))
29
27
  .registerConfiguration({
@@ -31,7 +29,7 @@ workbenchContribRegistry.registerWorkbenchContribution(SnippetCodeActions, Lifec
31
29
  'properties': {
32
30
  'editor.snippets.codeActions.enabled': {
33
31
  'description': ( localize(
34
- 3016,
32
+ 2977,
35
33
  'Controls if surround-with-snippets or file template snippets show as Code Actions.'
36
34
  )),
37
35
  'type': 'boolean',
@@ -42,16 +40,16 @@ workbenchContribRegistry.registerWorkbenchContribution(SnippetCodeActions, Lifec
42
40
  const languageScopeSchemaId = 'vscode://schemas/snippets';
43
41
  const snippetSchemaProperties = {
44
42
  prefix: {
45
- description: ( localize(3017, 'The prefix to use when selecting the snippet in intellisense')),
43
+ description: ( localize(2978, 'The prefix to use when selecting the snippet in intellisense')),
46
44
  type: ['string', 'array']
47
45
  },
48
46
  isFileTemplate: {
49
- description: ( localize(3018, 'The snippet is meant to populate or replace a whole file')),
47
+ description: ( localize(2979, 'The snippet is meant to populate or replace a whole file')),
50
48
  type: 'boolean'
51
49
  },
52
50
  body: {
53
51
  markdownDescription: ( localize(
54
- 3019,
52
+ 2980,
55
53
  '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`.'
56
54
  )),
57
55
  type: ['string', 'array'],
@@ -60,7 +58,7 @@ const snippetSchemaProperties = {
60
58
  }
61
59
  },
62
60
  description: {
63
- description: ( localize(3020, 'The snippet description.')),
61
+ description: ( localize(2981, 'The snippet description.')),
64
62
  type: ['string', 'array']
65
63
  }
66
64
  };
@@ -69,11 +67,11 @@ const languageScopeSchema = {
69
67
  allowComments: true,
70
68
  allowTrailingCommas: true,
71
69
  defaultSnippets: [{
72
- label: ( localize(3021, "Empty snippet")),
70
+ label: ( localize(2982, "Empty snippet")),
73
71
  body: { '${1:snippetName}': { 'prefix': '${2:prefix}', 'body': '${3:snippet}', 'description': '${4:description}' } }
74
72
  }],
75
73
  type: 'object',
76
- description: ( localize(3022, 'User snippet configuration')),
74
+ description: ( localize(2983, 'User snippet configuration')),
77
75
  additionalProperties: {
78
76
  type: 'object',
79
77
  required: ['body'],
@@ -87,11 +85,11 @@ const globalSchema = {
87
85
  allowComments: true,
88
86
  allowTrailingCommas: true,
89
87
  defaultSnippets: [{
90
- label: ( localize(3021, "Empty snippet")),
88
+ label: ( localize(2982, "Empty snippet")),
91
89
  body: { '${1:snippetName}': { 'scope': '${2:scope}', 'prefix': '${3:prefix}', 'body': '${4:snippet}', 'description': '${5:description}' } }
92
90
  }],
93
91
  type: 'object',
94
- description: ( localize(3022, 'User snippet configuration')),
92
+ description: ( localize(2983, 'User snippet configuration')),
95
93
  additionalProperties: {
96
94
  type: 'object',
97
95
  required: ['body'],
@@ -99,7 +97,7 @@ const globalSchema = {
99
97
  ...snippetSchemaProperties,
100
98
  scope: {
101
99
  description: ( localize(
102
- 3023,
100
+ 2984,
103
101
  "A list of language names to which this snippet applies, e.g. 'typescript,javascript'."
104
102
  )),
105
103
  type: 'string'