@codingame/monaco-vscode-api 1.69.7 → 1.69.8

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.
@@ -1,9 +1,10 @@
1
- import { f as ExtensionsRegistry, J as ExtensionMessageCollector } from './missing-services.js';
1
+ import './polyfill.js';
2
+ import { E as ExtensionsRegistry, m as ExtensionMessageCollector } from './missing-services.js';
2
3
  import { g as getTokenClassificationRegistry, a as typeAndModifierIdPattern } from './tokenClassificationRegistry.js';
3
4
  import { localize } from 'monaco-editor/esm/vs/nls.js';
4
- import { g as getExtensionPoint, c as consoleExtensionMessageHandler, o as onServicesInitialized } from './tools.js';
5
+ import { g as getExtensionPoint, o as onServicesInitialized, c as consoleExtensionMessageHandler } from './tools.js';
5
6
  import { S as Services } from './services2.js';
6
- import { bd as DEFAULT_EXTENSION } from './extHost.js';
7
+ import { D as DEFAULT_EXTENSION } from './extHost.js';
7
8
  const tokenClassificationRegistry = getTokenClassificationRegistry();
8
9
  const tokenTypeExtPoint$1 = ( ExtensionsRegistry.registerExtensionPoint({
9
10
  extensionPoint: 'semanticTokenTypes',
@@ -1,4 +1,4 @@
1
- import { E as Emitter } from './missing-services.js';
1
+ import { E as Emitter } from './polyfill.js';
2
2
  import { localize } from 'monaco-editor/esm/vs/nls.js';
3
3
  import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
4
4
  import { Extensions } from 'monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js';
@@ -20,7 +20,7 @@ class TokenStyle {
20
20
  this.italic = italic;
21
21
  }
22
22
  }
23
- ( ((function(TokenStyle) {
23
+ ( (function(TokenStyle) {
24
24
  function toJSONObject(style) {
25
25
  return {
26
26
  _foreground: style.foreground === undefined ? null : Color.Format.CSS.formatHexA(style.foreground, true),
@@ -34,16 +34,14 @@ class TokenStyle {
34
34
  function fromJSONObject(obj) {
35
35
  if (obj) {
36
36
  const boolOrUndef = (b) => (typeof b === 'boolean') ? b : undefined;
37
- const colorOrUndef = (s) => (typeof s === 'string') ? ( (Color.fromHex(s))) : undefined;
38
- return (
39
- (new TokenStyle(
40
- colorOrUndef(obj._foreground),
41
- boolOrUndef(obj._bold),
42
- boolOrUndef(obj._underline),
43
- boolOrUndef(obj._strikethrough),
44
- boolOrUndef(obj._italic)
45
- ))
46
- );
37
+ const colorOrUndef = (s) => (typeof s === 'string') ? ( Color.fromHex(s)) : undefined;
38
+ return ( new TokenStyle(
39
+ colorOrUndef(obj._foreground),
40
+ boolOrUndef(obj._bold),
41
+ boolOrUndef(obj._underline),
42
+ boolOrUndef(obj._strikethrough),
43
+ boolOrUndef(obj._italic)
44
+ ));
47
45
  }
48
46
  return undefined;
49
47
  }
@@ -65,21 +63,19 @@ class TokenStyle {
65
63
  }
66
64
  TokenStyle.is = is;
67
65
  function fromData(data) {
68
- return (
69
- (new TokenStyle(
70
- data.foreground,
71
- data.bold,
72
- data.underline,
73
- data.strikethrough,
74
- data.italic
75
- ))
76
- );
66
+ return ( new TokenStyle(
67
+ data.foreground,
68
+ data.bold,
69
+ data.underline,
70
+ data.strikethrough,
71
+ data.italic
72
+ ));
77
73
  }
78
74
  TokenStyle.fromData = fromData;
79
75
  function fromSettings(foreground, fontStyle, bold, underline, strikethrough, italic) {
80
76
  let foregroundColor = undefined;
81
77
  if (foreground !== undefined) {
82
- foregroundColor = ( (Color.fromHex(foreground)));
78
+ foregroundColor = ( Color.fromHex(foreground));
83
79
  }
84
80
  if (fontStyle !== undefined) {
85
81
  bold = italic = underline = strikethrough = false;
@@ -102,14 +98,12 @@ class TokenStyle {
102
98
  }
103
99
  }
104
100
  }
105
- return (
106
- (new TokenStyle(foregroundColor, bold, underline, strikethrough, italic))
107
- );
101
+ return ( new TokenStyle(foregroundColor, bold, underline, strikethrough, italic));
108
102
  }
109
103
  TokenStyle.fromSettings = fromSettings;
110
- })(TokenStyle || (TokenStyle = {}))));
104
+ })(TokenStyle || (TokenStyle = {})));
111
105
  var SemanticTokenRule;
112
- ( ((function(SemanticTokenRule) {
106
+ ( (function(SemanticTokenRule) {
113
107
  function fromJSONObject(registry, o) {
114
108
  if (o && typeof o._selector === 'string' && o._style) {
115
109
  const style = TokenStyle.fromJSONObject(o._style);
@@ -144,10 +138,10 @@ var SemanticTokenRule;
144
138
  return r && r.selector && typeof r.selector.id === 'string' && TokenStyle.is(r.style);
145
139
  }
146
140
  SemanticTokenRule.is = is;
147
- })(SemanticTokenRule || (SemanticTokenRule = {}))));
141
+ })(SemanticTokenRule || (SemanticTokenRule = {})));
148
142
  class TokenClassificationRegistry {
149
143
  constructor() {
150
- this._onDidChangeSchema = ( (new Emitter()));
144
+ this._onDidChangeSchema = ( new Emitter());
151
145
  this.onDidChangeSchema = this._onDidChangeSchema.event;
152
146
  this.currentTypeNumber = 0;
153
147
  this.currentModifierBit = 1;
@@ -162,34 +156,34 @@ class TokenClassificationRegistry {
162
156
  definitions: {
163
157
  style: {
164
158
  type: 'object',
165
- description: ( (localize('schema.token.settings', 'Colors and styles for the token.'))),
159
+ description: ( localize('schema.token.settings', 'Colors and styles for the token.')),
166
160
  properties: {
167
161
  foreground: {
168
162
  type: 'string',
169
- description: ( (localize('schema.token.foreground', 'Foreground color for the token.'))),
163
+ description: ( localize('schema.token.foreground', 'Foreground color for the token.')),
170
164
  format: 'color-hex',
171
165
  default: '#ff0000'
172
166
  },
173
167
  background: {
174
168
  type: 'string',
175
- deprecationMessage: ( (localize(
169
+ deprecationMessage: ( localize(
176
170
  'schema.token.background.warning',
177
171
  'Token background colors are currently not supported.'
178
- )))
172
+ ))
179
173
  },
180
174
  fontStyle: {
181
175
  type: 'string',
182
- description: ( (localize(
176
+ description: ( localize(
183
177
  'schema.token.fontStyle',
184
178
  'Sets the all font styles of the rule: \'italic\', \'bold\', \'underline\' or \'strikethrough\' or a combination. All styles that are not listed are unset. The empty string unsets all styles.'
185
- ))),
179
+ )),
186
180
  pattern: fontStylePattern,
187
- patternErrorMessage: ( (localize(
181
+ patternErrorMessage: ( localize(
188
182
  'schema.fontStyle.error',
189
183
  'Font style must be \'italic\', \'bold\', \'underline\' or \'strikethrough\' or a combination. The empty string unsets all styles.'
190
- ))),
184
+ )),
191
185
  defaultSnippets: [
192
- { label: ( (localize('schema.token.fontStyle.none', 'None (clear inherited style)'))), bodyText: '""' },
186
+ { label: ( localize('schema.token.fontStyle.none', 'None (clear inherited style)')), bodyText: '""' },
193
187
  { body: 'italic' },
194
188
  { body: 'bold' },
195
189
  { body: 'underline' },
@@ -209,31 +203,31 @@ class TokenClassificationRegistry {
209
203
  },
210
204
  bold: {
211
205
  type: 'boolean',
212
- description: ( (localize(
206
+ description: ( localize(
213
207
  'schema.token.bold',
214
208
  'Sets or unsets the font style to bold. Note, the presence of \'fontStyle\' overrides this setting.'
215
- ))),
209
+ )),
216
210
  },
217
211
  italic: {
218
212
  type: 'boolean',
219
- description: ( (localize(
213
+ description: ( localize(
220
214
  'schema.token.italic',
221
215
  'Sets or unsets the font style to italic. Note, the presence of \'fontStyle\' overrides this setting.'
222
- ))),
216
+ )),
223
217
  },
224
218
  underline: {
225
219
  type: 'boolean',
226
- description: ( (localize(
220
+ description: ( localize(
227
221
  'schema.token.underline',
228
222
  'Sets or unsets the font style to underline. Note, the presence of \'fontStyle\' overrides this setting.'
229
- ))),
223
+ )),
230
224
  },
231
225
  strikethrough: {
232
226
  type: 'boolean',
233
- description: ( (localize(
227
+ description: ( localize(
234
228
  'schema.token.strikethrough',
235
229
  'Sets or unsets the font style to strikethrough. Note, the presence of \'fontStyle\' overrides this setting.'
236
- ))),
230
+ )),
237
231
  }
238
232
  },
239
233
  defaultSnippets: [{ body: { foreground: '${1:#FF0000}', fontStyle: '${2:bold}' } }]
@@ -320,10 +314,10 @@ class TokenClassificationRegistry {
320
314
  delete this.tokenStylingSchema.properties[`*.${id}`];
321
315
  }
322
316
  getTokenTypes() {
323
- return ( (Object.keys(this.tokenTypeById))).map(id => this.tokenTypeById[id]);
317
+ return ( Object.keys(this.tokenTypeById)).map(id => this.tokenTypeById[id]);
324
318
  }
325
319
  getTokenModifiers() {
326
- return ( (Object.keys(this.tokenModifierById))).map(id => this.tokenModifierById[id]);
320
+ return ( Object.keys(this.tokenModifierById)).map(id => this.tokenModifierById[id]);
327
321
  }
328
322
  getTokenStylingSchema() {
329
323
  return this.tokenStylingSchema;
@@ -352,7 +346,7 @@ class TokenClassificationRegistry {
352
346
  }
353
347
  return a.localeCompare(b);
354
348
  };
355
- return ( (Object.keys(this.tokenTypeById))).sort(sorter).map(k => `- \`${k}\`: ${this.tokenTypeById[k].description}`).join('\n');
349
+ return ( Object.keys(this.tokenTypeById)).sort(sorter).map(k => `- \`${k}\`: ${this.tokenTypeById[k].description}`).join('\n');
356
350
  }
357
351
  }
358
352
  const CHAR_LANGUAGE = TOKEN_CLASSIFIER_LANGUAGE_SEPARATOR.charCodeAt(0);
@@ -379,7 +373,7 @@ function parseClassifierString(s, defaultLanguage) {
379
373
  }
380
374
  const tokenClassificationRegistry = createDefaultTokenClassificationRegistry();
381
375
  function createDefaultTokenClassificationRegistry() {
382
- const registry = ( (new TokenClassificationRegistry()));
376
+ const registry = ( new TokenClassificationRegistry());
383
377
  function registerTokenType(id, description, scopesToProbe = [], superType, deprecationMessage) {
384
378
  registry.registerTokenType(id, description, superType, deprecationMessage);
385
379
  if (scopesToProbe) {
@@ -396,38 +390,38 @@ function createDefaultTokenClassificationRegistry() {
396
390
  console.log(e);
397
391
  }
398
392
  }
399
- registerTokenType('comment', ( (localize('comment', "Style for comments."))), [['comment']]);
400
- registerTokenType('string', ( (localize('string', "Style for strings."))), [['string']]);
401
- registerTokenType('keyword', ( (localize('keyword', "Style for keywords."))), [['keyword.control']]);
402
- registerTokenType('number', ( (localize('number', "Style for numbers."))), [['constant.numeric']]);
403
- registerTokenType('regexp', ( (localize('regexp', "Style for expressions."))), [['constant.regexp']]);
404
- registerTokenType('operator', ( (localize('operator', "Style for operators."))), [['keyword.operator']]);
405
- registerTokenType('namespace', ( (localize('namespace', "Style for namespaces."))), [['entity.name.namespace']]);
406
- registerTokenType('type', ( (localize('type', "Style for types."))), [['entity.name.type'], ['support.type']]);
407
- registerTokenType('struct', ( (localize('struct', "Style for structs."))), [['entity.name.type.struct']]);
408
- registerTokenType('class', ( (localize('class', "Style for classes."))), [['entity.name.type.class'], ['support.class']]);
409
- registerTokenType('interface', ( (localize('interface', "Style for interfaces."))), [['entity.name.type.interface']]);
410
- registerTokenType('enum', ( (localize('enum', "Style for enums."))), [['entity.name.type.enum']]);
411
- registerTokenType('typeParameter', ( (localize('typeParameter', "Style for type parameters."))), [['entity.name.type.parameter']]);
412
- registerTokenType('function', ( (localize('function', "Style for functions"))), [['entity.name.function'], ['support.function']]);
413
- registerTokenType('member', ( (localize('member', "Style for member functions"))), [], 'method', 'Deprecated use `method` instead');
414
- registerTokenType('method', ( (localize('method', "Style for method (member functions)"))), [['entity.name.function.member'], ['support.function']]);
415
- registerTokenType('macro', ( (localize('macro', "Style for macros."))), [['entity.name.function.preprocessor']]);
416
- registerTokenType('variable', ( (localize('variable', "Style for variables."))), [['variable.other.readwrite'], ['entity.name.variable']]);
417
- registerTokenType('parameter', ( (localize('parameter', "Style for parameters."))), [['variable.parameter']]);
418
- registerTokenType('property', ( (localize('property', "Style for properties."))), [['variable.other.property']]);
419
- registerTokenType('enumMember', ( (localize('enumMember', "Style for enum members."))), [['variable.other.enummember']]);
420
- registerTokenType('event', ( (localize('event', "Style for events."))), [['variable.other.event']]);
421
- registerTokenType('decorator', ( (localize('decorator', "Style for decorators & annotations."))), [['entity.name.decorator'], ['entity.name.function']]);
422
- registerTokenType('label', ( (localize('labels', "Style for labels. "))), undefined);
423
- registry.registerTokenModifier('declaration', ( (localize('declaration', "Style for all symbol declarations."))), undefined);
424
- registry.registerTokenModifier('documentation', ( (localize('documentation', "Style to use for references in documentation."))), undefined);
425
- registry.registerTokenModifier('static', ( (localize('static', "Style to use for symbols that are static."))), undefined);
426
- registry.registerTokenModifier('abstract', ( (localize('abstract', "Style to use for symbols that are abstract."))), undefined);
427
- registry.registerTokenModifier('deprecated', ( (localize('deprecated', "Style to use for symbols that are deprecated."))), undefined);
428
- registry.registerTokenModifier('modification', ( (localize('modification', "Style to use for write accesses."))), undefined);
429
- registry.registerTokenModifier('async', ( (localize('async', "Style to use for symbols that are async."))), undefined);
430
- registry.registerTokenModifier('readonly', ( (localize('readonly', "Style to use for symbols that are readonly."))), undefined);
393
+ registerTokenType('comment', ( localize('comment', "Style for comments.")), [['comment']]);
394
+ registerTokenType('string', ( localize('string', "Style for strings.")), [['string']]);
395
+ registerTokenType('keyword', ( localize('keyword', "Style for keywords.")), [['keyword.control']]);
396
+ registerTokenType('number', ( localize('number', "Style for numbers.")), [['constant.numeric']]);
397
+ registerTokenType('regexp', ( localize('regexp', "Style for expressions.")), [['constant.regexp']]);
398
+ registerTokenType('operator', ( localize('operator', "Style for operators.")), [['keyword.operator']]);
399
+ registerTokenType('namespace', ( localize('namespace', "Style for namespaces.")), [['entity.name.namespace']]);
400
+ registerTokenType('type', ( localize('type', "Style for types.")), [['entity.name.type'], ['support.type']]);
401
+ registerTokenType('struct', ( localize('struct', "Style for structs.")), [['entity.name.type.struct']]);
402
+ registerTokenType('class', ( localize('class', "Style for classes.")), [['entity.name.type.class'], ['support.class']]);
403
+ registerTokenType('interface', ( localize('interface', "Style for interfaces.")), [['entity.name.type.interface']]);
404
+ registerTokenType('enum', ( localize('enum', "Style for enums.")), [['entity.name.type.enum']]);
405
+ registerTokenType('typeParameter', ( localize('typeParameter', "Style for type parameters.")), [['entity.name.type.parameter']]);
406
+ registerTokenType('function', ( localize('function', "Style for functions")), [['entity.name.function'], ['support.function']]);
407
+ registerTokenType('member', ( localize('member', "Style for member functions")), [], 'method', 'Deprecated use `method` instead');
408
+ registerTokenType('method', ( localize('method', "Style for method (member functions)")), [['entity.name.function.member'], ['support.function']]);
409
+ registerTokenType('macro', ( localize('macro', "Style for macros.")), [['entity.name.function.preprocessor']]);
410
+ registerTokenType('variable', ( localize('variable', "Style for variables.")), [['variable.other.readwrite'], ['entity.name.variable']]);
411
+ registerTokenType('parameter', ( localize('parameter', "Style for parameters.")), [['variable.parameter']]);
412
+ registerTokenType('property', ( localize('property', "Style for properties.")), [['variable.other.property']]);
413
+ registerTokenType('enumMember', ( localize('enumMember', "Style for enum members.")), [['variable.other.enummember']]);
414
+ registerTokenType('event', ( localize('event', "Style for events.")), [['variable.other.event']]);
415
+ registerTokenType('decorator', ( localize('decorator', "Style for decorators & annotations.")), [['entity.name.decorator'], ['entity.name.function']]);
416
+ registerTokenType('label', ( localize('labels', "Style for labels. ")), undefined);
417
+ registry.registerTokenModifier('declaration', ( localize('declaration', "Style for all symbol declarations.")), undefined);
418
+ registry.registerTokenModifier('documentation', ( localize('documentation', "Style to use for references in documentation.")), undefined);
419
+ registry.registerTokenModifier('static', ( localize('static', "Style to use for symbols that are static.")), undefined);
420
+ registry.registerTokenModifier('abstract', ( localize('abstract', "Style to use for symbols that are abstract.")), undefined);
421
+ registry.registerTokenModifier('deprecated', ( localize('deprecated', "Style to use for symbols that are deprecated.")), undefined);
422
+ registry.registerTokenModifier('modification', ( localize('modification', "Style to use for write accesses.")), undefined);
423
+ registry.registerTokenModifier('async', ( localize('async', "Style to use for symbols that are async.")), undefined);
424
+ registry.registerTokenModifier('readonly', ( localize('readonly', "Style to use for symbols that are readonly.")), undefined);
431
425
  registerTokenStyleDefault('variable.readonly', [['variable.other.constant']]);
432
426
  registerTokenStyleDefault('property.readonly', [['variable.other.constant.property']]);
433
427
  registerTokenStyleDefault('type.defaultLibrary', [['support.type']]);
@@ -461,9 +455,9 @@ function getStylingSchemeEntry(description, deprecationMessage) {
461
455
  };
462
456
  }
463
457
  const tokenStylingSchemaId = 'vscode://schemas/token-styling';
464
- const schemaRegistry = ( Registry.as(Extensions.JSONContribution));
458
+ const schemaRegistry = Registry.as(Extensions.JSONContribution);
465
459
  schemaRegistry.registerSchema(tokenStylingSchemaId, tokenClassificationRegistry.getTokenStylingSchema());
466
- const delayer = ( (new RunOnceScheduler(() => schemaRegistry.notifySchemaChanged(tokenStylingSchemaId), 200)));
460
+ const delayer = ( new RunOnceScheduler(() => schemaRegistry.notifySchemaChanged(tokenStylingSchemaId), 200));
467
461
  tokenClassificationRegistry.onDidChangeSchema(() => {
468
462
  if (!delayer.isScheduled()) {
469
463
  delayer.schedule();
package/dist/tools.js CHANGED
@@ -1,5 +1,6 @@
1
- import { f as ExtensionsRegistry } from './missing-services.js';
1
+ import { E as ExtensionsRegistry } from './missing-services.js';
2
2
  import { EventEmitter } from 'vscode';
3
+ import './services2.js';
3
4
  import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
4
5
  import Severity from 'monaco-editor/esm/vs/base/common/severity.js';
5
6
  function consoleExtensionMessageHandler(msg) {
@@ -43,4 +43,4 @@ var ExtensionData;
43
43
  }
44
44
  ExtensionData.fromName = fromName;
45
45
  })(ExtensionData || (ExtensionData = {})));
46
- export { ExtensionData as E, IWorkbenchThemeService as I, ThemeSettings as T, VS_DARK_THEME as V, VS_LIGHT_THEME as a, VS_HC_THEME as b, VS_HC_LIGHT_THEME as c, THEME_SCOPE_OPEN_PAREN as d, THEME_SCOPE_CLOSE_PAREN as e, THEME_SCOPE_WILDCARD as f, themeScopeRegex as t };
46
+ export { ExtensionData as E, IWorkbenchThemeService as I, THEME_SCOPE_OPEN_PAREN as T, VS_HC_LIGHT_THEME as V, THEME_SCOPE_CLOSE_PAREN as a, THEME_SCOPE_WILDCARD as b, VS_HC_THEME as c, VS_LIGHT_THEME as d, VS_DARK_THEME as e, ThemeSettings as f, themeScopeRegex as t };
@@ -1,3 +1,4 @@
1
+ import './polyfill.js';
1
2
  import { u as unsupported } from './missing-services.js';
2
3
  import { S as Services } from './services2.js';
3
4
  import { IWorkspaceContextService, WorkspaceFolder } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
@@ -43,7 +44,7 @@ class SimpleWorkspaceContextService {
43
44
  }
44
45
  function getServiceOverride() {
45
46
  return {
46
- [( IWorkspaceContextService.toString())]: new SyncDescriptor(SimpleWorkspaceContextService)
47
+ [IWorkspaceContextService.toString()]: new SyncDescriptor(SimpleWorkspaceContextService)
47
48
  };
48
49
  }
49
50
  export { getServiceOverride as g };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-api",
3
- "version": "1.69.7",
3
+ "version": "1.69.8",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor",
6
6
  "keywords": [],