@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,6 +1,7 @@
1
- import { _ as __decorate, a as __param } from './contextkey.js';
2
- import { g as ILanguageDetectionService, E as Emitter, u as unsupported } from './missing-services.js';
3
- import { MutableDisposable, Disposable, toDisposable, ImmortalReference, dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
1
+ import { b as __decorate, d as __param } from './contextkey.js';
2
+ import { E as Emitter } from './polyfill.js';
3
+ import { d as ILanguageDetectionService, u as unsupported } from './missing-services.js';
4
+ import { Disposable, MutableDisposable, dispose, toDisposable, ImmortalReference } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
4
5
  import { w as withUndefinedAsNull } from './types.js';
5
6
  import { ThrottledDelayer } from 'monaco-editor/esm/vs/base/common/async.js';
6
7
  import { PLAINTEXT_LANGUAGE_ID } from 'monaco-editor/esm/vs/editor/common/languages/modesRegistry.js';
@@ -8,7 +9,7 @@ import { localize } from 'monaco-editor/esm/vs/nls.js';
8
9
  import { IModelService } from 'monaco-editor/esm/vs/editor/common/services/model.js';
9
10
  import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
10
11
  import { IAccessibilityService } from 'monaco-editor/esm/vs/platform/accessibility/common/accessibility.js';
11
- import { e as ITextFileService, I as IFileService, b as IUriIdentityService, c as IEditorService, q as SIDE_GROUP, A as ACTIVE_GROUP, s as isPreferredGroup } from './services2.js';
12
+ import { d as IFileService, f as IUriIdentityService, I as ITextFileService, c as SIDE_GROUP, A as ACTIVE_GROUP, i as IEditorService, u as isPreferredGroup } from './services2.js';
12
13
  import { MultiModelEditStackElement } from 'monaco-editor/esm/vs/editor/common/model/editStack.js';
13
14
  import { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
14
15
  import { IUndoRedoService } from 'monaco-editor/esm/vs/platform/undoRedo/common/undoRedo.js';
@@ -28,7 +29,7 @@ import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
28
29
  import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
29
30
  class ReferenceCollection {
30
31
  constructor() {
31
- this.references = ( (new Map()));
32
+ this.references = ( new Map());
32
33
  }
33
34
  acquire(key, ...args) {
34
35
  let reference = this.references.get(key);
@@ -102,7 +103,7 @@ function isCompositeEditor(thing) {
102
103
  class EditorModel extends Disposable {
103
104
  constructor() {
104
105
  super(...arguments);
105
- this._onWillDispose = this._register(( (new Emitter())));
106
+ this._onWillDispose = this._register(( new Emitter()));
106
107
  this.onWillDispose = this._onWillDispose.event;
107
108
  this.disposed = false;
108
109
  this.resolved = false;
@@ -130,8 +131,8 @@ let BaseTextEditorModel = class BaseTextEditorModel extends EditorModel {
130
131
  this.languageDetectionService = languageDetectionService;
131
132
  this.accessibilityService = accessibilityService;
132
133
  this.textEditorModelHandle = undefined;
133
- this.modelDisposeListener = this._register(( (new MutableDisposable())));
134
- this.autoDetectLanguageThrottler = this._register(( (new ThrottledDelayer(BaseTextEditorModel.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY))));
134
+ this.modelDisposeListener = this._register(( new MutableDisposable()));
135
+ this.autoDetectLanguageThrottler = this._register(( new ThrottledDelayer(BaseTextEditorModel.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY)));
135
136
  this._hasLanguageSetExplicitly = false;
136
137
  if (textEditorModelHandle) {
137
138
  this.handleExistingModel(textEditorModelHandle);
@@ -189,11 +190,11 @@ let BaseTextEditorModel = class BaseTextEditorModel extends EditorModel {
189
190
  this.setLanguageIdInternal(lang);
190
191
  const languageName = this.languageService.getLanguageName(lang);
191
192
  if (languageName) {
192
- this.accessibilityService.alert(( (localize(
193
+ this.accessibilityService.alert(( localize(
193
194
  'languageAutoDetected',
194
195
  "Language {0} was automatically detected and set as the language mode.",
195
196
  languageName
196
- ))));
197
+ )));
197
198
  }
198
199
  }
199
200
  }
@@ -260,12 +261,12 @@ let BaseTextEditorModel = class BaseTextEditorModel extends EditorModel {
260
261
  }
261
262
  };
262
263
  BaseTextEditorModel.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY = 600;
263
- BaseTextEditorModel = ( (__decorate([
264
- ( (__param(0, IModelService))),
265
- ( (__param(1, ILanguageService))),
266
- ( (__param(2, ILanguageDetectionService))),
267
- ( (__param(3, IAccessibilityService)))
268
- ], BaseTextEditorModel)));
264
+ BaseTextEditorModel = ( __decorate([
265
+ ( __param(0, IModelService)),
266
+ ( __param(1, ILanguageService)),
267
+ ( __param(2, ILanguageDetectionService)),
268
+ ( __param(3, IAccessibilityService))
269
+ ], BaseTextEditorModel));
269
270
  let TextResourceEditorModel = class TextResourceEditorModel extends BaseTextEditorModel {
270
271
  constructor(resource, languageService, modelService, languageDetectionService, accessibilityService) {
271
272
  super(modelService, languageService, languageDetectionService, accessibilityService, resource);
@@ -277,12 +278,12 @@ let TextResourceEditorModel = class TextResourceEditorModel extends BaseTextEdit
277
278
  super.dispose();
278
279
  }
279
280
  };
280
- TextResourceEditorModel = ( (__decorate([
281
- ( (__param(1, ILanguageService))),
282
- ( (__param(2, IModelService))),
283
- ( (__param(3, ILanguageDetectionService))),
284
- ( (__param(4, IAccessibilityService)))
285
- ], TextResourceEditorModel)));
281
+ TextResourceEditorModel = ( __decorate([
282
+ ( __param(1, ILanguageService)),
283
+ ( __param(2, IModelService)),
284
+ ( __param(3, ILanguageDetectionService)),
285
+ ( __param(4, IAccessibilityService))
286
+ ], TextResourceEditorModel));
286
287
  class TextFileEditorModel {}
287
288
  let ModelUndoRedoParticipant = class ModelUndoRedoParticipant extends Disposable {
288
289
  constructor(_modelService, _textModelService, _undoRedoService) {
@@ -328,11 +329,11 @@ let ModelUndoRedoParticipant = class ModelUndoRedoParticipant extends Disposable
328
329
  });
329
330
  }
330
331
  };
331
- ModelUndoRedoParticipant = ( (__decorate([
332
- ( (__param(0, IModelService))),
333
- ( (__param(1, ITextModelService))),
334
- ( (__param(2, IUndoRedoService)))
335
- ], ModelUndoRedoParticipant)));
332
+ ModelUndoRedoParticipant = ( __decorate([
333
+ ( __param(0, IModelService)),
334
+ ( __param(1, ITextModelService)),
335
+ ( __param(2, IUndoRedoService))
336
+ ], ModelUndoRedoParticipant));
336
337
  let ResourceModelCollection = class ResourceModelCollection extends ReferenceCollection {
337
338
  constructor(instantiationService, textFileService, fileService, modelService) {
338
339
  super();
@@ -340,15 +341,15 @@ let ResourceModelCollection = class ResourceModelCollection extends ReferenceCol
340
341
  this.textFileService = textFileService;
341
342
  this.fileService = fileService;
342
343
  this.modelService = modelService;
343
- this.providers = ( (new Map()));
344
- this.modelsToDispose = ( (new Set()));
344
+ this.providers = ( new Map());
345
+ this.modelsToDispose = ( new Set());
345
346
  }
346
347
  createReferencedObject(key) {
347
348
  return this.doCreateReferencedObject(key);
348
349
  }
349
350
  async doCreateReferencedObject(key, skipActivateProvider) {
350
351
  this.modelsToDispose.delete(key);
351
- const resource = ( (URI.parse(key)));
352
+ const resource = ( URI.parse(key));
352
353
  if (resource.scheme === Schemas.inMemory) {
353
354
  const cachedModel = this.modelService.getModel(resource);
354
355
  if (!cachedModel) {
@@ -391,7 +392,7 @@ let ResourceModelCollection = class ResourceModelCollection extends ReferenceCol
391
392
  throw new Error(`Unable to resolve resource ${key}`);
392
393
  }
393
394
  destroyReferencedObject(key, modelPromise) {
394
- const resource = ( (URI.parse(key)));
395
+ const resource = ( URI.parse(key));
395
396
  if (resource.scheme === Schemas.untitled || resource.scheme === Schemas.inMemory) {
396
397
  return;
397
398
  }
@@ -443,7 +444,7 @@ let ResourceModelCollection = class ResourceModelCollection extends ReferenceCol
443
444
  return this.providers.get(scheme) !== undefined;
444
445
  }
445
446
  async resolveTextModelContent(key) {
446
- const resource = ( (URI.parse(key)));
447
+ const resource = ( URI.parse(key));
447
448
  const providersForScheme = this.providers.get(resource.scheme) || [];
448
449
  for (const provider of providersForScheme) {
449
450
  const value = await provider.provideTextContent(resource);
@@ -454,12 +455,12 @@ let ResourceModelCollection = class ResourceModelCollection extends ReferenceCol
454
455
  throw new Error(`Unable to resolve text model content for resource ${key}`);
455
456
  }
456
457
  };
457
- ResourceModelCollection = ( (__decorate([
458
- ( (__param(0, IInstantiationService))),
459
- ( (__param(1, ITextFileService))),
460
- ( (__param(2, IFileService))),
461
- ( (__param(3, IModelService)))
462
- ], ResourceModelCollection)));
458
+ ResourceModelCollection = ( __decorate([
459
+ ( __param(0, IInstantiationService)),
460
+ ( __param(1, ITextFileService)),
461
+ ( __param(2, IFileService)),
462
+ ( __param(3, IModelService))
463
+ ], ResourceModelCollection));
463
464
  let TextModelResolverService = class TextModelResolverService extends Disposable {
464
465
  constructor(instantiationService, fileService, undoRedoService, modelService, uriIdentityService) {
465
466
  super();
@@ -469,12 +470,12 @@ let TextModelResolverService = class TextModelResolverService extends Disposable
469
470
  this.modelService = modelService;
470
471
  this.uriIdentityService = uriIdentityService;
471
472
  this.resourceModelCollection = this.instantiationService.createInstance(ResourceModelCollection);
472
- this.asyncModelCollection = ( (new AsyncReferenceCollection(this.resourceModelCollection)));
473
- this._register(( (new ModelUndoRedoParticipant(this.modelService, this, this.undoRedoService))));
473
+ this.asyncModelCollection = ( new AsyncReferenceCollection(this.resourceModelCollection));
474
+ this._register(( new ModelUndoRedoParticipant(this.modelService, this, this.undoRedoService)));
474
475
  }
475
476
  async createModelReference(resource) {
476
477
  resource = this.uriIdentityService.asCanonicalUri(resource);
477
- return await this.asyncModelCollection.acquire(( (resource.toString())));
478
+ return await this.asyncModelCollection.acquire(( resource.toString()));
478
479
  }
479
480
  registerTextModelContentProvider(scheme, provider) {
480
481
  return this.resourceModelCollection.registerTextModelContentProvider(scheme, provider);
@@ -486,13 +487,13 @@ let TextModelResolverService = class TextModelResolverService extends Disposable
486
487
  return this.resourceModelCollection.hasTextModelContentProvider(resource.scheme);
487
488
  }
488
489
  };
489
- TextModelResolverService = ( (__decorate([
490
- ( (__param(0, IInstantiationService))),
491
- ( (__param(1, IFileService))),
492
- ( (__param(2, IUndoRedoService))),
493
- ( (__param(3, IModelService))),
494
- ( (__param(4, IUriIdentityService)))
495
- ], TextModelResolverService)));
490
+ TextModelResolverService = ( __decorate([
491
+ ( __param(0, IInstantiationService)),
492
+ ( __param(1, IFileService)),
493
+ ( __param(2, IUndoRedoService)),
494
+ ( __param(3, IModelService)),
495
+ ( __param(4, IUriIdentityService))
496
+ ], TextModelResolverService));
496
497
  function applyTextEditorOptions(options, editor, scrollType) {
497
498
  let applied = false;
498
499
  const viewState = massageEditorViewState(options);
@@ -605,13 +606,13 @@ let CodeEditorService = class CodeEditorService extends AbstractCodeEditorServic
605
606
  return null;
606
607
  }
607
608
  };
608
- CodeEditorService = ( (__decorate([
609
- ( (__param(0, IEditorService))),
610
- ( (__param(1, IThemeService))),
611
- ( (__param(2, IConfigurationService)))
612
- ], CodeEditorService)));
613
- const DEFAULT_EDITOR_MIN_DIMENSIONS = ( (new Dimension(220, 70)));
614
- const DEFAULT_EDITOR_MAX_DIMENSIONS = ( (new Dimension(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY)));
609
+ CodeEditorService = ( __decorate([
610
+ ( __param(0, IEditorService)),
611
+ ( __param(1, IThemeService)),
612
+ ( __param(2, IConfigurationService))
613
+ ], CodeEditorService));
614
+ const DEFAULT_EDITOR_MIN_DIMENSIONS = ( new Dimension(220, 70));
615
+ const DEFAULT_EDITOR_MAX_DIMENSIONS = ( new Dimension(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY));
615
616
  class SimpleEditorPane {
616
617
  constructor(editor) {
617
618
  this.editor = editor;
@@ -702,9 +703,9 @@ let EditorService = class EditorService {
702
703
  return new SimpleEditorPane(modelEditor);
703
704
  }
704
705
  };
705
- EditorService = ( __decorate([
706
- ( __param(1, ITextModelService))
707
- ], EditorService));
706
+ EditorService = __decorate([
707
+ __param(1, ITextModelService)
708
+ ], EditorService);
708
709
  let CustomTextModelResolverService = class CustomTextModelResolverService extends TextModelResolverService {
709
710
  constructor(_instantiationService, fileService, undoRedoService, _modelService, uriIdentityService) {
710
711
  super(_instantiationService, fileService, undoRedoService, _modelService, uriIdentityService);
@@ -723,18 +724,18 @@ let CustomTextModelResolverService = class CustomTextModelResolverService extend
723
724
  return ref;
724
725
  }
725
726
  };
726
- CustomTextModelResolverService = ( __decorate([
727
- ( __param(0, IInstantiationService)),
728
- ( __param(1, IFileService)),
729
- ( __param(2, IUndoRedoService)),
730
- ( __param(3, IModelService)),
731
- ( __param(4, IUriIdentityService))
732
- ], CustomTextModelResolverService));
727
+ CustomTextModelResolverService = __decorate([
728
+ __param(0, IInstantiationService),
729
+ __param(1, IFileService),
730
+ __param(2, IUndoRedoService),
731
+ __param(3, IModelService),
732
+ __param(4, IUriIdentityService)
733
+ ], CustomTextModelResolverService);
733
734
  function getServiceOverride(openEditor) {
734
735
  return {
735
- [( ITextModelService.toString())]: new SyncDescriptor(CustomTextModelResolverService),
736
- [( ICodeEditorService.toString())]: new SyncDescriptor(CodeEditorService),
737
- [( IEditorService.toString())]: new SyncDescriptor(EditorService, [openEditor])
736
+ [ITextModelService.toString()]: new SyncDescriptor(CustomTextModelResolverService),
737
+ [ICodeEditorService.toString()]: new SyncDescriptor(CodeEditorService),
738
+ [IEditorService.toString()]: new SyncDescriptor(EditorService, [openEditor])
738
739
  };
739
740
  }
740
741
  export { getServiceOverride as default };
package/dist/monaco.js CHANGED
@@ -1,5 +1,6 @@
1
- import { _ as __decorate, a as __param } from './contextkey.js';
1
+ import { b as __decorate, d as __param } from './contextkey.js';
2
2
  export { C as ContextKeyExprType } from './contextkey.js';
3
+ import './polyfill.js';
3
4
  import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js';
4
5
  export { registerColor } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
5
6
  import { c as createInjectedClass } from './injection.js';
@@ -12,7 +13,7 @@ import { ITextResourceConfigurationService } from 'monaco-editor/esm/vs/editor/c
12
13
  import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
13
14
  import { Extensions as Extensions$1 } from 'monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js';
14
15
  import { Extensions as Extensions$2 } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
15
- import { StandaloneDiffEditor, StandaloneEditor } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js';
16
+ import { StandaloneEditor, StandaloneDiffEditor } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js';
16
17
  import { isObject } from 'monaco-editor/esm/vs/base/common/types.js';
17
18
  import { deepClone } from 'monaco-editor/esm/vs/base/common/objects.js';
18
19
  export { errorHandler } from 'monaco-editor/esm/vs/base/common/errors.js';
@@ -75,7 +76,7 @@ function distinct(base, target) {
75
76
  if (!base || !target) {
76
77
  return result;
77
78
  }
78
- const targetKeys = ( (Object.keys(target)));
79
+ const targetKeys = ( Object.keys(target));
79
80
  targetKeys.forEach(k => {
80
81
  const baseValue = base[k];
81
82
  const targetValue = target[k];
@@ -119,7 +120,7 @@ class ComputedEditorOptions {
119
120
  }
120
121
  class EditorOptionsUtil {
121
122
  static validateOptions(options) {
122
- const result = ( (new ValidatedEditorOptions()));
123
+ const result = ( new ValidatedEditorOptions());
123
124
  for (const editorOption of editorOptionsRegistry) {
124
125
  const value = (editorOption.name === '_never_' ? undefined : options[editorOption.name]);
125
126
  result._write(editorOption.id, editorOption.validate(value));
@@ -127,7 +128,7 @@ class EditorOptionsUtil {
127
128
  return result;
128
129
  }
129
130
  static computeOptions(options, env) {
130
- const result = ( (new ComputedEditorOptions()));
131
+ const result = ( new ComputedEditorOptions());
131
132
  for (const editorOption of editorOptionsRegistry) {
132
133
  result._write(editorOption.id, editorOption.compute(env, result, options._read(editorOption.id)));
133
134
  }
@@ -140,7 +141,7 @@ class EditorOptionsUtil {
140
141
  if (Array.isArray(a) || Array.isArray(b)) {
141
142
  return (Array.isArray(a) && Array.isArray(b) ? equals$1(a, b) : false);
142
143
  }
143
- if (( (Object.keys(a))).length !== ( (Object.keys(b))).length) {
144
+ if (( Object.keys(a)).length !== ( Object.keys(b)).length) {
144
145
  return false;
145
146
  }
146
147
  for (const key in a) {
@@ -160,7 +161,7 @@ class EditorOptionsUtil {
160
161
  somethingChanged = true;
161
162
  }
162
163
  }
163
- return (somethingChanged ? (new ConfigurationChangedEvent(result)) : null);
164
+ return (somethingChanged ? ( new ConfigurationChangedEvent(result)) : null);
164
165
  }
165
166
  static applyUpdate(options, update) {
166
167
  let changed = false;
@@ -210,7 +211,7 @@ let ConfiguredStandaloneEditor = class ConfiguredStandaloneEditor extends create
210
211
  if (this.lastAppliedEditorOptions != null) {
211
212
  editorSettingsToApply = distinct(this.lastAppliedEditorOptions, editorSettingsToApply);
212
213
  }
213
- if (( Object.keys(editorSettingsToApply)).length > 0) {
214
+ if (Object.keys(editorSettingsToApply).length > 0) {
214
215
  this.lastAppliedEditorOptions = editorConfiguration;
215
216
  super.updateOptions(editorSettingsToApply);
216
217
  }
@@ -223,10 +224,10 @@ let ConfiguredStandaloneEditor = class ConfiguredStandaloneEditor extends create
223
224
  this.updateEditorConfiguration();
224
225
  }
225
226
  };
226
- ConfiguredStandaloneEditor = ( __decorate([
227
- ( __param(3, IInstantiationService)),
228
- ( __param(4, ITextResourceConfigurationService))
229
- ], ConfiguredStandaloneEditor));
227
+ ConfiguredStandaloneEditor = __decorate([
228
+ __param(3, IInstantiationService),
229
+ __param(4, ITextResourceConfigurationService)
230
+ ], ConfiguredStandaloneEditor);
230
231
  class ConfiguredStandaloneDiffEditor extends StandaloneDiffEditor {
231
232
  _createInnerEditor(instantiationService, container, options) {
232
233
  return instantiationService.createInstance(ConfiguredStandaloneEditor, container, true, options);
@@ -244,7 +245,7 @@ const Extensions = {
244
245
  ...Extensions$1,
245
246
  ...Extensions$2
246
247
  };
247
- const registry = ( Registry.as(Extensions.JSONContribution));
248
+ const registry = Registry.as(Extensions.JSONContribution);
248
249
  function getJsonSchemas(fileMatchs = {}) {
249
250
  return Object.entries(registry.getSchemaContributions().schemas)
250
251
  .filter(([uri]) => uri !== 'vscode://schemas/vscode-extensions')