@codingame/monaco-vscode-api 1.68.5 → 1.69.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/README.md +102 -7
- package/dist/api.js +481 -9576
- package/dist/configuration.d.ts +488 -0
- package/dist/configuration.js +409 -0
- package/dist/extHost.js +14880 -0
- package/dist/files.js +1325 -0
- package/dist/injection.js +15 -0
- package/dist/jsonErrorMessages.js +17 -0
- package/dist/keybindings.d.ts +502 -0
- package/dist/keybindings.js +2352 -0
- package/dist/languageConfiguration.d.ts +158 -0
- package/dist/languageConfiguration.js +929 -0
- package/dist/languageService.js +340 -0
- package/dist/languages.d.ts +477 -0
- package/dist/languages.js +21 -0
- package/dist/layoutService.js +4 -0
- package/dist/messages.d.ts +7 -0
- package/dist/messages.js +3624 -0
- package/dist/missing-services.js +7293 -0
- package/dist/modelEditor.d.ts +164 -0
- package/dist/modelEditor.js +739 -0
- package/dist/monaco.d.ts +4795 -0
- package/dist/monaco.js +243 -0
- package/dist/services.d.ts +14806 -2098
- package/dist/services.js +22 -25
- package/dist/services2.js +423 -0
- package/dist/snippets.d.ts +466 -0
- package/dist/snippets.js +903 -0
- package/dist/textmate.d.ts +682 -0
- package/dist/textmate.js +740 -0
- package/dist/theme.d.ts +22 -0
- package/dist/theme.js +4167 -0
- package/dist/tokenClassification.d.ts +479 -0
- package/dist/tokenClassification.js +304 -0
- package/dist/tokenClassificationRegistry.js +472 -0
- package/dist/tools.js +17 -0
- package/dist/tslib.es6.js +21 -0
- package/dist/workbenchThemeService.js +46 -0
- package/package.json +106 -37
- package/dist/api.amd.js +0 -10066
- package/dist/api.cjs +0 -10107
- package/dist/services.amd.js +0 -33
- package/dist/services.cjs +0 -33
package/dist/monaco.js
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { _ as __decorate, a as __param } from './tslib.es6.js';
|
|
2
|
+
import { c as createInjectedClass } from './injection.js';
|
|
3
|
+
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js';
|
|
4
|
+
import { editorOptionsRegistry } from 'monaco-editor/esm/vs/editor/common/config/editorOptions.js';
|
|
5
|
+
import { equals as equals$1 } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
6
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
7
|
+
import { ITextResourceConfigurationService } from 'monaco-editor/esm/vs/editor/common/services/textResourceConfiguration.js';
|
|
8
|
+
import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
|
|
9
|
+
import { Extensions as Extensions$1 } from 'monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js';
|
|
10
|
+
import { StandaloneDiffEditor, StandaloneEditor } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js';
|
|
11
|
+
import { isObject } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
12
|
+
import { deepClone } from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
13
|
+
export { errorHandler } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
14
|
+
export { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
15
|
+
export { FoldingController } from 'monaco-editor/esm/vs/editor/contrib/folding/browser/folding.js';
|
|
16
|
+
export { FoldingModel, setCollapseStateForMatchingLines } from 'monaco-editor/esm/vs/editor/contrib/folding/browser/foldingModel.js';
|
|
17
|
+
export { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
18
|
+
export { CommandsRegistry } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
19
|
+
export { allSettings } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
|
|
20
|
+
function equals(one, other) {
|
|
21
|
+
if (one === other) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
if (one === null || one === undefined || other === null || other === undefined) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
if (typeof one !== typeof other) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
if (typeof one !== 'object') {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
if ((Array.isArray(one)) !== (Array.isArray(other))) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
let i;
|
|
37
|
+
let key;
|
|
38
|
+
if (Array.isArray(one)) {
|
|
39
|
+
if (one.length !== other.length) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
for (i = 0; i < one.length; i++) {
|
|
43
|
+
if (!equals(one[i], other[i])) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
const oneKeys = [];
|
|
50
|
+
for (key in one) {
|
|
51
|
+
oneKeys.push(key);
|
|
52
|
+
}
|
|
53
|
+
oneKeys.sort();
|
|
54
|
+
const otherKeys = [];
|
|
55
|
+
for (key in other) {
|
|
56
|
+
otherKeys.push(key);
|
|
57
|
+
}
|
|
58
|
+
otherKeys.sort();
|
|
59
|
+
if (!equals(oneKeys, otherKeys)) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
for (i = 0; i < oneKeys.length; i++) {
|
|
63
|
+
if (!equals(one[oneKeys[i]], other[oneKeys[i]])) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
function distinct(base, target) {
|
|
71
|
+
const result = Object.create(null);
|
|
72
|
+
if (!base || !target) {
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
const targetKeys = ( (Object.keys(target)));
|
|
76
|
+
targetKeys.forEach(k => {
|
|
77
|
+
const baseValue = base[k];
|
|
78
|
+
const targetValue = target[k];
|
|
79
|
+
if (!equals(baseValue, targetValue)) {
|
|
80
|
+
result[k] = targetValue;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
const ConfigurationChangedEvent = monaco.editor.ConfigurationChangedEvent;
|
|
86
|
+
class ValidatedEditorOptions {
|
|
87
|
+
constructor() {
|
|
88
|
+
this._values = [];
|
|
89
|
+
}
|
|
90
|
+
_read(option) {
|
|
91
|
+
return this._values[option];
|
|
92
|
+
}
|
|
93
|
+
get(id) {
|
|
94
|
+
return this._values[id];
|
|
95
|
+
}
|
|
96
|
+
_write(option, value) {
|
|
97
|
+
this._values[option] = value;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
class ComputedEditorOptions {
|
|
101
|
+
constructor() {
|
|
102
|
+
this._values = [];
|
|
103
|
+
}
|
|
104
|
+
_read(id) {
|
|
105
|
+
if (id >= this._values.length) {
|
|
106
|
+
throw new Error('Cannot read uninitialized value');
|
|
107
|
+
}
|
|
108
|
+
return this._values[id];
|
|
109
|
+
}
|
|
110
|
+
get(id) {
|
|
111
|
+
return this._read(id);
|
|
112
|
+
}
|
|
113
|
+
_write(id, value) {
|
|
114
|
+
this._values[id] = value;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
class EditorOptionsUtil {
|
|
118
|
+
static validateOptions(options) {
|
|
119
|
+
const result = ( (new ValidatedEditorOptions()));
|
|
120
|
+
for (const editorOption of editorOptionsRegistry) {
|
|
121
|
+
const value = (editorOption.name === '_never_' ? undefined : options[editorOption.name]);
|
|
122
|
+
result._write(editorOption.id, editorOption.validate(value));
|
|
123
|
+
}
|
|
124
|
+
return result;
|
|
125
|
+
}
|
|
126
|
+
static computeOptions(options, env) {
|
|
127
|
+
const result = ( (new ComputedEditorOptions()));
|
|
128
|
+
for (const editorOption of editorOptionsRegistry) {
|
|
129
|
+
result._write(editorOption.id, editorOption.compute(env, result, options._read(editorOption.id)));
|
|
130
|
+
}
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
static _deepEquals(a, b) {
|
|
134
|
+
if (typeof a !== 'object' || typeof b !== 'object' || !a || !b) {
|
|
135
|
+
return a === b;
|
|
136
|
+
}
|
|
137
|
+
if (Array.isArray(a) || Array.isArray(b)) {
|
|
138
|
+
return (Array.isArray(a) && Array.isArray(b) ? equals$1(a, b) : false);
|
|
139
|
+
}
|
|
140
|
+
if (( (Object.keys(a))).length !== ( (Object.keys(b))).length) {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
for (const key in a) {
|
|
144
|
+
if (!EditorOptionsUtil._deepEquals(a[key], b[key])) {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
static checkEquals(a, b) {
|
|
151
|
+
const result = [];
|
|
152
|
+
let somethingChanged = false;
|
|
153
|
+
for (const editorOption of editorOptionsRegistry) {
|
|
154
|
+
const changed = !EditorOptionsUtil._deepEquals(a._read(editorOption.id), b._read(editorOption.id));
|
|
155
|
+
result[editorOption.id] = changed;
|
|
156
|
+
if (changed) {
|
|
157
|
+
somethingChanged = true;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return (somethingChanged ? (new ConfigurationChangedEvent(result)) : null);
|
|
161
|
+
}
|
|
162
|
+
static applyUpdate(options, update) {
|
|
163
|
+
let changed = false;
|
|
164
|
+
for (const editorOption of editorOptionsRegistry) {
|
|
165
|
+
if (update.hasOwnProperty(editorOption.name)) {
|
|
166
|
+
const result = editorOption.applyUpdate(options[editorOption.name], update[editorOption.name]);
|
|
167
|
+
options[editorOption.name] = result.newValue;
|
|
168
|
+
changed = changed || result.didChange;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return changed;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function computeConfiguration(configuration, isDiffEditor, overrides) {
|
|
175
|
+
const editorConfiguration = isObject(configuration.editor) ? deepClone(configuration.editor) : Object.create(null);
|
|
176
|
+
if (isDiffEditor && isObject(configuration.diffEditor)) {
|
|
177
|
+
Object.assign(editorConfiguration, deepClone(configuration.diffEditor));
|
|
178
|
+
}
|
|
179
|
+
Object.assign(editorConfiguration, deepClone(overrides));
|
|
180
|
+
return editorConfiguration;
|
|
181
|
+
}
|
|
182
|
+
let ConfiguredStandaloneEditor = class ConfiguredStandaloneEditor extends createInjectedClass(StandaloneEditor) {
|
|
183
|
+
constructor(domElement, isDiffEditor, _options = {}, instantiationService, textResourceConfigurationService) {
|
|
184
|
+
const { theme, autoDetectHighContrast, model, value, language, accessibilityHelpUrl, ariaContainerElement, ...options } = _options;
|
|
185
|
+
const computedOptions = computeConfiguration(textResourceConfigurationService.getValue(_options.model?.uri), isDiffEditor, options);
|
|
186
|
+
super(instantiationService, domElement, { ...computedOptions, theme, autoDetectHighContrast, model, value, language, accessibilityHelpUrl, ariaContainerElement });
|
|
187
|
+
this.isDiffEditor = isDiffEditor;
|
|
188
|
+
this.textResourceConfigurationService = textResourceConfigurationService;
|
|
189
|
+
this.optionsOverrides = {};
|
|
190
|
+
this.lastAppliedEditorOptions = computedOptions;
|
|
191
|
+
this.optionsOverrides = options;
|
|
192
|
+
this._register(textResourceConfigurationService.onDidChangeConfiguration(() => this.updateEditorConfiguration()));
|
|
193
|
+
this._register(this.onDidChangeModelLanguage(() => this.updateEditorConfiguration()));
|
|
194
|
+
this._register(this.onDidChangeModel(() => this.updateEditorConfiguration()));
|
|
195
|
+
}
|
|
196
|
+
updateEditorConfiguration() {
|
|
197
|
+
const resource = this.getModel()?.uri;
|
|
198
|
+
if (resource == null) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
const configuration = this.textResourceConfigurationService.getValue(resource);
|
|
202
|
+
if (configuration == null) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
const editorConfiguration = computeConfiguration(configuration, this.isDiffEditor, this.optionsOverrides);
|
|
206
|
+
let editorSettingsToApply = editorConfiguration;
|
|
207
|
+
if (this.lastAppliedEditorOptions != null) {
|
|
208
|
+
editorSettingsToApply = distinct(this.lastAppliedEditorOptions, editorSettingsToApply);
|
|
209
|
+
}
|
|
210
|
+
if (( Object.keys(editorSettingsToApply)).length > 0) {
|
|
211
|
+
this.lastAppliedEditorOptions = editorConfiguration;
|
|
212
|
+
super.updateOptions(editorSettingsToApply);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
updateOptions(newOptions) {
|
|
216
|
+
const didChange = EditorOptionsUtil.applyUpdate(this.optionsOverrides, newOptions);
|
|
217
|
+
if (!didChange) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
this.updateEditorConfiguration();
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
ConfiguredStandaloneEditor = ( __decorate([
|
|
224
|
+
( __param(3, IInstantiationService)),
|
|
225
|
+
( __param(4, ITextResourceConfigurationService))
|
|
226
|
+
], ConfiguredStandaloneEditor));
|
|
227
|
+
class ConfiguredStandaloneDiffEditor extends StandaloneDiffEditor {
|
|
228
|
+
_createInnerEditor(instantiationService, container, options) {
|
|
229
|
+
return instantiationService.createInstance(ConfiguredStandaloneEditor, container, true, options);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
const createConfiguredEditor = (domElement, options, override) => {
|
|
233
|
+
const instantiationService = StandaloneServices.initialize(override ?? {});
|
|
234
|
+
return instantiationService.createInstance(ConfiguredStandaloneEditor, domElement, false, options);
|
|
235
|
+
};
|
|
236
|
+
const createConfiguredDiffEditor = (domElement, options, override) => {
|
|
237
|
+
const instantiationService = StandaloneServices.initialize(override ?? {});
|
|
238
|
+
return instantiationService.createInstance(ConfiguredStandaloneDiffEditor, domElement, options);
|
|
239
|
+
};
|
|
240
|
+
const Extensions = {
|
|
241
|
+
...Extensions$1
|
|
242
|
+
};
|
|
243
|
+
export { Extensions, createConfiguredDiffEditor, createConfiguredEditor };
|