@codingame/monaco-vscode-api 1.67.17 → 1.67.20
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 +15 -2
- package/dist/api.js +3 -3
- package/dist/{async-c7fd4178.js → async-088c7d8b.js} +1 -1
- package/dist/configuration.d.ts +248 -2
- package/dist/configuration.js +24 -931
- package/dist/messages.js +8 -7
- package/dist/missing-services-9c48c894.js +3177 -0
- package/dist/modelEditor.js +6 -5
- package/dist/{services-9299c4ca.js → services-a8445f52.js} +20 -1
- package/dist/services.js +1 -1
- package/package.json +1 -1
- package/dist/missing-services-597951f0.js +0 -1285
|
@@ -1,1285 +0,0 @@
|
|
|
1
|
-
import { VSBuffer as VSBuffer$1 } from 'monaco-editor/esm/vs/base/common/buffer.js';
|
|
2
|
-
import { toDisposable, DisposableStore, Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
-
import { onUnexpectedError } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
4
|
-
import { Themable as Themable$1 } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
5
|
-
import { ProgressBar as ProgressBar$1 } from 'monaco-editor/esm/vs/base/browser/ui/progressbar/progressbar.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 { Color } from 'monaco-editor/esm/vs/base/common/color.js';
|
|
11
|
-
import { LanguageService as LanguageService$1 } from 'monaco-editor/esm/vs/editor/common/services/languageService.js';
|
|
12
|
-
import { LanguagesRegistry } from 'monaco-editor/esm/vs/editor/common/services/languagesRegistry.js';
|
|
13
|
-
import { firstOrDefault } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
14
|
-
import { PLAINTEXT_LANGUAGE_ID } from 'monaco-editor/esm/vs/editor/common/languages/modesRegistry.js';
|
|
15
|
-
import { TokenizationRegistry } from 'monaco-editor/esm/vs/editor/common/languages.js';
|
|
16
|
-
import { NoOpNotification } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
|
|
17
|
-
import { N as NoOpNotification$1, k as IEditorService, n as IPaneCompositePartService, g as IUriIdentityService, b as ITextFileService, e as IFileService, l as IEditorGroupsService, f as IWorkbenchEnvironmentService, h as IWorkingCopyFileService, i as IPathService, I as IProgressService, s as Services, o as IProductService, p as ILanguageStatusService, q as IHostService } from './services-9299c4ca.js';
|
|
18
|
-
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
19
|
-
import { Extensions } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
|
|
20
|
-
import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
21
|
-
import { QuickInputController } from 'monaco-editor/esm/vs/base/parts/quickinput/browser/quickInput.js';
|
|
22
|
-
import { getSingletonServiceDescriptors, registerSingleton } from 'monaco-editor/esm/vs/platform/instantiation/common/extensions.js';
|
|
23
|
-
import { ILabelService } from 'monaco-editor/esm/vs/platform/label/common/label.js';
|
|
24
|
-
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js';
|
|
25
|
-
import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
26
|
-
import { ExtUri } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
27
|
-
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
28
|
-
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
29
|
-
import { LanguageFeatureRegistry } from 'monaco-editor/esm/vs/editor/common/languageFeatureRegistry.js';
|
|
30
|
-
import { compare } from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
31
|
-
import { DomEmitter } from 'monaco-editor/esm/vs/base/browser/event.js';
|
|
32
|
-
function isReadableStream(obj) {
|
|
33
|
-
const candidate = obj;
|
|
34
|
-
if (!candidate) {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
return [candidate.on, candidate.pause, candidate.resume, candidate.destroy].every(fn => typeof fn === 'function');
|
|
38
|
-
}
|
|
39
|
-
function isReadableBufferedStream(obj) {
|
|
40
|
-
const candidate = obj;
|
|
41
|
-
if (!candidate) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
return isReadableStream(candidate.stream) && Array.isArray(candidate.buffer) && typeof candidate.ended === 'boolean';
|
|
45
|
-
}
|
|
46
|
-
function newWriteableStream(reducer, options) {
|
|
47
|
-
return (
|
|
48
|
-
new WriteableStreamImpl(reducer, options)
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
class WriteableStreamImpl {
|
|
52
|
-
constructor(reducer, options) {
|
|
53
|
-
this.reducer = reducer;
|
|
54
|
-
this.options = options;
|
|
55
|
-
this.state = {
|
|
56
|
-
flowing: false,
|
|
57
|
-
ended: false,
|
|
58
|
-
destroyed: false
|
|
59
|
-
};
|
|
60
|
-
this.buffer = {
|
|
61
|
-
data: [],
|
|
62
|
-
error: []
|
|
63
|
-
};
|
|
64
|
-
this.listeners = {
|
|
65
|
-
data: [],
|
|
66
|
-
error: [],
|
|
67
|
-
end: []
|
|
68
|
-
};
|
|
69
|
-
this.pendingWritePromises = [];
|
|
70
|
-
}
|
|
71
|
-
pause() {
|
|
72
|
-
if (this.state.destroyed) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
this.state.flowing = false;
|
|
76
|
-
}
|
|
77
|
-
resume() {
|
|
78
|
-
if (this.state.destroyed) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
if (!this.state.flowing) {
|
|
82
|
-
this.state.flowing = true;
|
|
83
|
-
this.flowData();
|
|
84
|
-
this.flowErrors();
|
|
85
|
-
this.flowEnd();
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
write(data) {
|
|
89
|
-
if (this.state.destroyed) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
if (this.state.flowing) {
|
|
93
|
-
this.emitData(data);
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
this.buffer.data.push(data);
|
|
97
|
-
if (typeof this.options?.highWaterMark === 'number' && this.buffer.data.length > this.options.highWaterMark) {
|
|
98
|
-
return (
|
|
99
|
-
new Promise(resolve => this.pendingWritePromises.push(resolve))
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
error(error) {
|
|
105
|
-
if (this.state.destroyed) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
if (this.state.flowing) {
|
|
109
|
-
this.emitError(error);
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
this.buffer.error.push(error);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
end(result) {
|
|
116
|
-
if (this.state.destroyed) {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
if (typeof result !== 'undefined') {
|
|
120
|
-
this.write(result);
|
|
121
|
-
}
|
|
122
|
-
if (this.state.flowing) {
|
|
123
|
-
this.emitEnd();
|
|
124
|
-
this.destroy();
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
this.state.ended = true;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
emitData(data) {
|
|
131
|
-
this.listeners.data.slice(0).forEach(listener => listener(data));
|
|
132
|
-
}
|
|
133
|
-
emitError(error) {
|
|
134
|
-
if (this.listeners.error.length === 0) {
|
|
135
|
-
onUnexpectedError(error);
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
this.listeners.error.slice(0).forEach(listener => listener(error));
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
emitEnd() {
|
|
142
|
-
this.listeners.end.slice(0).forEach(listener => listener());
|
|
143
|
-
}
|
|
144
|
-
on(event, callback) {
|
|
145
|
-
if (this.state.destroyed) {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
switch (event) {
|
|
149
|
-
case 'data':
|
|
150
|
-
this.listeners.data.push(callback);
|
|
151
|
-
this.resume();
|
|
152
|
-
break;
|
|
153
|
-
case 'end':
|
|
154
|
-
this.listeners.end.push(callback);
|
|
155
|
-
if (this.state.flowing && this.flowEnd()) {
|
|
156
|
-
this.destroy();
|
|
157
|
-
}
|
|
158
|
-
break;
|
|
159
|
-
case 'error':
|
|
160
|
-
this.listeners.error.push(callback);
|
|
161
|
-
if (this.state.flowing) {
|
|
162
|
-
this.flowErrors();
|
|
163
|
-
}
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
removeListener(event, callback) {
|
|
168
|
-
if (this.state.destroyed) {
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
let listeners = undefined;
|
|
172
|
-
switch (event) {
|
|
173
|
-
case 'data':
|
|
174
|
-
listeners = this.listeners.data;
|
|
175
|
-
break;
|
|
176
|
-
case 'end':
|
|
177
|
-
listeners = this.listeners.end;
|
|
178
|
-
break;
|
|
179
|
-
case 'error':
|
|
180
|
-
listeners = this.listeners.error;
|
|
181
|
-
break;
|
|
182
|
-
}
|
|
183
|
-
if (listeners) {
|
|
184
|
-
const index = listeners.indexOf(callback);
|
|
185
|
-
if (index >= 0) {
|
|
186
|
-
listeners.splice(index, 1);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
flowData() {
|
|
191
|
-
if (this.buffer.data.length > 0) {
|
|
192
|
-
const fullDataBuffer = this.reducer(this.buffer.data);
|
|
193
|
-
this.emitData(fullDataBuffer);
|
|
194
|
-
this.buffer.data.length = 0;
|
|
195
|
-
const pendingWritePromises = [...this.pendingWritePromises];
|
|
196
|
-
this.pendingWritePromises.length = 0;
|
|
197
|
-
pendingWritePromises.forEach(pendingWritePromise => pendingWritePromise());
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
flowErrors() {
|
|
201
|
-
if (this.listeners.error.length > 0) {
|
|
202
|
-
for (const error of this.buffer.error) {
|
|
203
|
-
this.emitError(error);
|
|
204
|
-
}
|
|
205
|
-
this.buffer.error.length = 0;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
flowEnd() {
|
|
209
|
-
if (this.state.ended) {
|
|
210
|
-
this.emitEnd();
|
|
211
|
-
return this.listeners.end.length > 0;
|
|
212
|
-
}
|
|
213
|
-
return false;
|
|
214
|
-
}
|
|
215
|
-
destroy() {
|
|
216
|
-
if (!this.state.destroyed) {
|
|
217
|
-
this.state.destroyed = true;
|
|
218
|
-
this.state.ended = true;
|
|
219
|
-
this.buffer.data.length = 0;
|
|
220
|
-
this.buffer.error.length = 0;
|
|
221
|
-
this.listeners.data.length = 0;
|
|
222
|
-
this.listeners.error.length = 0;
|
|
223
|
-
this.listeners.end.length = 0;
|
|
224
|
-
this.pendingWritePromises.length = 0;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
function consumeReadable(readable, reducer) {
|
|
229
|
-
const chunks = [];
|
|
230
|
-
let chunk;
|
|
231
|
-
while ((chunk = readable.read()) !== null) {
|
|
232
|
-
chunks.push(chunk);
|
|
233
|
-
}
|
|
234
|
-
return reducer(chunks);
|
|
235
|
-
}
|
|
236
|
-
function peekReadable(readable, reducer, maxChunks) {
|
|
237
|
-
const chunks = [];
|
|
238
|
-
let chunk = undefined;
|
|
239
|
-
while ((chunk = readable.read()) !== null && chunks.length < maxChunks) {
|
|
240
|
-
chunks.push(chunk);
|
|
241
|
-
}
|
|
242
|
-
if (chunk === null && chunks.length > 0) {
|
|
243
|
-
return reducer(chunks);
|
|
244
|
-
}
|
|
245
|
-
return {
|
|
246
|
-
read: () => {
|
|
247
|
-
if (chunks.length > 0) {
|
|
248
|
-
return chunks.shift();
|
|
249
|
-
}
|
|
250
|
-
if (typeof chunk !== 'undefined') {
|
|
251
|
-
const lastReadChunk = chunk;
|
|
252
|
-
chunk = undefined;
|
|
253
|
-
return lastReadChunk;
|
|
254
|
-
}
|
|
255
|
-
return readable.read();
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
function consumeStream(stream, reducer) {
|
|
260
|
-
return (
|
|
261
|
-
new Promise((resolve, reject) => {
|
|
262
|
-
const chunks = [];
|
|
263
|
-
listenStream(stream, {
|
|
264
|
-
onData: chunk => {
|
|
265
|
-
if (reducer) {
|
|
266
|
-
chunks.push(chunk);
|
|
267
|
-
}
|
|
268
|
-
},
|
|
269
|
-
onError: error => {
|
|
270
|
-
if (reducer) {
|
|
271
|
-
reject(error);
|
|
272
|
-
}
|
|
273
|
-
else {
|
|
274
|
-
resolve(undefined);
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
onEnd: () => {
|
|
278
|
-
if (reducer) {
|
|
279
|
-
resolve(reducer(chunks));
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
resolve(undefined);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
})
|
|
287
|
-
);
|
|
288
|
-
}
|
|
289
|
-
function listenStream(stream, listener) {
|
|
290
|
-
let destroyed = false;
|
|
291
|
-
stream.on('error', error => {
|
|
292
|
-
if (!destroyed) {
|
|
293
|
-
listener.onError(error);
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
stream.on('end', () => {
|
|
297
|
-
if (!destroyed) {
|
|
298
|
-
listener.onEnd();
|
|
299
|
-
}
|
|
300
|
-
});
|
|
301
|
-
stream.on('data', data => {
|
|
302
|
-
if (!destroyed) {
|
|
303
|
-
listener.onData(data);
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
return toDisposable(() => destroyed = true);
|
|
307
|
-
}
|
|
308
|
-
function peekStream(stream, maxChunks) {
|
|
309
|
-
return (
|
|
310
|
-
new Promise((resolve, reject) => {
|
|
311
|
-
const streamListeners = new DisposableStore();
|
|
312
|
-
const buffer = [];
|
|
313
|
-
const dataListener = (chunk) => {
|
|
314
|
-
buffer.push(chunk);
|
|
315
|
-
if (buffer.length > maxChunks) {
|
|
316
|
-
streamListeners.dispose();
|
|
317
|
-
stream.pause();
|
|
318
|
-
return resolve({ stream, buffer, ended: false });
|
|
319
|
-
}
|
|
320
|
-
};
|
|
321
|
-
const errorListener = (error) => {
|
|
322
|
-
return reject(error);
|
|
323
|
-
};
|
|
324
|
-
const endListener = () => {
|
|
325
|
-
return resolve({ stream, buffer, ended: true });
|
|
326
|
-
};
|
|
327
|
-
streamListeners.add(toDisposable(() => stream.removeListener('error', errorListener)));
|
|
328
|
-
stream.on('error', errorListener);
|
|
329
|
-
streamListeners.add(toDisposable(() => stream.removeListener('end', endListener)));
|
|
330
|
-
stream.on('end', endListener);
|
|
331
|
-
streamListeners.add(toDisposable(() => stream.removeListener('data', dataListener)));
|
|
332
|
-
stream.on('data', dataListener);
|
|
333
|
-
})
|
|
334
|
-
);
|
|
335
|
-
}
|
|
336
|
-
function toReadable(t) {
|
|
337
|
-
let consumed = false;
|
|
338
|
-
return {
|
|
339
|
-
read: () => {
|
|
340
|
-
if (consumed) {
|
|
341
|
-
return null;
|
|
342
|
-
}
|
|
343
|
-
consumed = true;
|
|
344
|
-
return t;
|
|
345
|
-
}
|
|
346
|
-
};
|
|
347
|
-
}
|
|
348
|
-
function transform(stream, transformer, reducer) {
|
|
349
|
-
const target = newWriteableStream(reducer);
|
|
350
|
-
listenStream(stream, {
|
|
351
|
-
onData: data => target.write(transformer.data(data)),
|
|
352
|
-
onError: error => target.error(transformer.error ? transformer.error(error) : error),
|
|
353
|
-
onEnd: () => target.end()
|
|
354
|
-
});
|
|
355
|
-
return target;
|
|
356
|
-
}
|
|
357
|
-
const hasBuffer = (typeof Buffer !== 'undefined');
|
|
358
|
-
let textEncoder;
|
|
359
|
-
let textDecoder;
|
|
360
|
-
class VSBuffer {
|
|
361
|
-
constructor(buffer) {
|
|
362
|
-
this.buffer = buffer;
|
|
363
|
-
this.byteLength = this.buffer.byteLength;
|
|
364
|
-
}
|
|
365
|
-
static alloc(byteLength) {
|
|
366
|
-
if (hasBuffer) {
|
|
367
|
-
return (
|
|
368
|
-
new VSBuffer(Buffer.allocUnsafe(byteLength))
|
|
369
|
-
);
|
|
370
|
-
}
|
|
371
|
-
else {
|
|
372
|
-
return (
|
|
373
|
-
new VSBuffer( new Uint8Array(byteLength))
|
|
374
|
-
);
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
static wrap(actual) {
|
|
378
|
-
if (hasBuffer && !(Buffer.isBuffer(actual))) {
|
|
379
|
-
actual = Buffer.from(actual.buffer, actual.byteOffset, actual.byteLength);
|
|
380
|
-
}
|
|
381
|
-
return (
|
|
382
|
-
new VSBuffer(actual)
|
|
383
|
-
);
|
|
384
|
-
}
|
|
385
|
-
static fromString(source, options) {
|
|
386
|
-
const dontUseNodeBuffer = options?.dontUseNodeBuffer || false;
|
|
387
|
-
if (!dontUseNodeBuffer && hasBuffer) {
|
|
388
|
-
return (
|
|
389
|
-
new VSBuffer(Buffer.from(source))
|
|
390
|
-
);
|
|
391
|
-
}
|
|
392
|
-
else {
|
|
393
|
-
if (!textEncoder) {
|
|
394
|
-
textEncoder = new TextEncoder();
|
|
395
|
-
}
|
|
396
|
-
return (
|
|
397
|
-
new VSBuffer(textEncoder.encode(source))
|
|
398
|
-
);
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
static fromByteArray(source) {
|
|
402
|
-
const result = VSBuffer.alloc(source.length);
|
|
403
|
-
for (let i = 0, len = source.length; i < len; i++) {
|
|
404
|
-
result.buffer[i] = source[i];
|
|
405
|
-
}
|
|
406
|
-
return result;
|
|
407
|
-
}
|
|
408
|
-
static concat(buffers, totalLength) {
|
|
409
|
-
if (typeof totalLength === 'undefined') {
|
|
410
|
-
totalLength = 0;
|
|
411
|
-
for (let i = 0, len = buffers.length; i < len; i++) {
|
|
412
|
-
totalLength += buffers[i].byteLength;
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
const ret = VSBuffer.alloc(totalLength);
|
|
416
|
-
let offset = 0;
|
|
417
|
-
for (let i = 0, len = buffers.length; i < len; i++) {
|
|
418
|
-
const element = buffers[i];
|
|
419
|
-
ret.set(element, offset);
|
|
420
|
-
offset += element.byteLength;
|
|
421
|
-
}
|
|
422
|
-
return ret;
|
|
423
|
-
}
|
|
424
|
-
clone() {
|
|
425
|
-
const result = VSBuffer.alloc(this.byteLength);
|
|
426
|
-
result.set(this);
|
|
427
|
-
return result;
|
|
428
|
-
}
|
|
429
|
-
toString() {
|
|
430
|
-
if (hasBuffer) {
|
|
431
|
-
return this.buffer.toString();
|
|
432
|
-
}
|
|
433
|
-
else {
|
|
434
|
-
if (!textDecoder) {
|
|
435
|
-
textDecoder = new TextDecoder();
|
|
436
|
-
}
|
|
437
|
-
return textDecoder.decode(this.buffer);
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
slice(start, end) {
|
|
441
|
-
return (
|
|
442
|
-
new VSBuffer(this.buffer.subarray(start, end))
|
|
443
|
-
);
|
|
444
|
-
}
|
|
445
|
-
set(array, offset) {
|
|
446
|
-
if (array instanceof VSBuffer) {
|
|
447
|
-
this.buffer.set(array.buffer, offset);
|
|
448
|
-
}
|
|
449
|
-
else if (array instanceof Uint8Array) {
|
|
450
|
-
this.buffer.set(array, offset);
|
|
451
|
-
}
|
|
452
|
-
else if (array instanceof ArrayBuffer) {
|
|
453
|
-
this.buffer.set( new Uint8Array(array), offset);
|
|
454
|
-
}
|
|
455
|
-
else if (ArrayBuffer.isView(array)) {
|
|
456
|
-
this.buffer.set( new Uint8Array(array.buffer, array.byteOffset, array.byteLength), offset);
|
|
457
|
-
}
|
|
458
|
-
else {
|
|
459
|
-
throw new Error(`Unknown argument 'array'`);
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
readUInt32BE(offset) {
|
|
463
|
-
return readUInt32BE(this.buffer, offset);
|
|
464
|
-
}
|
|
465
|
-
writeUInt32BE(value, offset) {
|
|
466
|
-
writeUInt32BE(this.buffer, value, offset);
|
|
467
|
-
}
|
|
468
|
-
readUInt32LE(offset) {
|
|
469
|
-
return readUInt32LE(this.buffer, offset);
|
|
470
|
-
}
|
|
471
|
-
writeUInt32LE(value, offset) {
|
|
472
|
-
writeUInt32LE(this.buffer, value, offset);
|
|
473
|
-
}
|
|
474
|
-
readUInt8(offset) {
|
|
475
|
-
return readUInt8(this.buffer, offset);
|
|
476
|
-
}
|
|
477
|
-
writeUInt8(value, offset) {
|
|
478
|
-
writeUInt8(this.buffer, value, offset);
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
function readUInt32BE(source, offset) {
|
|
482
|
-
return (source[offset] * 2 ** 24
|
|
483
|
-
+ source[offset + 1] * 2 ** 16
|
|
484
|
-
+ source[offset + 2] * 2 ** 8
|
|
485
|
-
+ source[offset + 3]);
|
|
486
|
-
}
|
|
487
|
-
function writeUInt32BE(destination, value, offset) {
|
|
488
|
-
destination[offset + 3] = value;
|
|
489
|
-
value = value >>> 8;
|
|
490
|
-
destination[offset + 2] = value;
|
|
491
|
-
value = value >>> 8;
|
|
492
|
-
destination[offset + 1] = value;
|
|
493
|
-
value = value >>> 8;
|
|
494
|
-
destination[offset] = value;
|
|
495
|
-
}
|
|
496
|
-
function readUInt32LE(source, offset) {
|
|
497
|
-
return (((source[offset + 0] << 0) >>> 0) |
|
|
498
|
-
((source[offset + 1] << 8) >>> 0) |
|
|
499
|
-
((source[offset + 2] << 16) >>> 0) |
|
|
500
|
-
((source[offset + 3] << 24) >>> 0));
|
|
501
|
-
}
|
|
502
|
-
function writeUInt32LE(destination, value, offset) {
|
|
503
|
-
destination[offset + 0] = (value & 0b11111111);
|
|
504
|
-
value = value >>> 8;
|
|
505
|
-
destination[offset + 1] = (value & 0b11111111);
|
|
506
|
-
value = value >>> 8;
|
|
507
|
-
destination[offset + 2] = (value & 0b11111111);
|
|
508
|
-
value = value >>> 8;
|
|
509
|
-
destination[offset + 3] = (value & 0b11111111);
|
|
510
|
-
}
|
|
511
|
-
function readUInt8(source, offset) {
|
|
512
|
-
return source[offset];
|
|
513
|
-
}
|
|
514
|
-
function writeUInt8(destination, value, offset) {
|
|
515
|
-
destination[offset] = value;
|
|
516
|
-
}
|
|
517
|
-
function readableToBuffer(readable) {
|
|
518
|
-
return consumeReadable(readable, chunks => VSBuffer.concat(chunks));
|
|
519
|
-
}
|
|
520
|
-
function bufferToReadable(buffer) {
|
|
521
|
-
return toReadable(buffer);
|
|
522
|
-
}
|
|
523
|
-
function streamToBuffer(stream) {
|
|
524
|
-
return consumeStream(stream, chunks => VSBuffer.concat(chunks));
|
|
525
|
-
}
|
|
526
|
-
async function bufferedStreamToBuffer(bufferedStream) {
|
|
527
|
-
if (bufferedStream.ended) {
|
|
528
|
-
return VSBuffer.concat(bufferedStream.buffer);
|
|
529
|
-
}
|
|
530
|
-
return VSBuffer.concat([
|
|
531
|
-
...bufferedStream.buffer,
|
|
532
|
-
await streamToBuffer(bufferedStream.stream)
|
|
533
|
-
]);
|
|
534
|
-
}
|
|
535
|
-
function newWriteableBufferStream(options) {
|
|
536
|
-
return newWriteableStream(chunks => VSBuffer.concat(chunks), options);
|
|
537
|
-
}
|
|
538
|
-
const Emitter = monaco.Emitter;
|
|
539
|
-
class Themable extends Disposable {
|
|
540
|
-
constructor(themeService) {
|
|
541
|
-
super();
|
|
542
|
-
this.themeService = themeService;
|
|
543
|
-
this.theme = themeService.getColorTheme();
|
|
544
|
-
this._register(this.themeService.onDidColorThemeChange(theme => this.onThemeChange(theme)));
|
|
545
|
-
}
|
|
546
|
-
onThemeChange(theme) {
|
|
547
|
-
this.theme = theme;
|
|
548
|
-
this.updateStyles();
|
|
549
|
-
}
|
|
550
|
-
updateStyles() {
|
|
551
|
-
}
|
|
552
|
-
getColor(id, modify) {
|
|
553
|
-
let color = this.theme.getColor(id);
|
|
554
|
-
if (color && modify) {
|
|
555
|
-
color = modify(color, this.theme);
|
|
556
|
-
}
|
|
557
|
-
return color ? color.toString() : null;
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
const CSS_DONE = 'done';
|
|
561
|
-
const CSS_ACTIVE = 'active';
|
|
562
|
-
const CSS_INFINITE = 'infinite';
|
|
563
|
-
const CSS_INFINITE_LONG_RUNNING = 'infinite-long-running';
|
|
564
|
-
const CSS_DISCRETE = 'discrete';
|
|
565
|
-
const defaultOpts = {
|
|
566
|
-
progressBarBackground: Color.fromHex('#0E70C0')
|
|
567
|
-
};
|
|
568
|
-
class ProgressBar extends Disposable {
|
|
569
|
-
constructor(container, options) {
|
|
570
|
-
super();
|
|
571
|
-
this.options = options || Object.create(null);
|
|
572
|
-
mixin(this.options, defaultOpts, false);
|
|
573
|
-
this.workedVal = 0;
|
|
574
|
-
this.progressBarBackground = this.options.progressBarBackground;
|
|
575
|
-
this.showDelayedScheduler = this._register( new RunOnceScheduler(() => show(this.element), 0));
|
|
576
|
-
this.longRunningScheduler = this._register( new RunOnceScheduler(
|
|
577
|
-
() => this.infiniteLongRunning(),
|
|
578
|
-
ProgressBar.LONG_RUNNING_INFINITE_THRESHOLD
|
|
579
|
-
));
|
|
580
|
-
this.create(container);
|
|
581
|
-
}
|
|
582
|
-
create(container) {
|
|
583
|
-
this.element = document.createElement('div');
|
|
584
|
-
this.element.classList.add('monaco-progress-container');
|
|
585
|
-
this.element.setAttribute('role', 'progressbar');
|
|
586
|
-
this.element.setAttribute('aria-valuemin', '0');
|
|
587
|
-
container.appendChild(this.element);
|
|
588
|
-
this.bit = document.createElement('div');
|
|
589
|
-
this.bit.classList.add('progress-bit');
|
|
590
|
-
this.element.appendChild(this.bit);
|
|
591
|
-
this.applyStyles();
|
|
592
|
-
}
|
|
593
|
-
off() {
|
|
594
|
-
this.bit.style.width = 'inherit';
|
|
595
|
-
this.bit.style.opacity = '1';
|
|
596
|
-
this.element.classList.remove(CSS_ACTIVE, CSS_INFINITE, CSS_INFINITE_LONG_RUNNING, CSS_DISCRETE);
|
|
597
|
-
this.workedVal = 0;
|
|
598
|
-
this.totalWork = undefined;
|
|
599
|
-
this.longRunningScheduler.cancel();
|
|
600
|
-
}
|
|
601
|
-
done() {
|
|
602
|
-
return this.doDone(true);
|
|
603
|
-
}
|
|
604
|
-
stop() {
|
|
605
|
-
return this.doDone(false);
|
|
606
|
-
}
|
|
607
|
-
doDone(delayed) {
|
|
608
|
-
this.element.classList.add(CSS_DONE);
|
|
609
|
-
if (!this.element.classList.contains(CSS_INFINITE)) {
|
|
610
|
-
this.bit.style.width = 'inherit';
|
|
611
|
-
if (delayed) {
|
|
612
|
-
setTimeout(() => this.off(), 200);
|
|
613
|
-
}
|
|
614
|
-
else {
|
|
615
|
-
this.off();
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
else {
|
|
619
|
-
this.bit.style.opacity = '0';
|
|
620
|
-
if (delayed) {
|
|
621
|
-
setTimeout(() => this.off(), 200);
|
|
622
|
-
}
|
|
623
|
-
else {
|
|
624
|
-
this.off();
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
return this;
|
|
628
|
-
}
|
|
629
|
-
infinite() {
|
|
630
|
-
this.bit.style.width = '2%';
|
|
631
|
-
this.bit.style.opacity = '1';
|
|
632
|
-
this.element.classList.remove(CSS_DISCRETE, CSS_DONE, CSS_INFINITE_LONG_RUNNING);
|
|
633
|
-
this.element.classList.add(CSS_ACTIVE, CSS_INFINITE);
|
|
634
|
-
this.longRunningScheduler.schedule();
|
|
635
|
-
return this;
|
|
636
|
-
}
|
|
637
|
-
infiniteLongRunning() {
|
|
638
|
-
this.element.classList.add(CSS_INFINITE_LONG_RUNNING);
|
|
639
|
-
}
|
|
640
|
-
total(value) {
|
|
641
|
-
this.workedVal = 0;
|
|
642
|
-
this.totalWork = value;
|
|
643
|
-
this.element.setAttribute('aria-valuemax', value.toString());
|
|
644
|
-
return this;
|
|
645
|
-
}
|
|
646
|
-
hasTotal() {
|
|
647
|
-
return isNumber(this.totalWork);
|
|
648
|
-
}
|
|
649
|
-
worked(value) {
|
|
650
|
-
value = Math.max(1, Number(value));
|
|
651
|
-
return this.doSetWorked(this.workedVal + value);
|
|
652
|
-
}
|
|
653
|
-
setWorked(value) {
|
|
654
|
-
value = Math.max(1, Number(value));
|
|
655
|
-
return this.doSetWorked(value);
|
|
656
|
-
}
|
|
657
|
-
doSetWorked(value) {
|
|
658
|
-
const totalWork = this.totalWork || 100;
|
|
659
|
-
this.workedVal = value;
|
|
660
|
-
this.workedVal = Math.min(totalWork, this.workedVal);
|
|
661
|
-
this.element.classList.remove(CSS_INFINITE, CSS_INFINITE_LONG_RUNNING, CSS_DONE);
|
|
662
|
-
this.element.classList.add(CSS_ACTIVE, CSS_DISCRETE);
|
|
663
|
-
this.element.setAttribute('aria-valuenow', value.toString());
|
|
664
|
-
this.bit.style.width = 100 * (this.workedVal / (totalWork)) + '%';
|
|
665
|
-
return this;
|
|
666
|
-
}
|
|
667
|
-
getContainer() {
|
|
668
|
-
return this.element;
|
|
669
|
-
}
|
|
670
|
-
show(delay) {
|
|
671
|
-
this.showDelayedScheduler.cancel();
|
|
672
|
-
if (typeof delay === 'number') {
|
|
673
|
-
this.showDelayedScheduler.schedule(delay);
|
|
674
|
-
}
|
|
675
|
-
else {
|
|
676
|
-
show(this.element);
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
hide() {
|
|
680
|
-
hide(this.element);
|
|
681
|
-
this.showDelayedScheduler.cancel();
|
|
682
|
-
}
|
|
683
|
-
style(styles) {
|
|
684
|
-
this.progressBarBackground = styles.progressBarBackground;
|
|
685
|
-
this.applyStyles();
|
|
686
|
-
}
|
|
687
|
-
applyStyles() {
|
|
688
|
-
if (this.bit) {
|
|
689
|
-
const background = this.progressBarBackground ? this.progressBarBackground.toString() : '';
|
|
690
|
-
this.bit.style.backgroundColor = background;
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
ProgressBar.LONG_RUNNING_INFINITE_THRESHOLD = 10000;
|
|
695
|
-
class LanguageService extends Disposable {
|
|
696
|
-
constructor(warnOnOverwrite = false) {
|
|
697
|
-
super();
|
|
698
|
-
this._onDidEncounterLanguage = this._register( new Emitter());
|
|
699
|
-
this.onDidEncounterLanguage = this._onDidEncounterLanguage.event;
|
|
700
|
-
this._onDidChange = this._register( new Emitter(
|
|
701
|
-
{ leakWarningThreshold: 200 }
|
|
702
|
-
));
|
|
703
|
-
this.onDidChange = this._onDidChange.event;
|
|
704
|
-
LanguageService.instanceCount++;
|
|
705
|
-
this._encounteredLanguages = new Set();
|
|
706
|
-
this._registry = this._register( new LanguagesRegistry(true, warnOnOverwrite));
|
|
707
|
-
this.languageIdCodec = this._registry.languageIdCodec;
|
|
708
|
-
this._register(this._registry.onDidChange(() => this._onDidChange.fire()));
|
|
709
|
-
}
|
|
710
|
-
dispose() {
|
|
711
|
-
LanguageService.instanceCount--;
|
|
712
|
-
super.dispose();
|
|
713
|
-
}
|
|
714
|
-
isRegisteredLanguageId(languageId) {
|
|
715
|
-
return this._registry.isRegisteredLanguageId(languageId);
|
|
716
|
-
}
|
|
717
|
-
getRegisteredLanguageIds() {
|
|
718
|
-
return this._registry.getRegisteredLanguageIds();
|
|
719
|
-
}
|
|
720
|
-
getSortedRegisteredLanguageNames() {
|
|
721
|
-
return this._registry.getSortedRegisteredLanguageNames();
|
|
722
|
-
}
|
|
723
|
-
getLanguageName(languageId) {
|
|
724
|
-
return this._registry.getLanguageName(languageId);
|
|
725
|
-
}
|
|
726
|
-
getMimeType(languageId) {
|
|
727
|
-
return this._registry.getMimeType(languageId);
|
|
728
|
-
}
|
|
729
|
-
getIcon(languageId) {
|
|
730
|
-
return this._registry.getIcon(languageId);
|
|
731
|
-
}
|
|
732
|
-
getExtensions(languageId) {
|
|
733
|
-
return this._registry.getExtensions(languageId);
|
|
734
|
-
}
|
|
735
|
-
getFilenames(languageId) {
|
|
736
|
-
return this._registry.getFilenames(languageId);
|
|
737
|
-
}
|
|
738
|
-
getConfigurationFiles(languageId) {
|
|
739
|
-
return this._registry.getConfigurationFiles(languageId);
|
|
740
|
-
}
|
|
741
|
-
getLanguageIdByLanguageName(languageName) {
|
|
742
|
-
return this._registry.getLanguageIdByLanguageName(languageName);
|
|
743
|
-
}
|
|
744
|
-
getLanguageIdByMimeType(mimeType) {
|
|
745
|
-
return this._registry.getLanguageIdByMimeType(mimeType);
|
|
746
|
-
}
|
|
747
|
-
guessLanguageIdByFilepathOrFirstLine(resource, firstLine) {
|
|
748
|
-
const languageIds = this._registry.guessLanguageIdByFilepathOrFirstLine(resource, firstLine);
|
|
749
|
-
return firstOrDefault(languageIds, null);
|
|
750
|
-
}
|
|
751
|
-
createById(languageId) {
|
|
752
|
-
return (
|
|
753
|
-
new LanguageSelection(this.onDidChange, () => {
|
|
754
|
-
return this._createAndGetLanguageIdentifier(languageId);
|
|
755
|
-
})
|
|
756
|
-
);
|
|
757
|
-
}
|
|
758
|
-
createByMimeType(mimeType) {
|
|
759
|
-
return (
|
|
760
|
-
new LanguageSelection(this.onDidChange, () => {
|
|
761
|
-
const languageId = this.getLanguageIdByMimeType(mimeType);
|
|
762
|
-
return this._createAndGetLanguageIdentifier(languageId);
|
|
763
|
-
})
|
|
764
|
-
);
|
|
765
|
-
}
|
|
766
|
-
createByFilepathOrFirstLine(resource, firstLine) {
|
|
767
|
-
return (
|
|
768
|
-
new LanguageSelection(this.onDidChange, () => {
|
|
769
|
-
const languageId = this.guessLanguageIdByFilepathOrFirstLine(resource, firstLine);
|
|
770
|
-
return this._createAndGetLanguageIdentifier(languageId);
|
|
771
|
-
})
|
|
772
|
-
);
|
|
773
|
-
}
|
|
774
|
-
_createAndGetLanguageIdentifier(languageId) {
|
|
775
|
-
if (!languageId || !this.isRegisteredLanguageId(languageId)) {
|
|
776
|
-
languageId = PLAINTEXT_LANGUAGE_ID;
|
|
777
|
-
}
|
|
778
|
-
if (!this._encounteredLanguages.has(languageId)) {
|
|
779
|
-
this._encounteredLanguages.add(languageId);
|
|
780
|
-
TokenizationRegistry.getOrCreate(languageId);
|
|
781
|
-
this._onDidEncounterLanguage.fire(languageId);
|
|
782
|
-
}
|
|
783
|
-
return languageId;
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
LanguageService.instanceCount = 0;
|
|
787
|
-
class LanguageSelection {
|
|
788
|
-
constructor(_onDidChangeLanguages, _selector) {
|
|
789
|
-
this._onDidChangeLanguages = _onDidChangeLanguages;
|
|
790
|
-
this._selector = _selector;
|
|
791
|
-
this._listener = null;
|
|
792
|
-
this._emitter = null;
|
|
793
|
-
this.languageId = this._selector();
|
|
794
|
-
}
|
|
795
|
-
_dispose() {
|
|
796
|
-
if (this._listener) {
|
|
797
|
-
this._listener.dispose();
|
|
798
|
-
this._listener = null;
|
|
799
|
-
}
|
|
800
|
-
if (this._emitter) {
|
|
801
|
-
this._emitter.dispose();
|
|
802
|
-
this._emitter = null;
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
get onDidChange() {
|
|
806
|
-
if (!this._listener) {
|
|
807
|
-
this._listener = this._onDidChangeLanguages(() => this._evaluate());
|
|
808
|
-
}
|
|
809
|
-
if (!this._emitter) {
|
|
810
|
-
this._emitter = new Emitter({
|
|
811
|
-
onLastListenerRemove: () => {
|
|
812
|
-
this._dispose();
|
|
813
|
-
}
|
|
814
|
-
});
|
|
815
|
-
}
|
|
816
|
-
return this._emitter.event;
|
|
817
|
-
}
|
|
818
|
-
_evaluate() {
|
|
819
|
-
const languageId = this._selector();
|
|
820
|
-
if (languageId === this.languageId) {
|
|
821
|
-
return;
|
|
822
|
-
}
|
|
823
|
-
this.languageId = languageId;
|
|
824
|
-
if (this._emitter) {
|
|
825
|
-
this._emitter.fire(this.languageId);
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
}
|
|
829
|
-
var _a, _b, _c, _d, _e;
|
|
830
|
-
const configurationRegistry = Registry.as(Extensions.Configuration);
|
|
831
|
-
configurationRegistry.onDidUpdateConfiguration ?? (configurationRegistry.onDidUpdateConfiguration = configurationRegistry._onDidUpdateConfiguration.event);
|
|
832
|
-
(_a = NoOpNotification.prototype).onDidClose ?? (_a.onDidClose = Event.None);
|
|
833
|
-
for (const key of Object.getOwnPropertyNames(NoOpNotification$1.prototype)) {
|
|
834
|
-
if (!Object.hasOwnProperty.call(NoOpNotification.prototype, key)) {
|
|
835
|
-
NoOpNotification.prototype[key] = NoOpNotification$1.prototype[key];
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
(_b = LanguageService$1.prototype).getRegisteredLanguageIds ?? (_b.getRegisteredLanguageIds = LanguageService.prototype.getRegisteredLanguageIds);
|
|
839
|
-
(_c = ProgressBar$1.prototype).hide ?? (_c.hide = ProgressBar.prototype.hide);
|
|
840
|
-
(_d = Themable$1.prototype)['getColor'] ?? (_d['getColor'] = Themable.prototype['getColor']);
|
|
841
|
-
function polyfillQuickInput(fn) {
|
|
842
|
-
return function () {
|
|
843
|
-
const quickInput = fn.call(this);
|
|
844
|
-
quickInput.onDidTriggerButton ?? (quickInput.onDidTriggerButton = quickInput.onDidTriggerButtonEmitter.event);
|
|
845
|
-
return quickInput;
|
|
846
|
-
};
|
|
847
|
-
}
|
|
848
|
-
QuickInputController.prototype.createQuickPick = polyfillQuickInput(QuickInputController.prototype.createQuickPick);
|
|
849
|
-
QuickInputController.prototype.createInputBox = polyfillQuickInput(QuickInputController.prototype.createInputBox);
|
|
850
|
-
const StandaloneUriLabelService = getSingletonServiceDescriptors().find(([id]) => id === ILabelService)[1].ctor;
|
|
851
|
-
(_e = StandaloneUriLabelService.prototype).onDidChangeFormatters ?? (_e.onDidChangeFormatters = Event.None);
|
|
852
|
-
function toVSCodeVSBuffer(value) {
|
|
853
|
-
if (value instanceof VSBuffer$1) {
|
|
854
|
-
return VSBuffer.wrap(value.buffer);
|
|
855
|
-
}
|
|
856
|
-
return value;
|
|
857
|
-
}
|
|
858
|
-
function toMonacoVSBuffer(value) {
|
|
859
|
-
if (value instanceof VSBuffer) {
|
|
860
|
-
return VSBuffer$1.wrap(value.buffer);
|
|
861
|
-
}
|
|
862
|
-
return value;
|
|
863
|
-
}
|
|
864
|
-
for (const key of Object.getOwnPropertyNames(VSBuffer)) {
|
|
865
|
-
if (!Object.hasOwnProperty.call(VSBuffer$1, key)) {
|
|
866
|
-
const method = VSBuffer[key];
|
|
867
|
-
VSBuffer[key] = VSBuffer$1[key] = function (...args) {
|
|
868
|
-
return toMonacoVSBuffer(method.call(VSBuffer$1, ...args.map(toVSCodeVSBuffer)));
|
|
869
|
-
};
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
for (const key of Object.getOwnPropertyNames(VSBuffer.prototype)) {
|
|
873
|
-
if (!Object.hasOwnProperty.call(VSBuffer$1.prototype, key)) {
|
|
874
|
-
VSBuffer$1.prototype[key] = function (...args) {
|
|
875
|
-
return toMonacoVSBuffer(VSBuffer.prototype[key].call(this, ...args.map(toVSCodeVSBuffer)));
|
|
876
|
-
};
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
const ILifecycleService = createDecorator('lifecycleService');
|
|
880
|
-
const ILanguageDetectionService = createDecorator('ILanguageDetectionService');
|
|
881
|
-
function unsupported() {
|
|
882
|
-
throw new Error('unsupported');
|
|
883
|
-
}
|
|
884
|
-
registerSingleton(IEditorService, class EditorService {
|
|
885
|
-
constructor() {
|
|
886
|
-
this._serviceBrand = undefined;
|
|
887
|
-
this.onDidActiveEditorChange = Event.None;
|
|
888
|
-
this.onDidVisibleEditorsChange = Event.None;
|
|
889
|
-
this.onDidEditorsChange = Event.None;
|
|
890
|
-
this.onDidCloseEditor = Event.None;
|
|
891
|
-
this.activeEditorPane = undefined;
|
|
892
|
-
this.activeEditor = undefined;
|
|
893
|
-
this.activeTextEditorControl = undefined;
|
|
894
|
-
this.activeTextEditorLanguageId = undefined;
|
|
895
|
-
this.visibleEditorPanes = [];
|
|
896
|
-
this.visibleEditors = [];
|
|
897
|
-
this.visibleTextEditorControls = [];
|
|
898
|
-
this.editors = [];
|
|
899
|
-
this.count = 0;
|
|
900
|
-
this.getEditors = () => [];
|
|
901
|
-
this.openEditor = unsupported;
|
|
902
|
-
this.openEditors = unsupported;
|
|
903
|
-
this.replaceEditors = async () => { };
|
|
904
|
-
this.isOpened = () => false;
|
|
905
|
-
this.isVisible = () => false;
|
|
906
|
-
this.closeEditor = async () => { };
|
|
907
|
-
this.closeEditors = async () => { };
|
|
908
|
-
this.findEditors = () => [];
|
|
909
|
-
this.save = async () => false;
|
|
910
|
-
this.saveAll = async () => false;
|
|
911
|
-
this.revert = async () => false;
|
|
912
|
-
this.revertAll = async () => false;
|
|
913
|
-
}
|
|
914
|
-
});
|
|
915
|
-
registerSingleton(IPaneCompositePartService, class PaneCompositePartService {
|
|
916
|
-
constructor() {
|
|
917
|
-
this._serviceBrand = undefined;
|
|
918
|
-
this.onDidPaneCompositeOpen = Event.None;
|
|
919
|
-
this.onDidPaneCompositeClose = Event.None;
|
|
920
|
-
this.openPaneComposite = unsupported;
|
|
921
|
-
this.getActivePaneComposite = () => undefined;
|
|
922
|
-
this.getPaneComposite = () => undefined;
|
|
923
|
-
this.getPaneComposites = () => [];
|
|
924
|
-
this.getPinnedPaneCompositeIds = () => [];
|
|
925
|
-
this.getVisiblePaneCompositeIds = () => [];
|
|
926
|
-
this.getProgressIndicator = () => undefined;
|
|
927
|
-
this.hideActivePaneComposite = () => { };
|
|
928
|
-
this.getLastActivePaneCompositeId = unsupported;
|
|
929
|
-
this.showActivity = unsupported;
|
|
930
|
-
}
|
|
931
|
-
});
|
|
932
|
-
registerSingleton(IUriIdentityService, class UriIdentityService {
|
|
933
|
-
constructor() {
|
|
934
|
-
this._serviceBrand = undefined;
|
|
935
|
-
this.extUri = new ExtUri(() => false);
|
|
936
|
-
}
|
|
937
|
-
asCanonicalUri(uri) {
|
|
938
|
-
return uri;
|
|
939
|
-
}
|
|
940
|
-
});
|
|
941
|
-
const onDidSave = new Emitter();
|
|
942
|
-
class TextFileEditorModelManager {
|
|
943
|
-
constructor() {
|
|
944
|
-
this.onDidCreate = Event.None;
|
|
945
|
-
this.onDidResolve = Event.None;
|
|
946
|
-
this.onDidChangeDirty = Event.None;
|
|
947
|
-
this.onDidChangeReadonly = Event.None;
|
|
948
|
-
this.onDidRemove = Event.None;
|
|
949
|
-
this.onDidChangeOrphaned = Event.None;
|
|
950
|
-
this.onDidChangeEncoding = Event.None;
|
|
951
|
-
this.onDidSaveError = Event.None;
|
|
952
|
-
this.onDidSave = onDidSave.event;
|
|
953
|
-
this.onDidRevert = Event.None;
|
|
954
|
-
this.models = [];
|
|
955
|
-
this.saveErrorHandler = {
|
|
956
|
-
onSaveError: unsupported
|
|
957
|
-
};
|
|
958
|
-
this.get = () => undefined;
|
|
959
|
-
this.resolve = unsupported;
|
|
960
|
-
this.addSaveParticipant = unsupported;
|
|
961
|
-
this.runSaveParticipants = unsupported;
|
|
962
|
-
}
|
|
963
|
-
canDispose() {
|
|
964
|
-
return true;
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
registerSingleton(ITextFileService, class TextFileService {
|
|
968
|
-
constructor() {
|
|
969
|
-
this._serviceBrand = undefined;
|
|
970
|
-
this.files = new TextFileEditorModelManager();
|
|
971
|
-
this.isDirty = () => false;
|
|
972
|
-
this.save = unsupported;
|
|
973
|
-
this.saveAs = unsupported;
|
|
974
|
-
this.revert = unsupported;
|
|
975
|
-
this.read = unsupported;
|
|
976
|
-
this.readStream = unsupported;
|
|
977
|
-
this.write = unsupported;
|
|
978
|
-
this.create = unsupported;
|
|
979
|
-
this.getEncodedReadable = unsupported;
|
|
980
|
-
this.getDecodedStream = unsupported;
|
|
981
|
-
}
|
|
982
|
-
get untitled() { return unsupported(); }
|
|
983
|
-
get encoding() { return unsupported(); }
|
|
984
|
-
dispose() {
|
|
985
|
-
}
|
|
986
|
-
});
|
|
987
|
-
registerSingleton(IFileService, class FileService {
|
|
988
|
-
constructor() {
|
|
989
|
-
this._serviceBrand = undefined;
|
|
990
|
-
this.onDidChangeFileSystemProviderRegistrations = Event.None;
|
|
991
|
-
this.onDidChangeFileSystemProviderCapabilities = Event.None;
|
|
992
|
-
this.onWillActivateFileSystemProvider = Event.None;
|
|
993
|
-
this.registerProvider = unsupported;
|
|
994
|
-
this.getProvider = function () {
|
|
995
|
-
return undefined;
|
|
996
|
-
};
|
|
997
|
-
this.activateProvider = async () => { };
|
|
998
|
-
this.canHandleResource = async () => false;
|
|
999
|
-
this.hasProvider = () => false;
|
|
1000
|
-
this.hasCapability = () => false;
|
|
1001
|
-
this.listCapabilities = () => [];
|
|
1002
|
-
this.onDidFilesChange = Event.None;
|
|
1003
|
-
this.onDidRunOperation = Event.None;
|
|
1004
|
-
this.resolve = unsupported;
|
|
1005
|
-
this.resolveAll = unsupported;
|
|
1006
|
-
this.stat = unsupported;
|
|
1007
|
-
this.exists = async () => false;
|
|
1008
|
-
this.readFile = unsupported;
|
|
1009
|
-
this.readFileStream = unsupported;
|
|
1010
|
-
this.writeFile = unsupported;
|
|
1011
|
-
this.move = unsupported;
|
|
1012
|
-
this.canMove = unsupported;
|
|
1013
|
-
this.copy = unsupported;
|
|
1014
|
-
this.canCopy = unsupported;
|
|
1015
|
-
this.cloneFile = unsupported;
|
|
1016
|
-
this.createFile = unsupported;
|
|
1017
|
-
this.canCreateFile = unsupported;
|
|
1018
|
-
this.createFolder = unsupported;
|
|
1019
|
-
this.del = unsupported;
|
|
1020
|
-
this.canDelete = unsupported;
|
|
1021
|
-
this.onDidWatchError = Event.None;
|
|
1022
|
-
this.watch = unsupported;
|
|
1023
|
-
}
|
|
1024
|
-
dispose() {
|
|
1025
|
-
}
|
|
1026
|
-
});
|
|
1027
|
-
class EmptyEditorGroup {
|
|
1028
|
-
constructor() {
|
|
1029
|
-
this.onDidModelChange = Event.None;
|
|
1030
|
-
this.onWillDispose = Event.None;
|
|
1031
|
-
this.onDidActiveEditorChange = Event.None;
|
|
1032
|
-
this.onWillCloseEditor = Event.None;
|
|
1033
|
-
this.onDidCloseEditor = Event.None;
|
|
1034
|
-
this.onWillMoveEditor = Event.None;
|
|
1035
|
-
this.onWillOpenEditor = Event.None;
|
|
1036
|
-
this.id = 0;
|
|
1037
|
-
this.index = 0;
|
|
1038
|
-
this.label = 'main';
|
|
1039
|
-
this.ariaLabel = 'main';
|
|
1040
|
-
this.activeEditorPane = undefined;
|
|
1041
|
-
this.activeEditor = null;
|
|
1042
|
-
this.previewEditor = null;
|
|
1043
|
-
this.count = 0;
|
|
1044
|
-
this.isEmpty = false;
|
|
1045
|
-
this.isLocked = false;
|
|
1046
|
-
this.stickyCount = 0;
|
|
1047
|
-
this.editors = [];
|
|
1048
|
-
this.getEditors = unsupported;
|
|
1049
|
-
this.findEditors = unsupported;
|
|
1050
|
-
this.getEditorByIndex = unsupported;
|
|
1051
|
-
this.getIndexOfEditor = unsupported;
|
|
1052
|
-
this.openEditor = unsupported;
|
|
1053
|
-
this.openEditors = unsupported;
|
|
1054
|
-
this.isPinned = unsupported;
|
|
1055
|
-
this.isSticky = unsupported;
|
|
1056
|
-
this.isActive = unsupported;
|
|
1057
|
-
this.contains = unsupported;
|
|
1058
|
-
this.moveEditor = unsupported;
|
|
1059
|
-
this.moveEditors = unsupported;
|
|
1060
|
-
this.copyEditor = unsupported;
|
|
1061
|
-
this.copyEditors = unsupported;
|
|
1062
|
-
this.closeEditor = unsupported;
|
|
1063
|
-
this.closeEditors = unsupported;
|
|
1064
|
-
this.closeAllEditors = unsupported;
|
|
1065
|
-
this.replaceEditors = unsupported;
|
|
1066
|
-
this.pinEditor = unsupported;
|
|
1067
|
-
this.stickEditor = unsupported;
|
|
1068
|
-
this.unstickEditor = unsupported;
|
|
1069
|
-
this.lock = unsupported;
|
|
1070
|
-
}
|
|
1071
|
-
get scopedContextKeyService() { return unsupported(); }
|
|
1072
|
-
focus() {
|
|
1073
|
-
}
|
|
1074
|
-
}
|
|
1075
|
-
registerSingleton(IEditorGroupsService, class EditorGroupsService {
|
|
1076
|
-
constructor() {
|
|
1077
|
-
this._serviceBrand = undefined;
|
|
1078
|
-
this.onDidChangeActiveGroup = Event.None;
|
|
1079
|
-
this.onDidAddGroup = Event.None;
|
|
1080
|
-
this.onDidRemoveGroup = Event.None;
|
|
1081
|
-
this.onDidMoveGroup = Event.None;
|
|
1082
|
-
this.onDidActivateGroup = Event.None;
|
|
1083
|
-
this.onDidLayout = Event.None;
|
|
1084
|
-
this.onDidScroll = Event.None;
|
|
1085
|
-
this.onDidChangeGroupIndex = Event.None;
|
|
1086
|
-
this.onDidChangeGroupLocked = Event.None;
|
|
1087
|
-
this.activeGroup = new EmptyEditorGroup();
|
|
1088
|
-
this.groups = [];
|
|
1089
|
-
this.count = 0;
|
|
1090
|
-
this.orientation = 0 ;
|
|
1091
|
-
this.isReady = false;
|
|
1092
|
-
this.whenReady = Promise.resolve();
|
|
1093
|
-
this.whenRestored = Promise.resolve();
|
|
1094
|
-
this.hasRestorableState = false;
|
|
1095
|
-
this.getGroups = () => [];
|
|
1096
|
-
this.getGroup = () => undefined;
|
|
1097
|
-
this.activateGroup = unsupported;
|
|
1098
|
-
this.getSize = unsupported;
|
|
1099
|
-
this.setSize = unsupported;
|
|
1100
|
-
this.arrangeGroups = unsupported;
|
|
1101
|
-
this.applyLayout = unsupported;
|
|
1102
|
-
this.centerLayout = unsupported;
|
|
1103
|
-
this.isLayoutCentered = () => false;
|
|
1104
|
-
this.setGroupOrientation = unsupported;
|
|
1105
|
-
this.findGroup = () => undefined;
|
|
1106
|
-
this.addGroup = unsupported;
|
|
1107
|
-
this.removeGroup = unsupported;
|
|
1108
|
-
this.moveGroup = unsupported;
|
|
1109
|
-
this.mergeGroup = unsupported;
|
|
1110
|
-
this.mergeAllGroups = unsupported;
|
|
1111
|
-
this.copyGroup = unsupported;
|
|
1112
|
-
this.onDidChangeEditorPartOptions = Event.None;
|
|
1113
|
-
this.enforcePartOptions = unsupported;
|
|
1114
|
-
}
|
|
1115
|
-
get contentDimension() { return unsupported(); }
|
|
1116
|
-
get sideGroup() { return unsupported(); }
|
|
1117
|
-
get partOptions() { return unsupported(); }
|
|
1118
|
-
});
|
|
1119
|
-
registerSingleton(IWorkbenchEnvironmentService, class WorkbenchEnvironmentService {
|
|
1120
|
-
constructor() {
|
|
1121
|
-
this._serviceBrand = undefined;
|
|
1122
|
-
this.skipReleaseNotes = true;
|
|
1123
|
-
this.skipWelcome = true;
|
|
1124
|
-
this.disableWorkspaceTrust = true;
|
|
1125
|
-
this.debugRenderer = false;
|
|
1126
|
-
this.sync = undefined;
|
|
1127
|
-
this.isExtensionDevelopment = false;
|
|
1128
|
-
this.disableExtensions = false;
|
|
1129
|
-
this.logsPath = '';
|
|
1130
|
-
this.verbose = false;
|
|
1131
|
-
this.isBuilt = false;
|
|
1132
|
-
this.disableTelemetry = false;
|
|
1133
|
-
}
|
|
1134
|
-
get logFile() { return unsupported(); }
|
|
1135
|
-
get extHostLogsPath() { return unsupported(); }
|
|
1136
|
-
get webviewExternalEndpoint() { return unsupported(); }
|
|
1137
|
-
get userRoamingDataHome() { return unsupported(); }
|
|
1138
|
-
get settingsResource() { return unsupported(); }
|
|
1139
|
-
get keybindingsResource() { return unsupported(); }
|
|
1140
|
-
get keyboardLayoutResource() { return unsupported(); }
|
|
1141
|
-
get argvResource() { return unsupported(); }
|
|
1142
|
-
get snippetsHome() { return unsupported(); }
|
|
1143
|
-
get untitledWorkspacesHome() { return unsupported(); }
|
|
1144
|
-
get globalStorageHome() { return unsupported(); }
|
|
1145
|
-
get workspaceStorageHome() { return unsupported(); }
|
|
1146
|
-
get localHistoryHome() { return unsupported(); }
|
|
1147
|
-
get cacheHome() { return unsupported(); }
|
|
1148
|
-
get userDataSyncHome() { return unsupported(); }
|
|
1149
|
-
get userDataSyncLogResource() { return unsupported(); }
|
|
1150
|
-
get debugExtensionHost() { return unsupported(); }
|
|
1151
|
-
get telemetryLogResource() { return unsupported(); }
|
|
1152
|
-
get serviceMachineIdResource() { return unsupported(); }
|
|
1153
|
-
});
|
|
1154
|
-
registerSingleton(IWorkingCopyFileService, class WorkingCopyFileService {
|
|
1155
|
-
constructor() {
|
|
1156
|
-
this._serviceBrand = undefined;
|
|
1157
|
-
this.onWillRunWorkingCopyFileOperation = Event.None;
|
|
1158
|
-
this.onDidFailWorkingCopyFileOperation = Event.None;
|
|
1159
|
-
this.onDidRunWorkingCopyFileOperation = Event.None;
|
|
1160
|
-
this.addFileOperationParticipant = unsupported;
|
|
1161
|
-
this.hasSaveParticipants = false;
|
|
1162
|
-
this.addSaveParticipant = unsupported;
|
|
1163
|
-
this.runSaveParticipants = unsupported;
|
|
1164
|
-
this.create = unsupported;
|
|
1165
|
-
this.createFolder = unsupported;
|
|
1166
|
-
this.move = unsupported;
|
|
1167
|
-
this.copy = unsupported;
|
|
1168
|
-
this.delete = unsupported;
|
|
1169
|
-
this.registerWorkingCopyProvider = unsupported;
|
|
1170
|
-
this.getDirty = unsupported;
|
|
1171
|
-
}
|
|
1172
|
-
});
|
|
1173
|
-
registerSingleton(IPathService, class PathService {
|
|
1174
|
-
constructor() {
|
|
1175
|
-
this._serviceBrand = undefined;
|
|
1176
|
-
this.defaultUriScheme = Schemas.file;
|
|
1177
|
-
this.userHome = unsupported;
|
|
1178
|
-
this.hasValidBasename = unsupported;
|
|
1179
|
-
this.resolvedUserHome = undefined;
|
|
1180
|
-
}
|
|
1181
|
-
get path() { return unsupported(); }
|
|
1182
|
-
async fileURI(path) {
|
|
1183
|
-
return URI.file(path);
|
|
1184
|
-
}
|
|
1185
|
-
});
|
|
1186
|
-
registerSingleton(IProgressService, class ProgressService {
|
|
1187
|
-
constructor() {
|
|
1188
|
-
this._serviceBrand = undefined;
|
|
1189
|
-
}
|
|
1190
|
-
withProgress(options, task, onDidCancel) {
|
|
1191
|
-
const { window } = Services.get();
|
|
1192
|
-
if (window?.withProgress != null) {
|
|
1193
|
-
return window.withProgress(options, task, onDidCancel);
|
|
1194
|
-
}
|
|
1195
|
-
return task({ report: () => { } });
|
|
1196
|
-
}
|
|
1197
|
-
});
|
|
1198
|
-
registerSingleton(IProductService, class ProductService {
|
|
1199
|
-
constructor() {
|
|
1200
|
-
this._serviceBrand = undefined;
|
|
1201
|
-
this.version = "1.67.0";
|
|
1202
|
-
this.nameShort = 'Code - OSS Dev';
|
|
1203
|
-
this.nameLong = 'Code - OSS Dev';
|
|
1204
|
-
this.applicationName = 'code-oss';
|
|
1205
|
-
this.dataFolderName = '.vscode-oss';
|
|
1206
|
-
this.urlProtocol = 'code-oss';
|
|
1207
|
-
this.reportIssueUrl = 'https://github.com/microsoft/vscode/issues/new';
|
|
1208
|
-
this.licenseName = 'MIT';
|
|
1209
|
-
this.licenseUrl = 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt';
|
|
1210
|
-
this.serverApplicationName = 'code-server-oss';
|
|
1211
|
-
}
|
|
1212
|
-
});
|
|
1213
|
-
registerSingleton(ILanguageStatusService, class LanguageStatusServiceImpl {
|
|
1214
|
-
constructor() {
|
|
1215
|
-
this._provider = new LanguageFeatureRegistry();
|
|
1216
|
-
this.onDidChange = this._provider.onDidChange;
|
|
1217
|
-
}
|
|
1218
|
-
addStatus(status) {
|
|
1219
|
-
return this._provider.register(status.selector, status);
|
|
1220
|
-
}
|
|
1221
|
-
getLanguageStatus(model) {
|
|
1222
|
-
return this._provider.ordered(model).sort((a, b) => {
|
|
1223
|
-
let res = b.severity - a.severity;
|
|
1224
|
-
if (res === 0) {
|
|
1225
|
-
res = compare(a.source, b.source);
|
|
1226
|
-
}
|
|
1227
|
-
if (res === 0) {
|
|
1228
|
-
res = compare(a.id, b.id);
|
|
1229
|
-
}
|
|
1230
|
-
return res;
|
|
1231
|
-
});
|
|
1232
|
-
}
|
|
1233
|
-
});
|
|
1234
|
-
const focusTracker = trackFocus(window);
|
|
1235
|
-
const onVisibilityChange = new DomEmitter(window.document, 'visibilitychange');
|
|
1236
|
-
const onDidChangeFocus = Event.latch(Event.any(Event.map(focusTracker.onDidFocus, () => document.hasFocus()), Event.map(focusTracker.onDidBlur, () => document.hasFocus()), Event.map(onVisibilityChange.event, () => document.hasFocus())));
|
|
1237
|
-
registerSingleton(IHostService, class HostService {
|
|
1238
|
-
constructor() {
|
|
1239
|
-
this.onDidChangeFocus = onDidChangeFocus;
|
|
1240
|
-
this.openWindow = unsupported;
|
|
1241
|
-
this.restart = unsupported;
|
|
1242
|
-
this.reload = unsupported;
|
|
1243
|
-
this.close = unsupported;
|
|
1244
|
-
}
|
|
1245
|
-
get hasFocus() {
|
|
1246
|
-
return document.hasFocus();
|
|
1247
|
-
}
|
|
1248
|
-
async hadLastFocus() {
|
|
1249
|
-
return true;
|
|
1250
|
-
}
|
|
1251
|
-
async focus() {
|
|
1252
|
-
window.focus();
|
|
1253
|
-
}
|
|
1254
|
-
async toggleFullScreen() {
|
|
1255
|
-
if (document.fullscreenEnabled) {
|
|
1256
|
-
await document.body.requestFullscreen();
|
|
1257
|
-
}
|
|
1258
|
-
else {
|
|
1259
|
-
await document.exitFullscreen();
|
|
1260
|
-
}
|
|
1261
|
-
}
|
|
1262
|
-
});
|
|
1263
|
-
registerSingleton(ILifecycleService, class LifecycleService {
|
|
1264
|
-
constructor() {
|
|
1265
|
-
this.startupKind = 1 ;
|
|
1266
|
-
this.phase = 2 ;
|
|
1267
|
-
this.onBeforeShutdown = Event.None;
|
|
1268
|
-
this.onShutdownVeto = Event.None;
|
|
1269
|
-
this.onBeforeShutdownError = Event.None;
|
|
1270
|
-
this.onWillShutdown = Event.None;
|
|
1271
|
-
this.onDidShutdown = Event.None;
|
|
1272
|
-
this.shutdown = unsupported;
|
|
1273
|
-
}
|
|
1274
|
-
async when() {
|
|
1275
|
-
}
|
|
1276
|
-
});
|
|
1277
|
-
registerSingleton(ILanguageDetectionService, class LanguageDetectionService {
|
|
1278
|
-
isEnabledForLanguage() {
|
|
1279
|
-
return false;
|
|
1280
|
-
}
|
|
1281
|
-
async detectLanguage() {
|
|
1282
|
-
return undefined;
|
|
1283
|
-
}
|
|
1284
|
-
});
|
|
1285
|
-
export { Emitter as E, ILifecycleService as I, ILanguageDetectionService as a, peekReadable as b, bufferToReadable as c, consumeStream as d, isReadableBufferedStream as e, bufferedStreamToBuffer as f, newWriteableStream as g, isReadableStream as i, listenStream as l, newWriteableBufferStream as n, peekStream as p, readableToBuffer as r, streamToBuffer as s, transform as t, unsupported as u };
|