@codingame/monaco-vscode-api 1.67.8 → 1.67.11
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 +71 -6
- package/dist/api.js +7285 -3810
- package/dist/async-9ffe4d42.js +46 -0
- package/dist/messages.d.ts +7 -0
- package/dist/messages.js +4298 -0
- package/dist/missing-services-71e80bea.js +987 -0
- package/dist/modelEditor.d.ts +158 -0
- package/dist/modelEditor.js +721 -0
- package/dist/services-fb7952fb.js +744 -0
- package/dist/services.d.ts +13640 -1827
- package/dist/services.js +36 -27
- package/package.json +45 -36
- package/dist/api.amd.js +0 -11441
- package/dist/api.cjs +0 -11479
- package/dist/services.amd.js +0 -39
- package/dist/services.cjs +0 -39
|
@@ -0,0 +1,987 @@
|
|
|
1
|
+
import { VSBuffer as VSBuffer$1 } from 'monaco-editor/esm/vs/base/common/buffer.js';
|
|
2
|
+
import { Themable as Themable$1 } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
3
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
|
+
import { ProgressBar as ProgressBar$1 } from 'monaco-editor/esm/vs/base/browser/ui/progressbar/progressbar.js';
|
|
5
|
+
import { Color } from 'monaco-editor/esm/vs/base/common/color.js';
|
|
6
|
+
import { mixin } from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
7
|
+
import { RunOnceScheduler } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
8
|
+
import { show, hide, trackFocus } from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
9
|
+
import { isNumber } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
10
|
+
import { LanguageService as LanguageService$1 } from 'monaco-editor/esm/vs/editor/common/services/languageService.js';
|
|
11
|
+
import { LanguagesRegistry } from 'monaco-editor/esm/vs/editor/common/services/languagesRegistry.js';
|
|
12
|
+
import { firstOrDefault } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
13
|
+
import { PLAINTEXT_LANGUAGE_ID } from 'monaco-editor/esm/vs/editor/common/languages/modesRegistry.js';
|
|
14
|
+
import { TokenizationRegistry } from 'monaco-editor/esm/vs/editor/common/languages.js';
|
|
15
|
+
import { NoOpNotification as NoOpNotification$1 } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
|
|
16
|
+
import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
17
|
+
import { QuickInputController } from 'monaco-editor/esm/vs/base/parts/quickinput/browser/quickInput.js';
|
|
18
|
+
import { getSingletonServiceDescriptors, registerSingleton } from 'monaco-editor/esm/vs/platform/instantiation/common/extensions.js';
|
|
19
|
+
import { ILabelService } from 'monaco-editor/esm/vs/platform/label/common/label.js';
|
|
20
|
+
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js';
|
|
21
|
+
import { l as IEditorService, o as IPaneCompositePartService, h as IUriIdentityService, e as ITextFileService, f as IFileService, n as IEditorGroupsService, g as IWorkbenchEnvironmentService, i as IWorkingCopyFileService, j as IPathService, I as IProgressService, t as Services, p as IProductService, q as ILanguageStatusService, s as IHostService } from './services-fb7952fb.js';
|
|
22
|
+
import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
23
|
+
import { ExtUri } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
24
|
+
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
25
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
26
|
+
import { LanguageFeatureRegistry } from 'monaco-editor/esm/vs/editor/common/languageFeatureRegistry.js';
|
|
27
|
+
import { compare } from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
28
|
+
import { DomEmitter } from 'monaco-editor/esm/vs/base/browser/event.js';
|
|
29
|
+
const hasBuffer = (typeof Buffer !== 'undefined');
|
|
30
|
+
let textEncoder;
|
|
31
|
+
let textDecoder;
|
|
32
|
+
class VSBuffer {
|
|
33
|
+
constructor(buffer) {
|
|
34
|
+
this.buffer = buffer;
|
|
35
|
+
this.byteLength = this.buffer.byteLength;
|
|
36
|
+
}
|
|
37
|
+
static alloc(byteLength) {
|
|
38
|
+
if (hasBuffer) {
|
|
39
|
+
return (
|
|
40
|
+
new VSBuffer(Buffer.allocUnsafe(byteLength))
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return (
|
|
45
|
+
new VSBuffer( new Uint8Array(byteLength))
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
static wrap(actual) {
|
|
50
|
+
if (hasBuffer && !(Buffer.isBuffer(actual))) {
|
|
51
|
+
actual = Buffer.from(actual.buffer, actual.byteOffset, actual.byteLength);
|
|
52
|
+
}
|
|
53
|
+
return (
|
|
54
|
+
new VSBuffer(actual)
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
static fromString(source, options) {
|
|
58
|
+
const dontUseNodeBuffer = options?.dontUseNodeBuffer || false;
|
|
59
|
+
if (!dontUseNodeBuffer && hasBuffer) {
|
|
60
|
+
return (
|
|
61
|
+
new VSBuffer(Buffer.from(source))
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
if (!textEncoder) {
|
|
66
|
+
textEncoder = new TextEncoder();
|
|
67
|
+
}
|
|
68
|
+
return (
|
|
69
|
+
new VSBuffer(textEncoder.encode(source))
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
static fromByteArray(source) {
|
|
74
|
+
const result = VSBuffer.alloc(source.length);
|
|
75
|
+
for (let i = 0, len = source.length; i < len; i++) {
|
|
76
|
+
result.buffer[i] = source[i];
|
|
77
|
+
}
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
static concat(buffers, totalLength) {
|
|
81
|
+
if (typeof totalLength === 'undefined') {
|
|
82
|
+
totalLength = 0;
|
|
83
|
+
for (let i = 0, len = buffers.length; i < len; i++) {
|
|
84
|
+
totalLength += buffers[i].byteLength;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const ret = VSBuffer.alloc(totalLength);
|
|
88
|
+
let offset = 0;
|
|
89
|
+
for (let i = 0, len = buffers.length; i < len; i++) {
|
|
90
|
+
const element = buffers[i];
|
|
91
|
+
ret.set(element, offset);
|
|
92
|
+
offset += element.byteLength;
|
|
93
|
+
}
|
|
94
|
+
return ret;
|
|
95
|
+
}
|
|
96
|
+
clone() {
|
|
97
|
+
const result = VSBuffer.alloc(this.byteLength);
|
|
98
|
+
result.set(this);
|
|
99
|
+
return result;
|
|
100
|
+
}
|
|
101
|
+
toString() {
|
|
102
|
+
if (hasBuffer) {
|
|
103
|
+
return this.buffer.toString();
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
if (!textDecoder) {
|
|
107
|
+
textDecoder = new TextDecoder();
|
|
108
|
+
}
|
|
109
|
+
return textDecoder.decode(this.buffer);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
slice(start, end) {
|
|
113
|
+
return (
|
|
114
|
+
new VSBuffer(this.buffer.subarray(start, end))
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
set(array, offset) {
|
|
118
|
+
if (array instanceof VSBuffer) {
|
|
119
|
+
this.buffer.set(array.buffer, offset);
|
|
120
|
+
}
|
|
121
|
+
else if (array instanceof Uint8Array) {
|
|
122
|
+
this.buffer.set(array, offset);
|
|
123
|
+
}
|
|
124
|
+
else if (array instanceof ArrayBuffer) {
|
|
125
|
+
this.buffer.set( new Uint8Array(array), offset);
|
|
126
|
+
}
|
|
127
|
+
else if (ArrayBuffer.isView(array)) {
|
|
128
|
+
this.buffer.set( new Uint8Array(array.buffer, array.byteOffset, array.byteLength), offset);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
throw new Error(`Unknown argument 'array'`);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
readUInt32BE(offset) {
|
|
135
|
+
return readUInt32BE(this.buffer, offset);
|
|
136
|
+
}
|
|
137
|
+
writeUInt32BE(value, offset) {
|
|
138
|
+
writeUInt32BE(this.buffer, value, offset);
|
|
139
|
+
}
|
|
140
|
+
readUInt32LE(offset) {
|
|
141
|
+
return readUInt32LE(this.buffer, offset);
|
|
142
|
+
}
|
|
143
|
+
writeUInt32LE(value, offset) {
|
|
144
|
+
writeUInt32LE(this.buffer, value, offset);
|
|
145
|
+
}
|
|
146
|
+
readUInt8(offset) {
|
|
147
|
+
return readUInt8(this.buffer, offset);
|
|
148
|
+
}
|
|
149
|
+
writeUInt8(value, offset) {
|
|
150
|
+
writeUInt8(this.buffer, value, offset);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function readUInt32BE(source, offset) {
|
|
154
|
+
return (source[offset] * 2 ** 24
|
|
155
|
+
+ source[offset + 1] * 2 ** 16
|
|
156
|
+
+ source[offset + 2] * 2 ** 8
|
|
157
|
+
+ source[offset + 3]);
|
|
158
|
+
}
|
|
159
|
+
function writeUInt32BE(destination, value, offset) {
|
|
160
|
+
destination[offset + 3] = value;
|
|
161
|
+
value = value >>> 8;
|
|
162
|
+
destination[offset + 2] = value;
|
|
163
|
+
value = value >>> 8;
|
|
164
|
+
destination[offset + 1] = value;
|
|
165
|
+
value = value >>> 8;
|
|
166
|
+
destination[offset] = value;
|
|
167
|
+
}
|
|
168
|
+
function readUInt32LE(source, offset) {
|
|
169
|
+
return (((source[offset + 0] << 0) >>> 0) |
|
|
170
|
+
((source[offset + 1] << 8) >>> 0) |
|
|
171
|
+
((source[offset + 2] << 16) >>> 0) |
|
|
172
|
+
((source[offset + 3] << 24) >>> 0));
|
|
173
|
+
}
|
|
174
|
+
function writeUInt32LE(destination, value, offset) {
|
|
175
|
+
destination[offset + 0] = (value & 0b11111111);
|
|
176
|
+
value = value >>> 8;
|
|
177
|
+
destination[offset + 1] = (value & 0b11111111);
|
|
178
|
+
value = value >>> 8;
|
|
179
|
+
destination[offset + 2] = (value & 0b11111111);
|
|
180
|
+
value = value >>> 8;
|
|
181
|
+
destination[offset + 3] = (value & 0b11111111);
|
|
182
|
+
}
|
|
183
|
+
function readUInt8(source, offset) {
|
|
184
|
+
return source[offset];
|
|
185
|
+
}
|
|
186
|
+
function writeUInt8(destination, value, offset) {
|
|
187
|
+
destination[offset] = value;
|
|
188
|
+
}
|
|
189
|
+
const Emitter = monaco.Emitter;
|
|
190
|
+
class Themable extends Disposable {
|
|
191
|
+
constructor(themeService) {
|
|
192
|
+
super();
|
|
193
|
+
this.themeService = themeService;
|
|
194
|
+
this.theme = themeService.getColorTheme();
|
|
195
|
+
this._register(this.themeService.onDidColorThemeChange(theme => this.onThemeChange(theme)));
|
|
196
|
+
}
|
|
197
|
+
onThemeChange(theme) {
|
|
198
|
+
this.theme = theme;
|
|
199
|
+
this.updateStyles();
|
|
200
|
+
}
|
|
201
|
+
updateStyles() {
|
|
202
|
+
}
|
|
203
|
+
getColor(id, modify) {
|
|
204
|
+
let color = this.theme.getColor(id);
|
|
205
|
+
if (color && modify) {
|
|
206
|
+
color = modify(color, this.theme);
|
|
207
|
+
}
|
|
208
|
+
return color ? color.toString() : null;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
function isString(str) {
|
|
212
|
+
return (typeof str === 'string');
|
|
213
|
+
}
|
|
214
|
+
function isStringArray(value) {
|
|
215
|
+
return Array.isArray(value) && value.every(elem => isString(elem));
|
|
216
|
+
}
|
|
217
|
+
function isUndefined(obj) {
|
|
218
|
+
return (typeof obj === 'undefined');
|
|
219
|
+
}
|
|
220
|
+
function isUndefinedOrNull(obj) {
|
|
221
|
+
return (isUndefined(obj) || obj === null);
|
|
222
|
+
}
|
|
223
|
+
function assertAllDefined(...args) {
|
|
224
|
+
const result = [];
|
|
225
|
+
for (let i = 0; i < args.length; i++) {
|
|
226
|
+
const arg = args[i];
|
|
227
|
+
if (isUndefinedOrNull(arg)) {
|
|
228
|
+
throw new Error(`Assertion Failed: argument at index ${i} is undefined or null`);
|
|
229
|
+
}
|
|
230
|
+
result.push(arg);
|
|
231
|
+
}
|
|
232
|
+
return result;
|
|
233
|
+
}
|
|
234
|
+
function withUndefinedAsNull(x) {
|
|
235
|
+
return typeof x === 'undefined' ? null : x;
|
|
236
|
+
}
|
|
237
|
+
const CSS_DONE = 'done';
|
|
238
|
+
const CSS_ACTIVE = 'active';
|
|
239
|
+
const CSS_INFINITE = 'infinite';
|
|
240
|
+
const CSS_INFINITE_LONG_RUNNING = 'infinite-long-running';
|
|
241
|
+
const CSS_DISCRETE = 'discrete';
|
|
242
|
+
const defaultOpts = {
|
|
243
|
+
progressBarBackground: Color.fromHex('#0E70C0')
|
|
244
|
+
};
|
|
245
|
+
class ProgressBar extends Disposable {
|
|
246
|
+
constructor(container, options) {
|
|
247
|
+
super();
|
|
248
|
+
this.options = options || Object.create(null);
|
|
249
|
+
mixin(this.options, defaultOpts, false);
|
|
250
|
+
this.workedVal = 0;
|
|
251
|
+
this.progressBarBackground = this.options.progressBarBackground;
|
|
252
|
+
this.showDelayedScheduler = this._register( new RunOnceScheduler(() => show(this.element), 0));
|
|
253
|
+
this.longRunningScheduler = this._register( new RunOnceScheduler(
|
|
254
|
+
() => this.infiniteLongRunning(),
|
|
255
|
+
ProgressBar.LONG_RUNNING_INFINITE_THRESHOLD
|
|
256
|
+
));
|
|
257
|
+
this.create(container);
|
|
258
|
+
}
|
|
259
|
+
create(container) {
|
|
260
|
+
this.element = document.createElement('div');
|
|
261
|
+
this.element.classList.add('monaco-progress-container');
|
|
262
|
+
this.element.setAttribute('role', 'progressbar');
|
|
263
|
+
this.element.setAttribute('aria-valuemin', '0');
|
|
264
|
+
container.appendChild(this.element);
|
|
265
|
+
this.bit = document.createElement('div');
|
|
266
|
+
this.bit.classList.add('progress-bit');
|
|
267
|
+
this.element.appendChild(this.bit);
|
|
268
|
+
this.applyStyles();
|
|
269
|
+
}
|
|
270
|
+
off() {
|
|
271
|
+
this.bit.style.width = 'inherit';
|
|
272
|
+
this.bit.style.opacity = '1';
|
|
273
|
+
this.element.classList.remove(CSS_ACTIVE, CSS_INFINITE, CSS_INFINITE_LONG_RUNNING, CSS_DISCRETE);
|
|
274
|
+
this.workedVal = 0;
|
|
275
|
+
this.totalWork = undefined;
|
|
276
|
+
this.longRunningScheduler.cancel();
|
|
277
|
+
}
|
|
278
|
+
done() {
|
|
279
|
+
return this.doDone(true);
|
|
280
|
+
}
|
|
281
|
+
stop() {
|
|
282
|
+
return this.doDone(false);
|
|
283
|
+
}
|
|
284
|
+
doDone(delayed) {
|
|
285
|
+
this.element.classList.add(CSS_DONE);
|
|
286
|
+
if (!this.element.classList.contains(CSS_INFINITE)) {
|
|
287
|
+
this.bit.style.width = 'inherit';
|
|
288
|
+
if (delayed) {
|
|
289
|
+
setTimeout(() => this.off(), 200);
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
this.off();
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
this.bit.style.opacity = '0';
|
|
297
|
+
if (delayed) {
|
|
298
|
+
setTimeout(() => this.off(), 200);
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
this.off();
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return this;
|
|
305
|
+
}
|
|
306
|
+
infinite() {
|
|
307
|
+
this.bit.style.width = '2%';
|
|
308
|
+
this.bit.style.opacity = '1';
|
|
309
|
+
this.element.classList.remove(CSS_DISCRETE, CSS_DONE, CSS_INFINITE_LONG_RUNNING);
|
|
310
|
+
this.element.classList.add(CSS_ACTIVE, CSS_INFINITE);
|
|
311
|
+
this.longRunningScheduler.schedule();
|
|
312
|
+
return this;
|
|
313
|
+
}
|
|
314
|
+
infiniteLongRunning() {
|
|
315
|
+
this.element.classList.add(CSS_INFINITE_LONG_RUNNING);
|
|
316
|
+
}
|
|
317
|
+
total(value) {
|
|
318
|
+
this.workedVal = 0;
|
|
319
|
+
this.totalWork = value;
|
|
320
|
+
this.element.setAttribute('aria-valuemax', value.toString());
|
|
321
|
+
return this;
|
|
322
|
+
}
|
|
323
|
+
hasTotal() {
|
|
324
|
+
return isNumber(this.totalWork);
|
|
325
|
+
}
|
|
326
|
+
worked(value) {
|
|
327
|
+
value = Math.max(1, Number(value));
|
|
328
|
+
return this.doSetWorked(this.workedVal + value);
|
|
329
|
+
}
|
|
330
|
+
setWorked(value) {
|
|
331
|
+
value = Math.max(1, Number(value));
|
|
332
|
+
return this.doSetWorked(value);
|
|
333
|
+
}
|
|
334
|
+
doSetWorked(value) {
|
|
335
|
+
const totalWork = this.totalWork || 100;
|
|
336
|
+
this.workedVal = value;
|
|
337
|
+
this.workedVal = Math.min(totalWork, this.workedVal);
|
|
338
|
+
this.element.classList.remove(CSS_INFINITE, CSS_INFINITE_LONG_RUNNING, CSS_DONE);
|
|
339
|
+
this.element.classList.add(CSS_ACTIVE, CSS_DISCRETE);
|
|
340
|
+
this.element.setAttribute('aria-valuenow', value.toString());
|
|
341
|
+
this.bit.style.width = 100 * (this.workedVal / (totalWork)) + '%';
|
|
342
|
+
return this;
|
|
343
|
+
}
|
|
344
|
+
getContainer() {
|
|
345
|
+
return this.element;
|
|
346
|
+
}
|
|
347
|
+
show(delay) {
|
|
348
|
+
this.showDelayedScheduler.cancel();
|
|
349
|
+
if (typeof delay === 'number') {
|
|
350
|
+
this.showDelayedScheduler.schedule(delay);
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
show(this.element);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
hide() {
|
|
357
|
+
hide(this.element);
|
|
358
|
+
this.showDelayedScheduler.cancel();
|
|
359
|
+
}
|
|
360
|
+
style(styles) {
|
|
361
|
+
this.progressBarBackground = styles.progressBarBackground;
|
|
362
|
+
this.applyStyles();
|
|
363
|
+
}
|
|
364
|
+
applyStyles() {
|
|
365
|
+
if (this.bit) {
|
|
366
|
+
const background = this.progressBarBackground ? this.progressBarBackground.toString() : '';
|
|
367
|
+
this.bit.style.backgroundColor = background;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
ProgressBar.LONG_RUNNING_INFINITE_THRESHOLD = 10000;
|
|
372
|
+
class LanguageService extends Disposable {
|
|
373
|
+
constructor(warnOnOverwrite = false) {
|
|
374
|
+
super();
|
|
375
|
+
this._onDidEncounterLanguage = this._register( new Emitter());
|
|
376
|
+
this.onDidEncounterLanguage = this._onDidEncounterLanguage.event;
|
|
377
|
+
this._onDidChange = this._register( new Emitter(
|
|
378
|
+
{ leakWarningThreshold: 200 }
|
|
379
|
+
));
|
|
380
|
+
this.onDidChange = this._onDidChange.event;
|
|
381
|
+
LanguageService.instanceCount++;
|
|
382
|
+
this._encounteredLanguages = new Set();
|
|
383
|
+
this._registry = this._register( new LanguagesRegistry(true, warnOnOverwrite));
|
|
384
|
+
this.languageIdCodec = this._registry.languageIdCodec;
|
|
385
|
+
this._register(this._registry.onDidChange(() => this._onDidChange.fire()));
|
|
386
|
+
}
|
|
387
|
+
dispose() {
|
|
388
|
+
LanguageService.instanceCount--;
|
|
389
|
+
super.dispose();
|
|
390
|
+
}
|
|
391
|
+
isRegisteredLanguageId(languageId) {
|
|
392
|
+
return this._registry.isRegisteredLanguageId(languageId);
|
|
393
|
+
}
|
|
394
|
+
getRegisteredLanguageIds() {
|
|
395
|
+
return this._registry.getRegisteredLanguageIds();
|
|
396
|
+
}
|
|
397
|
+
getSortedRegisteredLanguageNames() {
|
|
398
|
+
return this._registry.getSortedRegisteredLanguageNames();
|
|
399
|
+
}
|
|
400
|
+
getLanguageName(languageId) {
|
|
401
|
+
return this._registry.getLanguageName(languageId);
|
|
402
|
+
}
|
|
403
|
+
getMimeType(languageId) {
|
|
404
|
+
return this._registry.getMimeType(languageId);
|
|
405
|
+
}
|
|
406
|
+
getIcon(languageId) {
|
|
407
|
+
return this._registry.getIcon(languageId);
|
|
408
|
+
}
|
|
409
|
+
getExtensions(languageId) {
|
|
410
|
+
return this._registry.getExtensions(languageId);
|
|
411
|
+
}
|
|
412
|
+
getFilenames(languageId) {
|
|
413
|
+
return this._registry.getFilenames(languageId);
|
|
414
|
+
}
|
|
415
|
+
getConfigurationFiles(languageId) {
|
|
416
|
+
return this._registry.getConfigurationFiles(languageId);
|
|
417
|
+
}
|
|
418
|
+
getLanguageIdByLanguageName(languageName) {
|
|
419
|
+
return this._registry.getLanguageIdByLanguageName(languageName);
|
|
420
|
+
}
|
|
421
|
+
getLanguageIdByMimeType(mimeType) {
|
|
422
|
+
return this._registry.getLanguageIdByMimeType(mimeType);
|
|
423
|
+
}
|
|
424
|
+
guessLanguageIdByFilepathOrFirstLine(resource, firstLine) {
|
|
425
|
+
const languageIds = this._registry.guessLanguageIdByFilepathOrFirstLine(resource, firstLine);
|
|
426
|
+
return firstOrDefault(languageIds, null);
|
|
427
|
+
}
|
|
428
|
+
createById(languageId) {
|
|
429
|
+
return (
|
|
430
|
+
new LanguageSelection(this.onDidChange, () => {
|
|
431
|
+
return this._createAndGetLanguageIdentifier(languageId);
|
|
432
|
+
})
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
createByMimeType(mimeType) {
|
|
436
|
+
return (
|
|
437
|
+
new LanguageSelection(this.onDidChange, () => {
|
|
438
|
+
const languageId = this.getLanguageIdByMimeType(mimeType);
|
|
439
|
+
return this._createAndGetLanguageIdentifier(languageId);
|
|
440
|
+
})
|
|
441
|
+
);
|
|
442
|
+
}
|
|
443
|
+
createByFilepathOrFirstLine(resource, firstLine) {
|
|
444
|
+
return (
|
|
445
|
+
new LanguageSelection(this.onDidChange, () => {
|
|
446
|
+
const languageId = this.guessLanguageIdByFilepathOrFirstLine(resource, firstLine);
|
|
447
|
+
return this._createAndGetLanguageIdentifier(languageId);
|
|
448
|
+
})
|
|
449
|
+
);
|
|
450
|
+
}
|
|
451
|
+
_createAndGetLanguageIdentifier(languageId) {
|
|
452
|
+
if (!languageId || !this.isRegisteredLanguageId(languageId)) {
|
|
453
|
+
languageId = PLAINTEXT_LANGUAGE_ID;
|
|
454
|
+
}
|
|
455
|
+
if (!this._encounteredLanguages.has(languageId)) {
|
|
456
|
+
this._encounteredLanguages.add(languageId);
|
|
457
|
+
TokenizationRegistry.getOrCreate(languageId);
|
|
458
|
+
this._onDidEncounterLanguage.fire(languageId);
|
|
459
|
+
}
|
|
460
|
+
return languageId;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
LanguageService.instanceCount = 0;
|
|
464
|
+
class LanguageSelection {
|
|
465
|
+
constructor(_onDidChangeLanguages, _selector) {
|
|
466
|
+
this._onDidChangeLanguages = _onDidChangeLanguages;
|
|
467
|
+
this._selector = _selector;
|
|
468
|
+
this._listener = null;
|
|
469
|
+
this._emitter = null;
|
|
470
|
+
this.languageId = this._selector();
|
|
471
|
+
}
|
|
472
|
+
_dispose() {
|
|
473
|
+
if (this._listener) {
|
|
474
|
+
this._listener.dispose();
|
|
475
|
+
this._listener = null;
|
|
476
|
+
}
|
|
477
|
+
if (this._emitter) {
|
|
478
|
+
this._emitter.dispose();
|
|
479
|
+
this._emitter = null;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
get onDidChange() {
|
|
483
|
+
if (!this._listener) {
|
|
484
|
+
this._listener = this._onDidChangeLanguages(() => this._evaluate());
|
|
485
|
+
}
|
|
486
|
+
if (!this._emitter) {
|
|
487
|
+
this._emitter = new Emitter({
|
|
488
|
+
onLastListenerRemove: () => {
|
|
489
|
+
this._dispose();
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
return this._emitter.event;
|
|
494
|
+
}
|
|
495
|
+
_evaluate() {
|
|
496
|
+
const languageId = this._selector();
|
|
497
|
+
if (languageId === this.languageId) {
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
this.languageId = languageId;
|
|
501
|
+
if (this._emitter) {
|
|
502
|
+
this._emitter.fire(this.languageId);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
var NeverShowAgainScope;
|
|
507
|
+
(function(NeverShowAgainScope) {
|
|
508
|
+
NeverShowAgainScope[NeverShowAgainScope["WORKSPACE"] = 0] = "WORKSPACE";
|
|
509
|
+
NeverShowAgainScope[NeverShowAgainScope["GLOBAL"] = 1] = "GLOBAL";
|
|
510
|
+
})(NeverShowAgainScope || (NeverShowAgainScope = {}));
|
|
511
|
+
var NotificationsFilter;
|
|
512
|
+
(function(NotificationsFilter) {
|
|
513
|
+
NotificationsFilter[NotificationsFilter["OFF"] = 0] = "OFF";
|
|
514
|
+
NotificationsFilter[NotificationsFilter["SILENT"] = 1] = "SILENT";
|
|
515
|
+
NotificationsFilter[NotificationsFilter["ERROR"] = 2] = "ERROR";
|
|
516
|
+
})(NotificationsFilter || (NotificationsFilter = {}));
|
|
517
|
+
class NoOpNotification {
|
|
518
|
+
constructor() {
|
|
519
|
+
this.progress = new NoOpProgress();
|
|
520
|
+
this.onDidClose = Event.None;
|
|
521
|
+
this.onDidChangeVisibility = Event.None;
|
|
522
|
+
}
|
|
523
|
+
updateSeverity(severity) { }
|
|
524
|
+
updateMessage(message) { }
|
|
525
|
+
updateActions(actions) { }
|
|
526
|
+
close() { }
|
|
527
|
+
}
|
|
528
|
+
class NoOpProgress {
|
|
529
|
+
infinite() { }
|
|
530
|
+
done() { }
|
|
531
|
+
total(value) { }
|
|
532
|
+
worked(value) { }
|
|
533
|
+
}
|
|
534
|
+
var _a, _b, _c, _d, _e;
|
|
535
|
+
(_a = NoOpNotification$1.prototype).onDidClose ?? (_a.onDidClose = Event.None);
|
|
536
|
+
for (const key of Object.getOwnPropertyNames(NoOpNotification.prototype)) {
|
|
537
|
+
if (!Object.hasOwnProperty.call(NoOpNotification$1.prototype, key)) {
|
|
538
|
+
NoOpNotification$1.prototype[key] = NoOpNotification.prototype[key];
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
(_b = LanguageService$1.prototype).getRegisteredLanguageIds ?? (_b.getRegisteredLanguageIds = LanguageService.prototype.getRegisteredLanguageIds);
|
|
542
|
+
(_c = ProgressBar$1.prototype).hide ?? (_c.hide = ProgressBar.prototype.hide);
|
|
543
|
+
(_d = Themable$1.prototype)['getColor'] ?? (_d['getColor'] = Themable.prototype['getColor']);
|
|
544
|
+
function polyfillQuickInput(fn) {
|
|
545
|
+
return function () {
|
|
546
|
+
const quickInput = fn.call(this);
|
|
547
|
+
quickInput.onDidTriggerButton ?? (quickInput.onDidTriggerButton = quickInput.onDidTriggerButtonEmitter.event);
|
|
548
|
+
return quickInput;
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
QuickInputController.prototype.createQuickPick = polyfillQuickInput(QuickInputController.prototype.createQuickPick);
|
|
552
|
+
QuickInputController.prototype.createInputBox = polyfillQuickInput(QuickInputController.prototype.createInputBox);
|
|
553
|
+
const StandaloneUriLabelService = getSingletonServiceDescriptors().find(([id]) => id === ILabelService)[1].ctor;
|
|
554
|
+
(_e = StandaloneUriLabelService.prototype).onDidChangeFormatters ?? (_e.onDidChangeFormatters = Event.None);
|
|
555
|
+
function toVSCodeVSBuffer(value) {
|
|
556
|
+
if (value instanceof VSBuffer$1) {
|
|
557
|
+
return VSBuffer.wrap(value.buffer);
|
|
558
|
+
}
|
|
559
|
+
return value;
|
|
560
|
+
}
|
|
561
|
+
function toMonacoVSBuffer(value) {
|
|
562
|
+
if (value instanceof VSBuffer) {
|
|
563
|
+
return VSBuffer$1.wrap(value.buffer);
|
|
564
|
+
}
|
|
565
|
+
return value;
|
|
566
|
+
}
|
|
567
|
+
for (const key of Object.getOwnPropertyNames(VSBuffer)) {
|
|
568
|
+
if (!Object.hasOwnProperty.call(VSBuffer$1, key)) {
|
|
569
|
+
VSBuffer$1[key] = function (...args) {
|
|
570
|
+
return toMonacoVSBuffer(VSBuffer[key].call(VSBuffer$1, ...args.map(toVSCodeVSBuffer)));
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
for (const key of Object.getOwnPropertyNames(VSBuffer.prototype)) {
|
|
575
|
+
if (!Object.hasOwnProperty.call(VSBuffer$1.prototype, key)) {
|
|
576
|
+
VSBuffer$1.prototype[key] = function (...args) {
|
|
577
|
+
return toMonacoVSBuffer(VSBuffer.prototype[key].call(this, ...args.map(toVSCodeVSBuffer)));
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
const ILifecycleService = createDecorator('lifecycleService');
|
|
582
|
+
const ILanguageDetectionService = createDecorator('ILanguageDetectionService');
|
|
583
|
+
function unsupported() {
|
|
584
|
+
throw new Error('unsupported');
|
|
585
|
+
}
|
|
586
|
+
registerSingleton(IEditorService, class EditorService {
|
|
587
|
+
constructor() {
|
|
588
|
+
this._serviceBrand = undefined;
|
|
589
|
+
this.onDidActiveEditorChange = Event.None;
|
|
590
|
+
this.onDidVisibleEditorsChange = Event.None;
|
|
591
|
+
this.onDidEditorsChange = Event.None;
|
|
592
|
+
this.onDidCloseEditor = Event.None;
|
|
593
|
+
this.activeEditorPane = undefined;
|
|
594
|
+
this.activeEditor = undefined;
|
|
595
|
+
this.activeTextEditorControl = undefined;
|
|
596
|
+
this.activeTextEditorLanguageId = undefined;
|
|
597
|
+
this.visibleEditorPanes = [];
|
|
598
|
+
this.visibleEditors = [];
|
|
599
|
+
this.visibleTextEditorControls = [];
|
|
600
|
+
this.editors = [];
|
|
601
|
+
this.count = 0;
|
|
602
|
+
this.getEditors = () => [];
|
|
603
|
+
this.openEditor = unsupported;
|
|
604
|
+
this.openEditors = unsupported;
|
|
605
|
+
this.replaceEditors = async () => { };
|
|
606
|
+
this.isOpened = () => false;
|
|
607
|
+
this.isVisible = () => false;
|
|
608
|
+
this.closeEditor = async () => { };
|
|
609
|
+
this.closeEditors = async () => { };
|
|
610
|
+
this.findEditors = () => [];
|
|
611
|
+
this.save = async () => false;
|
|
612
|
+
this.saveAll = async () => false;
|
|
613
|
+
this.revert = async () => false;
|
|
614
|
+
this.revertAll = async () => false;
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
|
+
registerSingleton(IPaneCompositePartService, class PaneCompositePartService {
|
|
618
|
+
constructor() {
|
|
619
|
+
this._serviceBrand = undefined;
|
|
620
|
+
this.onDidPaneCompositeOpen = Event.None;
|
|
621
|
+
this.onDidPaneCompositeClose = Event.None;
|
|
622
|
+
this.openPaneComposite = unsupported;
|
|
623
|
+
this.getActivePaneComposite = () => undefined;
|
|
624
|
+
this.getPaneComposite = () => undefined;
|
|
625
|
+
this.getPaneComposites = () => [];
|
|
626
|
+
this.getPinnedPaneCompositeIds = () => [];
|
|
627
|
+
this.getVisiblePaneCompositeIds = () => [];
|
|
628
|
+
this.getProgressIndicator = () => undefined;
|
|
629
|
+
this.hideActivePaneComposite = () => { };
|
|
630
|
+
this.getLastActivePaneCompositeId = unsupported;
|
|
631
|
+
this.showActivity = unsupported;
|
|
632
|
+
}
|
|
633
|
+
});
|
|
634
|
+
registerSingleton(IUriIdentityService, class UriIdentityService {
|
|
635
|
+
constructor() {
|
|
636
|
+
this._serviceBrand = undefined;
|
|
637
|
+
this.extUri = new ExtUri(() => false);
|
|
638
|
+
}
|
|
639
|
+
asCanonicalUri(uri) {
|
|
640
|
+
return uri;
|
|
641
|
+
}
|
|
642
|
+
});
|
|
643
|
+
const onDidSave = new Emitter();
|
|
644
|
+
class TextFileEditorModelManager {
|
|
645
|
+
constructor() {
|
|
646
|
+
this.onDidCreate = Event.None;
|
|
647
|
+
this.onDidResolve = Event.None;
|
|
648
|
+
this.onDidChangeDirty = Event.None;
|
|
649
|
+
this.onDidChangeReadonly = Event.None;
|
|
650
|
+
this.onDidRemove = Event.None;
|
|
651
|
+
this.onDidChangeOrphaned = Event.None;
|
|
652
|
+
this.onDidChangeEncoding = Event.None;
|
|
653
|
+
this.onDidSaveError = Event.None;
|
|
654
|
+
this.onDidSave = onDidSave.event;
|
|
655
|
+
this.onDidRevert = Event.None;
|
|
656
|
+
this.models = [];
|
|
657
|
+
this.saveErrorHandler = {
|
|
658
|
+
onSaveError: unsupported
|
|
659
|
+
};
|
|
660
|
+
this.get = () => undefined;
|
|
661
|
+
this.resolve = unsupported;
|
|
662
|
+
this.addSaveParticipant = unsupported;
|
|
663
|
+
this.runSaveParticipants = unsupported;
|
|
664
|
+
}
|
|
665
|
+
canDispose() {
|
|
666
|
+
return true;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
registerSingleton(ITextFileService, class TextFileService {
|
|
670
|
+
constructor() {
|
|
671
|
+
this._serviceBrand = undefined;
|
|
672
|
+
this.files = new TextFileEditorModelManager();
|
|
673
|
+
this.isDirty = () => false;
|
|
674
|
+
this.save = unsupported;
|
|
675
|
+
this.saveAs = unsupported;
|
|
676
|
+
this.revert = unsupported;
|
|
677
|
+
this.read = unsupported;
|
|
678
|
+
this.readStream = unsupported;
|
|
679
|
+
this.write = unsupported;
|
|
680
|
+
this.create = unsupported;
|
|
681
|
+
this.getEncodedReadable = unsupported;
|
|
682
|
+
this.getDecodedStream = unsupported;
|
|
683
|
+
}
|
|
684
|
+
get untitled() { return unsupported(); }
|
|
685
|
+
get encoding() { return unsupported(); }
|
|
686
|
+
dispose() {
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
registerSingleton(IFileService, class FileService {
|
|
690
|
+
constructor() {
|
|
691
|
+
this._serviceBrand = undefined;
|
|
692
|
+
this.onDidChangeFileSystemProviderRegistrations = Event.None;
|
|
693
|
+
this.onDidChangeFileSystemProviderCapabilities = Event.None;
|
|
694
|
+
this.onWillActivateFileSystemProvider = Event.None;
|
|
695
|
+
this.registerProvider = unsupported;
|
|
696
|
+
this.getProvider = function () {
|
|
697
|
+
return undefined;
|
|
698
|
+
};
|
|
699
|
+
this.activateProvider = async () => { };
|
|
700
|
+
this.canHandleResource = async () => false;
|
|
701
|
+
this.hasProvider = () => false;
|
|
702
|
+
this.hasCapability = () => false;
|
|
703
|
+
this.listCapabilities = () => [];
|
|
704
|
+
this.onDidFilesChange = Event.None;
|
|
705
|
+
this.onDidRunOperation = Event.None;
|
|
706
|
+
this.resolve = unsupported;
|
|
707
|
+
this.resolveAll = unsupported;
|
|
708
|
+
this.stat = unsupported;
|
|
709
|
+
this.exists = async () => false;
|
|
710
|
+
this.readFile = unsupported;
|
|
711
|
+
this.readFileStream = unsupported;
|
|
712
|
+
this.writeFile = unsupported;
|
|
713
|
+
this.move = unsupported;
|
|
714
|
+
this.canMove = unsupported;
|
|
715
|
+
this.copy = unsupported;
|
|
716
|
+
this.canCopy = unsupported;
|
|
717
|
+
this.cloneFile = unsupported;
|
|
718
|
+
this.createFile = unsupported;
|
|
719
|
+
this.canCreateFile = unsupported;
|
|
720
|
+
this.createFolder = unsupported;
|
|
721
|
+
this.del = unsupported;
|
|
722
|
+
this.canDelete = unsupported;
|
|
723
|
+
this.onDidWatchError = Event.None;
|
|
724
|
+
this.watch = unsupported;
|
|
725
|
+
}
|
|
726
|
+
dispose() {
|
|
727
|
+
}
|
|
728
|
+
});
|
|
729
|
+
class EmptyEditorGroup {
|
|
730
|
+
constructor() {
|
|
731
|
+
this.onDidModelChange = Event.None;
|
|
732
|
+
this.onWillDispose = Event.None;
|
|
733
|
+
this.onDidActiveEditorChange = Event.None;
|
|
734
|
+
this.onWillCloseEditor = Event.None;
|
|
735
|
+
this.onDidCloseEditor = Event.None;
|
|
736
|
+
this.onWillMoveEditor = Event.None;
|
|
737
|
+
this.onWillOpenEditor = Event.None;
|
|
738
|
+
this.id = 0;
|
|
739
|
+
this.index = 0;
|
|
740
|
+
this.label = 'main';
|
|
741
|
+
this.ariaLabel = 'main';
|
|
742
|
+
this.activeEditorPane = undefined;
|
|
743
|
+
this.activeEditor = null;
|
|
744
|
+
this.previewEditor = null;
|
|
745
|
+
this.count = 0;
|
|
746
|
+
this.isEmpty = false;
|
|
747
|
+
this.isLocked = false;
|
|
748
|
+
this.stickyCount = 0;
|
|
749
|
+
this.editors = [];
|
|
750
|
+
this.getEditors = unsupported;
|
|
751
|
+
this.findEditors = unsupported;
|
|
752
|
+
this.getEditorByIndex = unsupported;
|
|
753
|
+
this.getIndexOfEditor = unsupported;
|
|
754
|
+
this.openEditor = unsupported;
|
|
755
|
+
this.openEditors = unsupported;
|
|
756
|
+
this.isPinned = unsupported;
|
|
757
|
+
this.isSticky = unsupported;
|
|
758
|
+
this.isActive = unsupported;
|
|
759
|
+
this.contains = unsupported;
|
|
760
|
+
this.moveEditor = unsupported;
|
|
761
|
+
this.moveEditors = unsupported;
|
|
762
|
+
this.copyEditor = unsupported;
|
|
763
|
+
this.copyEditors = unsupported;
|
|
764
|
+
this.closeEditor = unsupported;
|
|
765
|
+
this.closeEditors = unsupported;
|
|
766
|
+
this.closeAllEditors = unsupported;
|
|
767
|
+
this.replaceEditors = unsupported;
|
|
768
|
+
this.pinEditor = unsupported;
|
|
769
|
+
this.stickEditor = unsupported;
|
|
770
|
+
this.unstickEditor = unsupported;
|
|
771
|
+
this.lock = unsupported;
|
|
772
|
+
}
|
|
773
|
+
get scopedContextKeyService() { return unsupported(); }
|
|
774
|
+
focus() {
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
registerSingleton(IEditorGroupsService, class EditorGroupsService {
|
|
778
|
+
constructor() {
|
|
779
|
+
this._serviceBrand = undefined;
|
|
780
|
+
this.onDidChangeActiveGroup = Event.None;
|
|
781
|
+
this.onDidAddGroup = Event.None;
|
|
782
|
+
this.onDidRemoveGroup = Event.None;
|
|
783
|
+
this.onDidMoveGroup = Event.None;
|
|
784
|
+
this.onDidActivateGroup = Event.None;
|
|
785
|
+
this.onDidLayout = Event.None;
|
|
786
|
+
this.onDidScroll = Event.None;
|
|
787
|
+
this.onDidChangeGroupIndex = Event.None;
|
|
788
|
+
this.onDidChangeGroupLocked = Event.None;
|
|
789
|
+
this.activeGroup = new EmptyEditorGroup();
|
|
790
|
+
this.groups = [];
|
|
791
|
+
this.count = 0;
|
|
792
|
+
this.orientation = 0 ;
|
|
793
|
+
this.isReady = false;
|
|
794
|
+
this.whenReady = Promise.resolve();
|
|
795
|
+
this.whenRestored = Promise.resolve();
|
|
796
|
+
this.hasRestorableState = false;
|
|
797
|
+
this.getGroups = () => [];
|
|
798
|
+
this.getGroup = () => undefined;
|
|
799
|
+
this.activateGroup = unsupported;
|
|
800
|
+
this.getSize = unsupported;
|
|
801
|
+
this.setSize = unsupported;
|
|
802
|
+
this.arrangeGroups = unsupported;
|
|
803
|
+
this.applyLayout = unsupported;
|
|
804
|
+
this.centerLayout = unsupported;
|
|
805
|
+
this.isLayoutCentered = () => false;
|
|
806
|
+
this.setGroupOrientation = unsupported;
|
|
807
|
+
this.findGroup = () => undefined;
|
|
808
|
+
this.addGroup = unsupported;
|
|
809
|
+
this.removeGroup = unsupported;
|
|
810
|
+
this.moveGroup = unsupported;
|
|
811
|
+
this.mergeGroup = unsupported;
|
|
812
|
+
this.mergeAllGroups = unsupported;
|
|
813
|
+
this.copyGroup = unsupported;
|
|
814
|
+
this.onDidChangeEditorPartOptions = Event.None;
|
|
815
|
+
this.enforcePartOptions = unsupported;
|
|
816
|
+
}
|
|
817
|
+
get contentDimension() { return unsupported(); }
|
|
818
|
+
get sideGroup() { return unsupported(); }
|
|
819
|
+
get partOptions() { return unsupported(); }
|
|
820
|
+
});
|
|
821
|
+
registerSingleton(IWorkbenchEnvironmentService, class WorkbenchEnvironmentService {
|
|
822
|
+
constructor() {
|
|
823
|
+
this._serviceBrand = undefined;
|
|
824
|
+
this.skipReleaseNotes = true;
|
|
825
|
+
this.skipWelcome = true;
|
|
826
|
+
this.disableWorkspaceTrust = true;
|
|
827
|
+
this.debugRenderer = false;
|
|
828
|
+
this.sync = undefined;
|
|
829
|
+
this.isExtensionDevelopment = false;
|
|
830
|
+
this.disableExtensions = false;
|
|
831
|
+
this.logsPath = '';
|
|
832
|
+
this.verbose = false;
|
|
833
|
+
this.isBuilt = false;
|
|
834
|
+
this.disableTelemetry = false;
|
|
835
|
+
}
|
|
836
|
+
get logFile() { return unsupported(); }
|
|
837
|
+
get extHostLogsPath() { return unsupported(); }
|
|
838
|
+
get webviewExternalEndpoint() { return unsupported(); }
|
|
839
|
+
get userRoamingDataHome() { return unsupported(); }
|
|
840
|
+
get settingsResource() { return unsupported(); }
|
|
841
|
+
get keybindingsResource() { return unsupported(); }
|
|
842
|
+
get keyboardLayoutResource() { return unsupported(); }
|
|
843
|
+
get argvResource() { return unsupported(); }
|
|
844
|
+
get snippetsHome() { return unsupported(); }
|
|
845
|
+
get untitledWorkspacesHome() { return unsupported(); }
|
|
846
|
+
get globalStorageHome() { return unsupported(); }
|
|
847
|
+
get workspaceStorageHome() { return unsupported(); }
|
|
848
|
+
get localHistoryHome() { return unsupported(); }
|
|
849
|
+
get cacheHome() { return unsupported(); }
|
|
850
|
+
get userDataSyncHome() { return unsupported(); }
|
|
851
|
+
get userDataSyncLogResource() { return unsupported(); }
|
|
852
|
+
get debugExtensionHost() { return unsupported(); }
|
|
853
|
+
get telemetryLogResource() { return unsupported(); }
|
|
854
|
+
get serviceMachineIdResource() { return unsupported(); }
|
|
855
|
+
});
|
|
856
|
+
registerSingleton(IWorkingCopyFileService, class WorkingCopyFileService {
|
|
857
|
+
constructor() {
|
|
858
|
+
this._serviceBrand = undefined;
|
|
859
|
+
this.onWillRunWorkingCopyFileOperation = Event.None;
|
|
860
|
+
this.onDidFailWorkingCopyFileOperation = Event.None;
|
|
861
|
+
this.onDidRunWorkingCopyFileOperation = Event.None;
|
|
862
|
+
this.addFileOperationParticipant = unsupported;
|
|
863
|
+
this.hasSaveParticipants = false;
|
|
864
|
+
this.addSaveParticipant = unsupported;
|
|
865
|
+
this.runSaveParticipants = unsupported;
|
|
866
|
+
this.create = unsupported;
|
|
867
|
+
this.createFolder = unsupported;
|
|
868
|
+
this.move = unsupported;
|
|
869
|
+
this.copy = unsupported;
|
|
870
|
+
this.delete = unsupported;
|
|
871
|
+
this.registerWorkingCopyProvider = unsupported;
|
|
872
|
+
this.getDirty = unsupported;
|
|
873
|
+
}
|
|
874
|
+
});
|
|
875
|
+
registerSingleton(IPathService, class PathService {
|
|
876
|
+
constructor() {
|
|
877
|
+
this._serviceBrand = undefined;
|
|
878
|
+
this.defaultUriScheme = Schemas.file;
|
|
879
|
+
this.userHome = unsupported;
|
|
880
|
+
this.hasValidBasename = unsupported;
|
|
881
|
+
this.resolvedUserHome = undefined;
|
|
882
|
+
}
|
|
883
|
+
get path() { return unsupported(); }
|
|
884
|
+
async fileURI(path) {
|
|
885
|
+
return URI.file(path);
|
|
886
|
+
}
|
|
887
|
+
});
|
|
888
|
+
registerSingleton(IProgressService, class ProgressService {
|
|
889
|
+
constructor() {
|
|
890
|
+
this._serviceBrand = undefined;
|
|
891
|
+
}
|
|
892
|
+
withProgress(options, task, onDidCancel) {
|
|
893
|
+
const { window } = Services.get();
|
|
894
|
+
if (window?.withProgress != null) {
|
|
895
|
+
return window.withProgress(options, task, onDidCancel);
|
|
896
|
+
}
|
|
897
|
+
return task({ report: () => { } });
|
|
898
|
+
}
|
|
899
|
+
});
|
|
900
|
+
registerSingleton(IProductService, class ProductService {
|
|
901
|
+
constructor() {
|
|
902
|
+
this._serviceBrand = undefined;
|
|
903
|
+
this.version = "1.67.0";
|
|
904
|
+
this.nameShort = 'Code - OSS Dev';
|
|
905
|
+
this.nameLong = 'Code - OSS Dev';
|
|
906
|
+
this.applicationName = 'code-oss';
|
|
907
|
+
this.dataFolderName = '.vscode-oss';
|
|
908
|
+
this.urlProtocol = 'code-oss';
|
|
909
|
+
this.reportIssueUrl = 'https://github.com/microsoft/vscode/issues/new';
|
|
910
|
+
this.licenseName = 'MIT';
|
|
911
|
+
this.licenseUrl = 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt';
|
|
912
|
+
this.serverApplicationName = 'code-server-oss';
|
|
913
|
+
}
|
|
914
|
+
});
|
|
915
|
+
registerSingleton(ILanguageStatusService, class LanguageStatusServiceImpl {
|
|
916
|
+
constructor() {
|
|
917
|
+
this._provider = new LanguageFeatureRegistry();
|
|
918
|
+
this.onDidChange = this._provider.onDidChange;
|
|
919
|
+
}
|
|
920
|
+
addStatus(status) {
|
|
921
|
+
return this._provider.register(status.selector, status);
|
|
922
|
+
}
|
|
923
|
+
getLanguageStatus(model) {
|
|
924
|
+
return this._provider.ordered(model).sort((a, b) => {
|
|
925
|
+
let res = b.severity - a.severity;
|
|
926
|
+
if (res === 0) {
|
|
927
|
+
res = compare(a.source, b.source);
|
|
928
|
+
}
|
|
929
|
+
if (res === 0) {
|
|
930
|
+
res = compare(a.id, b.id);
|
|
931
|
+
}
|
|
932
|
+
return res;
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
});
|
|
936
|
+
const focusTracker = trackFocus(window);
|
|
937
|
+
const onVisibilityChange = new DomEmitter(window.document, 'visibilitychange');
|
|
938
|
+
const onDidChangeFocus = Event.latch(Event.any(Event.map(focusTracker.onDidFocus, () => document.hasFocus()), Event.map(focusTracker.onDidBlur, () => document.hasFocus()), Event.map(onVisibilityChange.event, () => document.hasFocus())));
|
|
939
|
+
registerSingleton(IHostService, class HostService {
|
|
940
|
+
constructor() {
|
|
941
|
+
this.onDidChangeFocus = onDidChangeFocus;
|
|
942
|
+
this.openWindow = unsupported;
|
|
943
|
+
this.restart = unsupported;
|
|
944
|
+
this.reload = unsupported;
|
|
945
|
+
this.close = unsupported;
|
|
946
|
+
}
|
|
947
|
+
get hasFocus() {
|
|
948
|
+
return document.hasFocus();
|
|
949
|
+
}
|
|
950
|
+
async hadLastFocus() {
|
|
951
|
+
return true;
|
|
952
|
+
}
|
|
953
|
+
async focus() {
|
|
954
|
+
window.focus();
|
|
955
|
+
}
|
|
956
|
+
async toggleFullScreen() {
|
|
957
|
+
if (document.fullscreenEnabled) {
|
|
958
|
+
await document.body.requestFullscreen();
|
|
959
|
+
}
|
|
960
|
+
else {
|
|
961
|
+
await document.exitFullscreen();
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
});
|
|
965
|
+
registerSingleton(ILifecycleService, class LifecycleService {
|
|
966
|
+
constructor() {
|
|
967
|
+
this.startupKind = 1 ;
|
|
968
|
+
this.phase = 2 ;
|
|
969
|
+
this.onBeforeShutdown = Event.None;
|
|
970
|
+
this.onShutdownVeto = Event.None;
|
|
971
|
+
this.onBeforeShutdownError = Event.None;
|
|
972
|
+
this.onWillShutdown = Event.None;
|
|
973
|
+
this.onDidShutdown = Event.None;
|
|
974
|
+
this.shutdown = unsupported;
|
|
975
|
+
}
|
|
976
|
+
async when() {
|
|
977
|
+
}
|
|
978
|
+
});
|
|
979
|
+
registerSingleton(ILanguageDetectionService, class LanguageDetectionService {
|
|
980
|
+
isEnabledForLanguage() {
|
|
981
|
+
return false;
|
|
982
|
+
}
|
|
983
|
+
async detectLanguage() {
|
|
984
|
+
return undefined;
|
|
985
|
+
}
|
|
986
|
+
});
|
|
987
|
+
export { Emitter as E, ILifecycleService as I, NotificationsFilter as N, assertAllDefined as a, NeverShowAgainScope as b, ILanguageDetectionService as c, isStringArray as i, unsupported as u, withUndefinedAsNull as w };
|