@codingame/monaco-vscode-snippets-service-override 1.83.5 → 1.83.7
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 +2 -2
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions.js +5 -1
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/configureSnippets.js +97 -18
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.js +10 -2
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/insertSnippet.js +5 -1
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/surroundWithSnippet.js +5 -1
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetCodeActionProvider.js +17 -3
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetPicker.js +35 -7
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippets.contribution.js +50 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-snippets-service-override",
|
|
3
|
-
"version": "1.83.
|
|
3
|
+
"version": "1.83.7",
|
|
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.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.83.7",
|
|
22
22
|
"monaco-editor": "0.44.0"
|
|
23
23
|
}
|
|
24
24
|
}
|
package/vscode/src/vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions.js
CHANGED
|
@@ -4,7 +4,11 @@ import { Action2 } from 'monaco-editor/esm/vs/platform/actions/common/actions.js
|
|
|
4
4
|
|
|
5
5
|
const defaultOptions = {
|
|
6
6
|
category: {
|
|
7
|
-
value: localizeWithPath(
|
|
7
|
+
value: ( localizeWithPath(
|
|
8
|
+
'vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions',
|
|
9
|
+
'snippets',
|
|
10
|
+
'Snippets'
|
|
11
|
+
)),
|
|
8
12
|
original: 'Snippets'
|
|
9
13
|
},
|
|
10
14
|
};
|
|
@@ -56,14 +56,29 @@ 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.localizeWithPath(
|
|
60
|
-
|
|
59
|
+
? ( nls.localizeWithPath(
|
|
60
|
+
'vs/workbench/contrib/snippets/browser/commands/configureSnippets',
|
|
61
|
+
'global.scope',
|
|
62
|
+
"(global)"
|
|
63
|
+
))
|
|
64
|
+
: ( nls.localizeWithPath(
|
|
65
|
+
'vs/workbench/contrib/snippets/browser/commands/configureSnippets',
|
|
66
|
+
'global.1',
|
|
67
|
+
"({0})",
|
|
68
|
+
[...names].join(', ')
|
|
69
|
+
))
|
|
61
70
|
};
|
|
62
71
|
existing.push(snippet);
|
|
63
72
|
if (!source) {
|
|
64
73
|
continue;
|
|
65
74
|
}
|
|
66
|
-
const detail = nls.localizeWithPath(
|
|
75
|
+
const detail = ( nls.localizeWithPath(
|
|
76
|
+
'vs/workbench/contrib/snippets/browser/commands/configureSnippets',
|
|
77
|
+
'detail.label',
|
|
78
|
+
"({0}) {1}",
|
|
79
|
+
source,
|
|
80
|
+
labelService.getUriLabel(file.location, { relative: true })
|
|
81
|
+
));
|
|
67
82
|
const lastItem = added.get(basename(file.location));
|
|
68
83
|
if (lastItem) {
|
|
69
84
|
snippet.detail = detail;
|
|
@@ -120,16 +135,34 @@ async function createSnippetFile(scope, defaultPath, quickInputService, fileServ
|
|
|
120
135
|
}
|
|
121
136
|
await fileService.createFolder(defaultPath);
|
|
122
137
|
const input = await quickInputService.input({
|
|
123
|
-
placeHolder: nls.localizeWithPath(
|
|
138
|
+
placeHolder: ( nls.localizeWithPath(
|
|
139
|
+
'vs/workbench/contrib/snippets/browser/commands/configureSnippets',
|
|
140
|
+
'name',
|
|
141
|
+
"Type snippet file name"
|
|
142
|
+
)),
|
|
124
143
|
async validateInput(input) {
|
|
125
144
|
if (!input) {
|
|
126
|
-
return nls.localizeWithPath(
|
|
145
|
+
return ( nls.localizeWithPath(
|
|
146
|
+
'vs/workbench/contrib/snippets/browser/commands/configureSnippets',
|
|
147
|
+
'bad_name1',
|
|
148
|
+
"Invalid file name"
|
|
149
|
+
));
|
|
127
150
|
}
|
|
128
151
|
if (!isValidBasename(input)) {
|
|
129
|
-
return nls.localizeWithPath(
|
|
152
|
+
return ( nls.localizeWithPath(
|
|
153
|
+
'vs/workbench/contrib/snippets/browser/commands/configureSnippets',
|
|
154
|
+
'bad_name2',
|
|
155
|
+
"'{0}' is not a valid file name",
|
|
156
|
+
input
|
|
157
|
+
));
|
|
130
158
|
}
|
|
131
159
|
if (await fileService.exists(createSnippetUri(input))) {
|
|
132
|
-
return nls.localizeWithPath(
|
|
160
|
+
return ( nls.localizeWithPath(
|
|
161
|
+
'vs/workbench/contrib/snippets/browser/commands/configureSnippets',
|
|
162
|
+
'bad_name3',
|
|
163
|
+
"'{0}' already exists",
|
|
164
|
+
input
|
|
165
|
+
));
|
|
133
166
|
}
|
|
134
167
|
return undefined;
|
|
135
168
|
}
|
|
@@ -189,12 +222,24 @@ class ConfigureSnippetsAction extends SnippetsAction {
|
|
|
189
222
|
super({
|
|
190
223
|
id: 'workbench.action.openSnippets',
|
|
191
224
|
title: {
|
|
192
|
-
value: nls.localizeWithPath(
|
|
225
|
+
value: ( nls.localizeWithPath(
|
|
226
|
+
'vs/workbench/contrib/snippets/browser/commands/configureSnippets',
|
|
227
|
+
'openSnippet.label',
|
|
228
|
+
"Configure User Snippets"
|
|
229
|
+
)),
|
|
193
230
|
original: 'Configure User Snippets'
|
|
194
231
|
},
|
|
195
232
|
shortTitle: {
|
|
196
|
-
value: nls.localizeWithPath(
|
|
197
|
-
|
|
233
|
+
value: ( nls.localizeWithPath(
|
|
234
|
+
'vs/workbench/contrib/snippets/browser/commands/configureSnippets',
|
|
235
|
+
'userSnippets',
|
|
236
|
+
"User Snippets"
|
|
237
|
+
)),
|
|
238
|
+
mnemonicTitle: ( nls.localizeWithPath(
|
|
239
|
+
'vs/workbench/contrib/snippets/browser/commands/configureSnippets',
|
|
240
|
+
{ key: 'miOpenSnippets', comment: ['&& denotes a mnemonic'] },
|
|
241
|
+
"User &&Snippets"
|
|
242
|
+
)),
|
|
198
243
|
original: 'User Snippets'
|
|
199
244
|
},
|
|
200
245
|
f1: true,
|
|
@@ -217,27 +262,61 @@ class ConfigureSnippetsAction extends SnippetsAction {
|
|
|
217
262
|
const picks = await computePicks(snippetService, userDataProfileService, languageService, labelService);
|
|
218
263
|
const existing = picks.existing;
|
|
219
264
|
const globalSnippetPicks = [{
|
|
220
|
-
scope: nls.localizeWithPath(
|
|
221
|
-
|
|
265
|
+
scope: ( nls.localizeWithPath(
|
|
266
|
+
'vs/workbench/contrib/snippets/browser/commands/configureSnippets',
|
|
267
|
+
'new.global_scope',
|
|
268
|
+
'global'
|
|
269
|
+
)),
|
|
270
|
+
label: ( nls.localizeWithPath(
|
|
271
|
+
'vs/workbench/contrib/snippets/browser/commands/configureSnippets',
|
|
272
|
+
'new.global',
|
|
273
|
+
"New Global Snippets file..."
|
|
274
|
+
)),
|
|
222
275
|
uri: userDataProfileService.currentProfile.snippetsHome
|
|
223
276
|
}];
|
|
224
277
|
const workspaceSnippetPicks = [];
|
|
225
278
|
for (const folder of workspaceService.getWorkspace().folders) {
|
|
226
279
|
workspaceSnippetPicks.push({
|
|
227
|
-
scope: nls.localizeWithPath(
|
|
228
|
-
|
|
280
|
+
scope: ( nls.localizeWithPath(
|
|
281
|
+
'vs/workbench/contrib/snippets/browser/commands/configureSnippets',
|
|
282
|
+
'new.workspace_scope',
|
|
283
|
+
"{0} workspace",
|
|
284
|
+
folder.name
|
|
285
|
+
)),
|
|
286
|
+
label: ( nls.localizeWithPath(
|
|
287
|
+
'vs/workbench/contrib/snippets/browser/commands/configureSnippets',
|
|
288
|
+
'new.folder',
|
|
289
|
+
"New Snippets file for '{0}'...",
|
|
290
|
+
folder.name
|
|
291
|
+
)),
|
|
229
292
|
uri: folder.toResource('.vscode')
|
|
230
293
|
});
|
|
231
294
|
}
|
|
232
295
|
if (existing.length > 0) {
|
|
233
|
-
existing.unshift({ type: 'separator', label: nls.localizeWithPath(
|
|
234
|
-
|
|
296
|
+
existing.unshift({ type: 'separator', label: ( nls.localizeWithPath(
|
|
297
|
+
'vs/workbench/contrib/snippets/browser/commands/configureSnippets',
|
|
298
|
+
'group.global',
|
|
299
|
+
"Existing Snippets"
|
|
300
|
+
)) });
|
|
301
|
+
existing.push({ type: 'separator', label: ( nls.localizeWithPath(
|
|
302
|
+
'vs/workbench/contrib/snippets/browser/commands/configureSnippets',
|
|
303
|
+
'new.global.sep',
|
|
304
|
+
"New Snippets"
|
|
305
|
+
)) });
|
|
235
306
|
}
|
|
236
307
|
else {
|
|
237
|
-
existing.push({ type: 'separator', label: nls.localizeWithPath(
|
|
308
|
+
existing.push({ type: 'separator', label: ( nls.localizeWithPath(
|
|
309
|
+
'vs/workbench/contrib/snippets/browser/commands/configureSnippets',
|
|
310
|
+
'new.global.sep',
|
|
311
|
+
"New Snippets"
|
|
312
|
+
)) });
|
|
238
313
|
}
|
|
239
314
|
const pick = await quickInputService.pick([].concat(existing, globalSnippetPicks, workspaceSnippetPicks, picks.future), {
|
|
240
|
-
placeHolder: nls.localizeWithPath(
|
|
315
|
+
placeHolder: ( nls.localizeWithPath(
|
|
316
|
+
'vs/workbench/contrib/snippets/browser/commands/configureSnippets',
|
|
317
|
+
'openSnippet.pickLanguage',
|
|
318
|
+
"Select Snippets File or Create Snippets"
|
|
319
|
+
)),
|
|
241
320
|
matchOnDescription: true
|
|
242
321
|
});
|
|
243
322
|
if (globalSnippetPicks.indexOf(pick) >= 0) {
|
|
@@ -15,7 +15,11 @@ class ApplyFileSnippetAction extends SnippetsAction {
|
|
|
15
15
|
super({
|
|
16
16
|
id: ApplyFileSnippetAction.Id,
|
|
17
17
|
title: {
|
|
18
|
-
value: localizeWithPath(
|
|
18
|
+
value: ( localizeWithPath(
|
|
19
|
+
'vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets',
|
|
20
|
+
'label',
|
|
21
|
+
'Fill File with Snippet'
|
|
22
|
+
)),
|
|
19
23
|
original: 'Fill File with Snippet'
|
|
20
24
|
},
|
|
21
25
|
f1: true,
|
|
@@ -79,7 +83,11 @@ class ApplyFileSnippetAction extends SnippetsAction {
|
|
|
79
83
|
}
|
|
80
84
|
}
|
|
81
85
|
const pick = await quickInputService.pick(picks, {
|
|
82
|
-
placeHolder: localizeWithPath(
|
|
86
|
+
placeHolder: ( localizeWithPath(
|
|
87
|
+
'vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets',
|
|
88
|
+
'placeholder',
|
|
89
|
+
'Select a snippet'
|
|
90
|
+
)),
|
|
83
91
|
matchOnDetail: true,
|
|
84
92
|
});
|
|
85
93
|
return pick?.snippet;
|
|
@@ -38,7 +38,11 @@ class InsertSnippetAction extends SnippetEditorAction {
|
|
|
38
38
|
super({
|
|
39
39
|
id: 'editor.action.insertSnippet',
|
|
40
40
|
title: {
|
|
41
|
-
value: nls.localizeWithPath(
|
|
41
|
+
value: ( nls.localizeWithPath(
|
|
42
|
+
'vs/workbench/contrib/snippets/browser/commands/insertSnippet',
|
|
43
|
+
'snippet.suggestions.label',
|
|
44
|
+
"Insert Snippet"
|
|
45
|
+
)),
|
|
42
46
|
original: 'Insert Snippet'
|
|
43
47
|
},
|
|
44
48
|
f1: true,
|
|
@@ -19,7 +19,11 @@ class SurroundWithSnippetEditorAction extends SnippetEditorAction {
|
|
|
19
19
|
static { this.options = {
|
|
20
20
|
id: 'editor.action.surroundWithSnippet',
|
|
21
21
|
title: {
|
|
22
|
-
value: localizeWithPath(
|
|
22
|
+
value: ( localizeWithPath(
|
|
23
|
+
'vs/workbench/contrib/snippets/browser/commands/surroundWithSnippet',
|
|
24
|
+
'label',
|
|
25
|
+
'Surround With Snippet...'
|
|
26
|
+
)),
|
|
23
27
|
original: 'Surround With Snippet...'
|
|
24
28
|
}
|
|
25
29
|
}; }
|
|
@@ -41,7 +41,12 @@ let SurroundWithSnippetCodeActionProvider = class SurroundWithSnippetCodeActionP
|
|
|
41
41
|
break;
|
|
42
42
|
}
|
|
43
43
|
actions.push({
|
|
44
|
-
title: localizeWithPath(
|
|
44
|
+
title: ( localizeWithPath(
|
|
45
|
+
'vs/workbench/contrib/snippets/browser/snippetCodeActionProvider',
|
|
46
|
+
'codeAction',
|
|
47
|
+
"Surround With: {0}",
|
|
48
|
+
snippet.name
|
|
49
|
+
)),
|
|
45
50
|
kind: CodeActionKind.SurroundWith.value,
|
|
46
51
|
edit: asWorkspaceEdit(model, range, snippet)
|
|
47
52
|
});
|
|
@@ -59,7 +64,11 @@ let FileTemplateCodeActionProvider = class FileTemplateCodeActionProvider {
|
|
|
59
64
|
static { FileTemplateCodeActionProvider_1 = this; }
|
|
60
65
|
static { this._MAX_CODE_ACTIONS = 4; }
|
|
61
66
|
static { this._overflowCommandCodeAction = {
|
|
62
|
-
title: localizeWithPath(
|
|
67
|
+
title: ( localizeWithPath(
|
|
68
|
+
'vs/workbench/contrib/snippets/browser/snippetCodeActionProvider',
|
|
69
|
+
'overflow.start.title',
|
|
70
|
+
'Start with Snippet'
|
|
71
|
+
)),
|
|
63
72
|
kind: CodeActionKind.SurroundWith.value,
|
|
64
73
|
command: {
|
|
65
74
|
id: ApplyFileSnippetAction.Id,
|
|
@@ -82,7 +91,12 @@ let FileTemplateCodeActionProvider = class FileTemplateCodeActionProvider {
|
|
|
82
91
|
break;
|
|
83
92
|
}
|
|
84
93
|
actions.push({
|
|
85
|
-
title: localizeWithPath(
|
|
94
|
+
title: ( localizeWithPath(
|
|
95
|
+
'vs/workbench/contrib/snippets/browser/snippetCodeActionProvider',
|
|
96
|
+
'title',
|
|
97
|
+
'Start with: {0}',
|
|
98
|
+
snippet.name
|
|
99
|
+
)),
|
|
86
100
|
kind: CodeActionKind.SurroundWith.value,
|
|
87
101
|
edit: asWorkspaceEdit(model, model.getFullModelRange(), snippet)
|
|
88
102
|
});
|
|
@@ -29,13 +29,21 @@ async function pickSnippet(accessor, languageIdOrSnippets) {
|
|
|
29
29
|
let label = '';
|
|
30
30
|
switch (snippet.snippetSource) {
|
|
31
31
|
case 1 :
|
|
32
|
-
label = nls.localizeWithPath(
|
|
32
|
+
label = ( nls.localizeWithPath(
|
|
33
|
+
'vs/workbench/contrib/snippets/browser/snippetPicker',
|
|
34
|
+
'sep.userSnippet',
|
|
35
|
+
"User Snippets"
|
|
36
|
+
));
|
|
33
37
|
break;
|
|
34
38
|
case 3 :
|
|
35
39
|
label = snippet.source;
|
|
36
40
|
break;
|
|
37
41
|
case 2 :
|
|
38
|
-
label = nls.localizeWithPath(
|
|
42
|
+
label = ( nls.localizeWithPath(
|
|
43
|
+
'vs/workbench/contrib/snippets/browser/snippetPicker',
|
|
44
|
+
'sep.workspaceSnippet',
|
|
45
|
+
"Workspace Snippets"
|
|
46
|
+
));
|
|
39
47
|
break;
|
|
40
48
|
}
|
|
41
49
|
result.push({ type: 'separator', label });
|
|
@@ -45,14 +53,26 @@ async function pickSnippet(accessor, languageIdOrSnippets) {
|
|
|
45
53
|
if (isEnabled) {
|
|
46
54
|
pick.buttons = [{
|
|
47
55
|
iconClass: ThemeIcon.asClassName(Codicon.eyeClosed),
|
|
48
|
-
tooltip: nls.localizeWithPath(
|
|
56
|
+
tooltip: ( nls.localizeWithPath(
|
|
57
|
+
'vs/workbench/contrib/snippets/browser/snippetPicker',
|
|
58
|
+
'disableSnippet',
|
|
59
|
+
'Hide from IntelliSense'
|
|
60
|
+
))
|
|
49
61
|
}];
|
|
50
62
|
}
|
|
51
63
|
else {
|
|
52
|
-
pick.description = nls.localizeWithPath(
|
|
64
|
+
pick.description = ( nls.localizeWithPath(
|
|
65
|
+
'vs/workbench/contrib/snippets/browser/snippetPicker',
|
|
66
|
+
'isDisabled',
|
|
67
|
+
"(hidden from IntelliSense)"
|
|
68
|
+
));
|
|
53
69
|
pick.buttons = [{
|
|
54
70
|
iconClass: ThemeIcon.asClassName(Codicon.eye),
|
|
55
|
-
tooltip: nls.localizeWithPath(
|
|
71
|
+
tooltip: ( nls.localizeWithPath(
|
|
72
|
+
'vs/workbench/contrib/snippets/browser/snippetPicker',
|
|
73
|
+
'enable.snippet',
|
|
74
|
+
'Show in IntelliSense'
|
|
75
|
+
))
|
|
56
76
|
}];
|
|
57
77
|
}
|
|
58
78
|
}
|
|
@@ -62,7 +82,11 @@ async function pickSnippet(accessor, languageIdOrSnippets) {
|
|
|
62
82
|
return result;
|
|
63
83
|
};
|
|
64
84
|
const picker = quickInputService.createQuickPick();
|
|
65
|
-
picker.placeholder = nls.localizeWithPath(
|
|
85
|
+
picker.placeholder = ( nls.localizeWithPath(
|
|
86
|
+
'vs/workbench/contrib/snippets/browser/snippetPicker',
|
|
87
|
+
'pick.placeholder',
|
|
88
|
+
"Select a snippet"
|
|
89
|
+
));
|
|
66
90
|
picker.matchOnDetail = true;
|
|
67
91
|
picker.ignoreFocusOut = false;
|
|
68
92
|
picker.keepScrollPosition = true;
|
|
@@ -73,7 +97,11 @@ async function pickSnippet(accessor, languageIdOrSnippets) {
|
|
|
73
97
|
});
|
|
74
98
|
picker.items = makeSnippetPicks();
|
|
75
99
|
if (!picker.items.length) {
|
|
76
|
-
picker.validationMessage = nls.localizeWithPath(
|
|
100
|
+
picker.validationMessage = ( nls.localizeWithPath(
|
|
101
|
+
'vs/workbench/contrib/snippets/browser/snippetPicker',
|
|
102
|
+
'pick.noSnippetAvailable',
|
|
103
|
+
"No snippet available"
|
|
104
|
+
));
|
|
77
105
|
}
|
|
78
106
|
picker.show();
|
|
79
107
|
await Promise.race([Event.toPromise(picker.onDidAccept), Event.toPromise(picker.onDidHide)]);
|
|
@@ -25,7 +25,11 @@ workbenchContribRegistry.registerWorkbenchContribution(SnippetCodeActions, 3 );
|
|
|
25
25
|
...editorConfigurationBaseNode,
|
|
26
26
|
'properties': {
|
|
27
27
|
'editor.snippets.codeActions.enabled': {
|
|
28
|
-
'description': nls.localizeWithPath(
|
|
28
|
+
'description': ( nls.localizeWithPath(
|
|
29
|
+
'vs/workbench/contrib/snippets/browser/snippets.contribution',
|
|
30
|
+
'editor.snippets.codeActions.enabled',
|
|
31
|
+
'Controls if surround-with-snippets or file template snippets show as Code Actions.'
|
|
32
|
+
)),
|
|
29
33
|
'type': 'boolean',
|
|
30
34
|
'default': true
|
|
31
35
|
}
|
|
@@ -34,22 +38,38 @@ workbenchContribRegistry.registerWorkbenchContribution(SnippetCodeActions, 3 );
|
|
|
34
38
|
const languageScopeSchemaId = 'vscode://schemas/snippets';
|
|
35
39
|
const snippetSchemaProperties = {
|
|
36
40
|
prefix: {
|
|
37
|
-
description: nls.localizeWithPath(
|
|
41
|
+
description: ( nls.localizeWithPath(
|
|
42
|
+
'vs/workbench/contrib/snippets/browser/snippets.contribution',
|
|
43
|
+
'snippetSchema.json.prefix',
|
|
44
|
+
'The prefix to use when selecting the snippet in intellisense'
|
|
45
|
+
)),
|
|
38
46
|
type: ['string', 'array']
|
|
39
47
|
},
|
|
40
48
|
isFileTemplate: {
|
|
41
|
-
description: nls.localizeWithPath(
|
|
49
|
+
description: ( nls.localizeWithPath(
|
|
50
|
+
'vs/workbench/contrib/snippets/browser/snippets.contribution',
|
|
51
|
+
'snippetSchema.json.isFileTemplate',
|
|
52
|
+
'The snippet is meant to populate or replace a whole file'
|
|
53
|
+
)),
|
|
42
54
|
type: 'boolean'
|
|
43
55
|
},
|
|
44
56
|
body: {
|
|
45
|
-
markdownDescription: nls.localizeWithPath(
|
|
57
|
+
markdownDescription: ( nls.localizeWithPath(
|
|
58
|
+
'vs/workbench/contrib/snippets/browser/snippets.contribution',
|
|
59
|
+
'snippetSchema.json.body',
|
|
60
|
+
'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`.'
|
|
61
|
+
)),
|
|
46
62
|
type: ['string', 'array'],
|
|
47
63
|
items: {
|
|
48
64
|
type: 'string'
|
|
49
65
|
}
|
|
50
66
|
},
|
|
51
67
|
description: {
|
|
52
|
-
description: nls.localizeWithPath(
|
|
68
|
+
description: ( nls.localizeWithPath(
|
|
69
|
+
'vs/workbench/contrib/snippets/browser/snippets.contribution',
|
|
70
|
+
'snippetSchema.json.description',
|
|
71
|
+
'The snippet description.'
|
|
72
|
+
)),
|
|
53
73
|
type: ['string', 'array']
|
|
54
74
|
}
|
|
55
75
|
};
|
|
@@ -58,11 +78,19 @@ const languageScopeSchema = {
|
|
|
58
78
|
allowComments: true,
|
|
59
79
|
allowTrailingCommas: true,
|
|
60
80
|
defaultSnippets: [{
|
|
61
|
-
label: nls.localizeWithPath(
|
|
81
|
+
label: ( nls.localizeWithPath(
|
|
82
|
+
'vs/workbench/contrib/snippets/browser/snippets.contribution',
|
|
83
|
+
'snippetSchema.json.default',
|
|
84
|
+
"Empty snippet"
|
|
85
|
+
)),
|
|
62
86
|
body: { '${1:snippetName}': { 'prefix': '${2:prefix}', 'body': '${3:snippet}', 'description': '${4:description}' } }
|
|
63
87
|
}],
|
|
64
88
|
type: 'object',
|
|
65
|
-
description: nls.localizeWithPath(
|
|
89
|
+
description: ( nls.localizeWithPath(
|
|
90
|
+
'vs/workbench/contrib/snippets/browser/snippets.contribution',
|
|
91
|
+
'snippetSchema.json',
|
|
92
|
+
'User snippet configuration'
|
|
93
|
+
)),
|
|
66
94
|
additionalProperties: {
|
|
67
95
|
type: 'object',
|
|
68
96
|
required: ['body'],
|
|
@@ -76,18 +104,30 @@ const globalSchema = {
|
|
|
76
104
|
allowComments: true,
|
|
77
105
|
allowTrailingCommas: true,
|
|
78
106
|
defaultSnippets: [{
|
|
79
|
-
label: nls.localizeWithPath(
|
|
107
|
+
label: ( nls.localizeWithPath(
|
|
108
|
+
'vs/workbench/contrib/snippets/browser/snippets.contribution',
|
|
109
|
+
'snippetSchema.json.default',
|
|
110
|
+
"Empty snippet"
|
|
111
|
+
)),
|
|
80
112
|
body: { '${1:snippetName}': { 'scope': '${2:scope}', 'prefix': '${3:prefix}', 'body': '${4:snippet}', 'description': '${5:description}' } }
|
|
81
113
|
}],
|
|
82
114
|
type: 'object',
|
|
83
|
-
description: nls.localizeWithPath(
|
|
115
|
+
description: ( nls.localizeWithPath(
|
|
116
|
+
'vs/workbench/contrib/snippets/browser/snippets.contribution',
|
|
117
|
+
'snippetSchema.json',
|
|
118
|
+
'User snippet configuration'
|
|
119
|
+
)),
|
|
84
120
|
additionalProperties: {
|
|
85
121
|
type: 'object',
|
|
86
122
|
required: ['body'],
|
|
87
123
|
properties: {
|
|
88
124
|
...snippetSchemaProperties,
|
|
89
125
|
scope: {
|
|
90
|
-
description: nls.localizeWithPath(
|
|
126
|
+
description: ( nls.localizeWithPath(
|
|
127
|
+
'vs/workbench/contrib/snippets/browser/snippets.contribution',
|
|
128
|
+
'snippetSchema.json.scope',
|
|
129
|
+
"A list of language names to which this snippet applies, e.g. 'typescript,javascript'."
|
|
130
|
+
)),
|
|
91
131
|
type: 'string'
|
|
92
132
|
}
|
|
93
133
|
},
|