@codingame/monaco-vscode-api 1.69.24 → 1.76.0-next.2
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/README.md +1 -3
- package/dist/_.contribution.js +3 -3
- package/dist/api.js +63 -31
- package/dist/async.js +9 -9
- package/dist/configuration.d.ts +109 -21
- package/dist/configuration.js +47 -217
- package/dist/{workspace.js → contextkey.js} +26 -47
- package/dist/dialogs.js +498 -426
- package/dist/extHost.js +1884 -909
- package/dist/files.js +65 -63
- package/dist/keybindings.d.ts +24 -18
- package/dist/keybindings.js +475 -404
- package/dist/languageConfiguration.js +5 -5
- package/dist/languageService.js +11 -3
- package/dist/languages.d.ts +24 -7
- package/dist/languages.js +1 -1
- package/dist/layout.js +104 -166
- package/dist/missing-services.js +230 -77
- package/dist/modelEditor.d.ts +1 -5
- package/dist/modelEditor.js +32 -58
- package/dist/monaco.d.ts +303 -713
- package/dist/monaco.js +2 -2
- package/dist/notifications.js +95 -235
- package/dist/polyfill.js +2022 -1637
- package/dist/services.d.ts +8908 -8467
- package/dist/services.js +1 -1
- package/dist/services2.js +293 -113
- package/dist/snippets.d.ts +24 -7
- package/dist/snippets.js +11 -9
- package/dist/textmate.d.ts +114 -20
- package/dist/textmate.js +825 -453
- package/dist/theme.js +13 -14
- package/dist/tokenClassification.d.ts +24 -7
- package/dist/tokenClassification.js +1 -1
- package/dist/tokenClassificationRegistry.js +1 -1
- package/dist/tools.js +104 -28
- package/package.json +12 -19
- package/dist/messages.d.ts +0 -10
- package/dist/messages.js +0 -11
- package/dist/types.js +0 -46
package/dist/modelEditor.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { _ as __decorate, a as __param, E as Emitter } from './
|
|
2
|
-
import './polyfill.js';
|
|
3
|
-
import { a as ILanguageDetectionService, u as unsupported } from './missing-services.js';
|
|
1
|
+
import { _ as __decorate, a as __param, E as Emitter } from './contextkey.js';
|
|
2
|
+
import { w as withUndefinedAsNull, A as AsyncReferenceCollection, R as ReferenceCollection } from './polyfill.js';
|
|
3
|
+
import { L as LanguageDetectionLanguageEventSource, a as ILanguageDetectionService, u as unsupported } from './missing-services.js';
|
|
4
4
|
import { MutableDisposable, Disposable, ImmortalReference, dispose, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
5
|
-
import { w as withUndefinedAsNull } from './types.js';
|
|
6
5
|
import { ThrottledDelayer } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
7
6
|
import { PLAINTEXT_LANGUAGE_ID } from 'monaco-editor/esm/vs/editor/common/languages/modesRegistry.js';
|
|
8
7
|
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
@@ -13,12 +12,11 @@ import { b as IEditorService, p as SIDE_GROUP, A as ACTIVE_GROUP, c as IFileServ
|
|
|
13
12
|
import { MultiModelEditStackElement } from 'monaco-editor/esm/vs/editor/common/model/editStack.js';
|
|
14
13
|
import { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
|
|
15
14
|
import { IUndoRedoService } from 'monaco-editor/esm/vs/platform/undoRedo/common/undoRedo.js';
|
|
16
|
-
import { once } from 'monaco-editor/esm/vs/base/common/functional.js';
|
|
17
15
|
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
18
16
|
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
19
17
|
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
20
18
|
import { AbstractCodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/abstractCodeEditorService.js';
|
|
21
|
-
import { isCodeEditor, isDiffEditor, getCodeEditor } from 'monaco-editor/esm/vs/editor/browser/editorBrowser.js';
|
|
19
|
+
import { isCodeEditor, isDiffEditor, isCompositeEditor, getCodeEditor } from 'monaco-editor/esm/vs/editor/browser/editorBrowser.js';
|
|
22
20
|
import { isEqual } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
23
21
|
import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
24
22
|
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
@@ -27,46 +25,6 @@ import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/comm
|
|
|
27
25
|
import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
|
|
28
26
|
import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
29
27
|
import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
|
|
30
|
-
class ReferenceCollection {
|
|
31
|
-
constructor() {
|
|
32
|
-
this.references = ( (new Map()));
|
|
33
|
-
}
|
|
34
|
-
acquire(key, ...args) {
|
|
35
|
-
let reference = this.references.get(key);
|
|
36
|
-
if (!reference) {
|
|
37
|
-
reference = { counter: 0, object: this.createReferencedObject(key, ...args) };
|
|
38
|
-
this.references.set(key, reference);
|
|
39
|
-
}
|
|
40
|
-
const { object } = reference;
|
|
41
|
-
const dispose = once(() => {
|
|
42
|
-
if (--reference.counter === 0) {
|
|
43
|
-
this.destroyReferencedObject(key, reference.object);
|
|
44
|
-
this.references.delete(key);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
reference.counter++;
|
|
48
|
-
return { object, dispose };
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
class AsyncReferenceCollection {
|
|
52
|
-
constructor(referenceCollection) {
|
|
53
|
-
this.referenceCollection = referenceCollection;
|
|
54
|
-
}
|
|
55
|
-
async acquire(key, ...args) {
|
|
56
|
-
const ref = this.referenceCollection.acquire(key, ...args);
|
|
57
|
-
try {
|
|
58
|
-
const object = await ref.object;
|
|
59
|
-
return {
|
|
60
|
-
object,
|
|
61
|
-
dispose: () => ref.dispose()
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
catch (error) {
|
|
65
|
-
ref.dispose();
|
|
66
|
-
throw error;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
28
|
function isResolvedTextEditorModel(model) {
|
|
71
29
|
const candidate = model;
|
|
72
30
|
return !!candidate.textEditorModel;
|
|
@@ -95,11 +53,6 @@ function isTextEditorViewState(candidate) {
|
|
|
95
53
|
const codeEditorViewState = viewState;
|
|
96
54
|
return !!(codeEditorViewState.contributionsState && codeEditorViewState.viewState && Array.isArray(codeEditorViewState.cursorState));
|
|
97
55
|
}
|
|
98
|
-
function isCompositeEditor(thing) {
|
|
99
|
-
return !!thing
|
|
100
|
-
&& typeof thing === 'object'
|
|
101
|
-
&& typeof thing.onDidChangeActiveEditor === 'function';
|
|
102
|
-
}
|
|
103
56
|
class EditorModel extends Disposable {
|
|
104
57
|
constructor() {
|
|
105
58
|
super(...arguments);
|
|
@@ -159,18 +112,27 @@ let BaseTextEditorModel = class BaseTextEditorModel extends EditorModel {
|
|
|
159
112
|
return true;
|
|
160
113
|
}
|
|
161
114
|
get hasLanguageSetExplicitly() { return this._hasLanguageSetExplicitly; }
|
|
162
|
-
setLanguageId(languageId) {
|
|
115
|
+
setLanguageId(languageId, source) {
|
|
163
116
|
this._hasLanguageSetExplicitly = true;
|
|
164
|
-
this.setLanguageIdInternal(languageId);
|
|
117
|
+
this.setLanguageIdInternal(languageId, source);
|
|
165
118
|
}
|
|
166
|
-
setLanguageIdInternal(languageId) {
|
|
119
|
+
setLanguageIdInternal(languageId, source) {
|
|
167
120
|
if (!this.isResolved()) {
|
|
168
121
|
return;
|
|
169
122
|
}
|
|
170
123
|
if (!languageId || languageId === this.textEditorModel.getLanguageId()) {
|
|
171
124
|
return;
|
|
172
125
|
}
|
|
173
|
-
this.modelService.setMode(this.textEditorModel, this.languageService.createById(languageId));
|
|
126
|
+
this.modelService.setMode(this.textEditorModel, this.languageService.createById(languageId), source);
|
|
127
|
+
}
|
|
128
|
+
installModelListeners(model) {
|
|
129
|
+
const disposable = this._register(model.onDidChangeLanguage((e) => {
|
|
130
|
+
if (e.source === LanguageDetectionLanguageEventSource) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
this._hasLanguageSetExplicitly = true;
|
|
134
|
+
disposable.dispose();
|
|
135
|
+
}));
|
|
174
136
|
}
|
|
175
137
|
getLanguageId() {
|
|
176
138
|
return this.textEditorModel?.getLanguageId();
|
|
@@ -187,7 +149,7 @@ let BaseTextEditorModel = class BaseTextEditorModel extends EditorModel {
|
|
|
187
149
|
}
|
|
188
150
|
const lang = await this.languageDetectionService.detectLanguage(this.textEditorModelHandle);
|
|
189
151
|
if (lang && !this.isDisposed()) {
|
|
190
|
-
this.setLanguageIdInternal(lang);
|
|
152
|
+
this.setLanguageIdInternal(lang, LanguageDetectionLanguageEventSource);
|
|
191
153
|
const languageName = this.languageService.getLanguageName(lang);
|
|
192
154
|
if (languageName) {
|
|
193
155
|
this.accessibilityService.alert(( (localize(
|
|
@@ -462,6 +424,18 @@ ResourceModelCollection = ( (__decorate([
|
|
|
462
424
|
( (__param(3, IModelService)))
|
|
463
425
|
], ResourceModelCollection)));
|
|
464
426
|
let TextModelResolverService = class TextModelResolverService extends Disposable {
|
|
427
|
+
get resourceModelCollection() {
|
|
428
|
+
if (!this._resourceModelCollection) {
|
|
429
|
+
this._resourceModelCollection = this.instantiationService.createInstance(ResourceModelCollection);
|
|
430
|
+
}
|
|
431
|
+
return this._resourceModelCollection;
|
|
432
|
+
}
|
|
433
|
+
get asyncModelCollection() {
|
|
434
|
+
if (!this._asyncModelCollection) {
|
|
435
|
+
this._asyncModelCollection = ( (new AsyncReferenceCollection(this.resourceModelCollection)));
|
|
436
|
+
}
|
|
437
|
+
return this._asyncModelCollection;
|
|
438
|
+
}
|
|
465
439
|
constructor(instantiationService, fileService, undoRedoService, modelService, uriIdentityService) {
|
|
466
440
|
super();
|
|
467
441
|
this.instantiationService = instantiationService;
|
|
@@ -469,8 +443,8 @@ let TextModelResolverService = class TextModelResolverService extends Disposable
|
|
|
469
443
|
this.undoRedoService = undoRedoService;
|
|
470
444
|
this.modelService = modelService;
|
|
471
445
|
this.uriIdentityService = uriIdentityService;
|
|
472
|
-
this.
|
|
473
|
-
this.
|
|
446
|
+
this._resourceModelCollection = undefined;
|
|
447
|
+
this._asyncModelCollection = undefined;
|
|
474
448
|
this._register(( (new ModelUndoRedoParticipant(this.modelService, this, this.undoRedoService))));
|
|
475
449
|
}
|
|
476
450
|
async createModelReference(resource) {
|