@codingame/monaco-vscode-api 4.3.1 → 4.4.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/missing-services.js +1 -1
- package/monaco.d.ts +2 -0
- package/monaco.js +1 -0
- package/package.json +8 -8
- package/services.js +27 -1
- package/vscode/src/vs/editor/browser/editorExtensions.d.ts +138 -0
- package/vscode/src/vs/editor/common/editorCommon.d.ts +11 -1
- package/vscode/src/vs/workbench/api/browser/statusBarService.js +96 -0
- package/vscode/src/vs/workbench/api/common/jsonValidationExtensionPoint.js +14 -0
- package/vscode/src/vs/workbench/common/contributions.d.ts +1 -6
- package/vscode/src/vs/workbench/services/themes/common/colorExtensionPoint.js +14 -0
- package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +14 -0
- package/contributions.js +0 -43
- package/vscode/src/vs/workbench/api/browser/statusBarExtensionPoint.js +0 -254
- package/vscode/src/vs/workbench/contrib/codeEditor/common/languageConfigurationExtensionPoint.js +0 -1016
- package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +0 -296
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
import { localizeWithPath } from '../../../../nls.js';
|
|
2
|
-
import { ExtensionsRegistry } from '../../extensions/common/extensionsRegistry.js';
|
|
3
|
-
import { typeAndModifierIdPattern, getTokenClassificationRegistry } from '../../../../platform/theme/common/tokenClassificationRegistry.js';
|
|
4
|
-
const tokenClassificationRegistry = getTokenClassificationRegistry();
|
|
5
|
-
const tokenTypeExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
6
|
-
extensionPoint: 'semanticTokenTypes',
|
|
7
|
-
jsonSchema: {
|
|
8
|
-
description: ( localizeWithPath(
|
|
9
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
10
|
-
'contributes.semanticTokenTypes',
|
|
11
|
-
'Contributes semantic token types.'
|
|
12
|
-
)),
|
|
13
|
-
type: 'array',
|
|
14
|
-
items: {
|
|
15
|
-
type: 'object',
|
|
16
|
-
properties: {
|
|
17
|
-
id: {
|
|
18
|
-
type: 'string',
|
|
19
|
-
description: ( localizeWithPath(
|
|
20
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
21
|
-
'contributes.semanticTokenTypes.id',
|
|
22
|
-
'The identifier of the semantic token type'
|
|
23
|
-
)),
|
|
24
|
-
pattern: typeAndModifierIdPattern,
|
|
25
|
-
patternErrorMessage: ( localizeWithPath(
|
|
26
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
27
|
-
'contributes.semanticTokenTypes.id.format',
|
|
28
|
-
'Identifiers should be in the form letterOrDigit[_-letterOrDigit]*'
|
|
29
|
-
)),
|
|
30
|
-
},
|
|
31
|
-
superType: {
|
|
32
|
-
type: 'string',
|
|
33
|
-
description: ( localizeWithPath(
|
|
34
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
35
|
-
'contributes.semanticTokenTypes.superType',
|
|
36
|
-
'The super type of the semantic token type'
|
|
37
|
-
)),
|
|
38
|
-
pattern: typeAndModifierIdPattern,
|
|
39
|
-
patternErrorMessage: ( localizeWithPath(
|
|
40
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
41
|
-
'contributes.semanticTokenTypes.superType.format',
|
|
42
|
-
'Super types should be in the form letterOrDigit[_-letterOrDigit]*'
|
|
43
|
-
)),
|
|
44
|
-
},
|
|
45
|
-
description: {
|
|
46
|
-
type: 'string',
|
|
47
|
-
description: ( localizeWithPath(
|
|
48
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
49
|
-
'contributes.color.description',
|
|
50
|
-
'The description of the semantic token type'
|
|
51
|
-
)),
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
const tokenModifierExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
58
|
-
extensionPoint: 'semanticTokenModifiers',
|
|
59
|
-
jsonSchema: {
|
|
60
|
-
description: ( localizeWithPath(
|
|
61
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
62
|
-
'contributes.semanticTokenModifiers',
|
|
63
|
-
'Contributes semantic token modifiers.'
|
|
64
|
-
)),
|
|
65
|
-
type: 'array',
|
|
66
|
-
items: {
|
|
67
|
-
type: 'object',
|
|
68
|
-
properties: {
|
|
69
|
-
id: {
|
|
70
|
-
type: 'string',
|
|
71
|
-
description: ( localizeWithPath(
|
|
72
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
73
|
-
'contributes.semanticTokenModifiers.id',
|
|
74
|
-
'The identifier of the semantic token modifier'
|
|
75
|
-
)),
|
|
76
|
-
pattern: typeAndModifierIdPattern,
|
|
77
|
-
patternErrorMessage: ( localizeWithPath(
|
|
78
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
79
|
-
'contributes.semanticTokenModifiers.id.format',
|
|
80
|
-
'Identifiers should be in the form letterOrDigit[_-letterOrDigit]*'
|
|
81
|
-
))
|
|
82
|
-
},
|
|
83
|
-
description: {
|
|
84
|
-
type: 'string',
|
|
85
|
-
description: ( localizeWithPath(
|
|
86
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
87
|
-
'contributes.semanticTokenModifiers.description',
|
|
88
|
-
'The description of the semantic token modifier'
|
|
89
|
-
))
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
const tokenStyleDefaultsExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
96
|
-
extensionPoint: 'semanticTokenScopes',
|
|
97
|
-
jsonSchema: {
|
|
98
|
-
description: ( localizeWithPath(
|
|
99
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
100
|
-
'contributes.semanticTokenScopes',
|
|
101
|
-
'Contributes semantic token scope maps.'
|
|
102
|
-
)),
|
|
103
|
-
type: 'array',
|
|
104
|
-
items: {
|
|
105
|
-
type: 'object',
|
|
106
|
-
properties: {
|
|
107
|
-
language: {
|
|
108
|
-
description: ( localizeWithPath(
|
|
109
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
110
|
-
'contributes.semanticTokenScopes.languages',
|
|
111
|
-
'Lists the languge for which the defaults are.'
|
|
112
|
-
)),
|
|
113
|
-
type: 'string'
|
|
114
|
-
},
|
|
115
|
-
scopes: {
|
|
116
|
-
description: ( localizeWithPath(
|
|
117
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
118
|
-
'contributes.semanticTokenScopes.scopes',
|
|
119
|
-
'Maps a semantic token (described by semantic token selector) to one or more textMate scopes used to represent that token.'
|
|
120
|
-
)),
|
|
121
|
-
type: 'object',
|
|
122
|
-
additionalProperties: {
|
|
123
|
-
type: 'array',
|
|
124
|
-
items: {
|
|
125
|
-
type: 'string'
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
class TokenClassificationExtensionPoints {
|
|
134
|
-
constructor() {
|
|
135
|
-
function validateTypeOrModifier(contribution, extensionPoint, collector) {
|
|
136
|
-
if (typeof contribution.id !== 'string' || contribution.id.length === 0) {
|
|
137
|
-
collector.error(( localizeWithPath(
|
|
138
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
139
|
-
'invalid.id',
|
|
140
|
-
"'configuration.{0}.id' must be defined and can not be empty",
|
|
141
|
-
extensionPoint
|
|
142
|
-
)));
|
|
143
|
-
return false;
|
|
144
|
-
}
|
|
145
|
-
if (!contribution.id.match(typeAndModifierIdPattern)) {
|
|
146
|
-
collector.error(( localizeWithPath(
|
|
147
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
148
|
-
'invalid.id.format',
|
|
149
|
-
"'configuration.{0}.id' must follow the pattern letterOrDigit[-_letterOrDigit]*",
|
|
150
|
-
extensionPoint
|
|
151
|
-
)));
|
|
152
|
-
return false;
|
|
153
|
-
}
|
|
154
|
-
const superType = contribution.superType;
|
|
155
|
-
if (superType && !superType.match(typeAndModifierIdPattern)) {
|
|
156
|
-
collector.error(( localizeWithPath(
|
|
157
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
158
|
-
'invalid.superType.format',
|
|
159
|
-
"'configuration.{0}.superType' must follow the pattern letterOrDigit[-_letterOrDigit]*",
|
|
160
|
-
extensionPoint
|
|
161
|
-
)));
|
|
162
|
-
return false;
|
|
163
|
-
}
|
|
164
|
-
if (typeof contribution.description !== 'string' || contribution.id.length === 0) {
|
|
165
|
-
collector.error(( localizeWithPath(
|
|
166
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
167
|
-
'invalid.description',
|
|
168
|
-
"'configuration.{0}.description' must be defined and can not be empty",
|
|
169
|
-
extensionPoint
|
|
170
|
-
)));
|
|
171
|
-
return false;
|
|
172
|
-
}
|
|
173
|
-
return true;
|
|
174
|
-
}
|
|
175
|
-
tokenTypeExtPoint.setHandler((extensions, delta) => {
|
|
176
|
-
for (const extension of delta.added) {
|
|
177
|
-
const extensionValue = extension.value;
|
|
178
|
-
const collector = extension.collector;
|
|
179
|
-
if (!extensionValue || !Array.isArray(extensionValue)) {
|
|
180
|
-
collector.error(( localizeWithPath(
|
|
181
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
182
|
-
'invalid.semanticTokenTypeConfiguration',
|
|
183
|
-
"'configuration.semanticTokenType' must be an array"
|
|
184
|
-
)));
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
for (const contribution of extensionValue) {
|
|
188
|
-
if (validateTypeOrModifier(contribution, 'semanticTokenType', collector)) {
|
|
189
|
-
tokenClassificationRegistry.registerTokenType(contribution.id, contribution.description, contribution.superType);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
for (const extension of delta.removed) {
|
|
194
|
-
const extensionValue = extension.value;
|
|
195
|
-
for (const contribution of extensionValue) {
|
|
196
|
-
tokenClassificationRegistry.deregisterTokenType(contribution.id);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
tokenModifierExtPoint.setHandler((extensions, delta) => {
|
|
201
|
-
for (const extension of delta.added) {
|
|
202
|
-
const extensionValue = extension.value;
|
|
203
|
-
const collector = extension.collector;
|
|
204
|
-
if (!extensionValue || !Array.isArray(extensionValue)) {
|
|
205
|
-
collector.error(( localizeWithPath(
|
|
206
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
207
|
-
'invalid.semanticTokenModifierConfiguration',
|
|
208
|
-
"'configuration.semanticTokenModifier' must be an array"
|
|
209
|
-
)));
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
for (const contribution of extensionValue) {
|
|
213
|
-
if (validateTypeOrModifier(contribution, 'semanticTokenModifier', collector)) {
|
|
214
|
-
tokenClassificationRegistry.registerTokenModifier(contribution.id, contribution.description);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
for (const extension of delta.removed) {
|
|
219
|
-
const extensionValue = extension.value;
|
|
220
|
-
for (const contribution of extensionValue) {
|
|
221
|
-
tokenClassificationRegistry.deregisterTokenModifier(contribution.id);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
tokenStyleDefaultsExtPoint.setHandler((extensions, delta) => {
|
|
226
|
-
for (const extension of delta.added) {
|
|
227
|
-
const extensionValue = extension.value;
|
|
228
|
-
const collector = extension.collector;
|
|
229
|
-
if (!extensionValue || !Array.isArray(extensionValue)) {
|
|
230
|
-
collector.error(( localizeWithPath(
|
|
231
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
232
|
-
'invalid.semanticTokenScopes.configuration',
|
|
233
|
-
"'configuration.semanticTokenScopes' must be an array"
|
|
234
|
-
)));
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
for (const contribution of extensionValue) {
|
|
238
|
-
if (contribution.language && typeof contribution.language !== 'string') {
|
|
239
|
-
collector.error(( localizeWithPath(
|
|
240
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
241
|
-
'invalid.semanticTokenScopes.language',
|
|
242
|
-
"'configuration.semanticTokenScopes.language' must be a string"
|
|
243
|
-
)));
|
|
244
|
-
continue;
|
|
245
|
-
}
|
|
246
|
-
if (!contribution.scopes || typeof contribution.scopes !== 'object') {
|
|
247
|
-
collector.error(( localizeWithPath(
|
|
248
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
249
|
-
'invalid.semanticTokenScopes.scopes',
|
|
250
|
-
"'configuration.semanticTokenScopes.scopes' must be defined as an object"
|
|
251
|
-
)));
|
|
252
|
-
continue;
|
|
253
|
-
}
|
|
254
|
-
for (const selectorString in contribution.scopes) {
|
|
255
|
-
const tmScopes = contribution.scopes[selectorString];
|
|
256
|
-
if (!Array.isArray(tmScopes) || ( tmScopes.some(l => typeof l !== 'string'))) {
|
|
257
|
-
collector.error(( localizeWithPath(
|
|
258
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
259
|
-
'invalid.semanticTokenScopes.scopes.value',
|
|
260
|
-
"'configuration.semanticTokenScopes.scopes' values must be an array of strings"
|
|
261
|
-
)));
|
|
262
|
-
continue;
|
|
263
|
-
}
|
|
264
|
-
try {
|
|
265
|
-
const selector = tokenClassificationRegistry.parseTokenSelector(selectorString, contribution.language);
|
|
266
|
-
tokenClassificationRegistry.registerTokenStyleDefault(selector, { scopesToProbe: ( tmScopes.map(s => s.split(' '))) });
|
|
267
|
-
}
|
|
268
|
-
catch (e) {
|
|
269
|
-
collector.error(( localizeWithPath(
|
|
270
|
-
'vs/workbench/services/themes/common/tokenClassificationExtensionPoint',
|
|
271
|
-
'invalid.semanticTokenScopes.scopes.selector',
|
|
272
|
-
"configuration.semanticTokenScopes.scopes': Problems parsing selector {0}.",
|
|
273
|
-
selectorString
|
|
274
|
-
)));
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
for (const extension of delta.removed) {
|
|
280
|
-
const extensionValue = extension.value;
|
|
281
|
-
for (const contribution of extensionValue) {
|
|
282
|
-
for (const selectorString in contribution.scopes) {
|
|
283
|
-
const tmScopes = contribution.scopes[selectorString];
|
|
284
|
-
try {
|
|
285
|
-
const selector = tokenClassificationRegistry.parseTokenSelector(selectorString, contribution.language);
|
|
286
|
-
tokenClassificationRegistry.registerTokenStyleDefault(selector, { scopesToProbe: ( tmScopes.map(s => s.split(' '))) });
|
|
287
|
-
}
|
|
288
|
-
catch (e) {
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
export { TokenClassificationExtensionPoints };
|