@codingame/monaco-vscode-api 1.67.12 → 1.67.15
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 +5 -2
- package/dist/api.js +1214 -33
- package/dist/async-f842d13c.js +212 -0
- package/dist/configuration.d.ts +293 -0
- package/dist/configuration.js +2069 -0
- package/dist/messages.js +40 -859
- package/dist/{missing-services-71e80bea.js → missing-services-8687ea11.js} +364 -66
- package/dist/modelEditor.js +27 -6
- package/dist/{services-fb7952fb.js → services-7a462d46.js} +292 -1
- package/dist/services.d.ts +2871 -2873
- package/dist/services.js +4 -2
- package/dist/types-371cc315.js +27 -0
- package/package.json +8 -1
- package/dist/async-9ffe4d42.js +0 -46
|
@@ -1,24 +1,27 @@
|
|
|
1
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';
|
|
2
4
|
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
5
|
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
6
|
import { mixin } from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
7
7
|
import { RunOnceScheduler } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
8
8
|
import { show, hide, trackFocus } from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
9
9
|
import { isNumber } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
10
|
+
import { Color } from 'monaco-editor/esm/vs/base/common/color.js';
|
|
10
11
|
import { LanguageService as LanguageService$1 } from 'monaco-editor/esm/vs/editor/common/services/languageService.js';
|
|
11
12
|
import { LanguagesRegistry } from 'monaco-editor/esm/vs/editor/common/services/languagesRegistry.js';
|
|
12
13
|
import { firstOrDefault } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
13
14
|
import { PLAINTEXT_LANGUAGE_ID } from 'monaco-editor/esm/vs/editor/common/languages/modesRegistry.js';
|
|
14
15
|
import { TokenizationRegistry } from 'monaco-editor/esm/vs/editor/common/languages.js';
|
|
15
|
-
import { NoOpNotification
|
|
16
|
+
import { NoOpNotification } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
|
|
17
|
+
import { N as NoOpNotification$1, o as IEditorService, q as IPaneCompositePartService, j as IUriIdentityService, g as ITextFileService, h as IFileService, p as IEditorGroupsService, i as IWorkbenchEnvironmentService, k as IWorkingCopyFileService, l as IPathService, I as IProgressService, v as Services, s as IProductService, t as ILanguageStatusService, u as IHostService } from './services-7a462d46.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';
|
|
16
20
|
import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
17
21
|
import { QuickInputController } from 'monaco-editor/esm/vs/base/parts/quickinput/browser/quickInput.js';
|
|
18
22
|
import { getSingletonServiceDescriptors, registerSingleton } from 'monaco-editor/esm/vs/platform/instantiation/common/extensions.js';
|
|
19
23
|
import { ILabelService } from 'monaco-editor/esm/vs/platform/label/common/label.js';
|
|
20
24
|
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
25
|
import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
23
26
|
import { ExtUri } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
24
27
|
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
@@ -26,6 +29,331 @@ import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
|
26
29
|
import { LanguageFeatureRegistry } from 'monaco-editor/esm/vs/editor/common/languageFeatureRegistry.js';
|
|
27
30
|
import { compare } from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
28
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
|
+
}
|
|
29
357
|
const hasBuffer = (typeof Buffer !== 'undefined');
|
|
30
358
|
let textEncoder;
|
|
31
359
|
let textDecoder;
|
|
@@ -186,6 +514,27 @@ function readUInt8(source, offset) {
|
|
|
186
514
|
function writeUInt8(destination, value, offset) {
|
|
187
515
|
destination[offset] = value;
|
|
188
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
|
+
}
|
|
189
538
|
const Emitter = monaco.Emitter;
|
|
190
539
|
class Themable extends Disposable {
|
|
191
540
|
constructor(themeService) {
|
|
@@ -208,39 +557,13 @@ class Themable extends Disposable {
|
|
|
208
557
|
return color ? color.toString() : null;
|
|
209
558
|
}
|
|
210
559
|
}
|
|
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
560
|
const CSS_DONE = 'done';
|
|
238
561
|
const CSS_ACTIVE = 'active';
|
|
239
562
|
const CSS_INFINITE = 'infinite';
|
|
240
563
|
const CSS_INFINITE_LONG_RUNNING = 'infinite-long-running';
|
|
241
564
|
const CSS_DISCRETE = 'discrete';
|
|
242
565
|
const defaultOpts = {
|
|
243
|
-
progressBarBackground:
|
|
566
|
+
progressBarBackground: Color.fromHex('#0E70C0')
|
|
244
567
|
};
|
|
245
568
|
class ProgressBar extends Disposable {
|
|
246
569
|
constructor(container, options) {
|
|
@@ -503,39 +826,13 @@ class LanguageSelection {
|
|
|
503
826
|
}
|
|
504
827
|
}
|
|
505
828
|
}
|
|
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
829
|
var _a, _b, _c, _d, _e;
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
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];
|
|
539
836
|
}
|
|
540
837
|
}
|
|
541
838
|
(_b = LanguageService$1.prototype).getRegisteredLanguageIds ?? (_b.getRegisteredLanguageIds = LanguageService.prototype.getRegisteredLanguageIds);
|
|
@@ -566,8 +863,9 @@ function toMonacoVSBuffer(value) {
|
|
|
566
863
|
}
|
|
567
864
|
for (const key of Object.getOwnPropertyNames(VSBuffer)) {
|
|
568
865
|
if (!Object.hasOwnProperty.call(VSBuffer$1, key)) {
|
|
569
|
-
VSBuffer
|
|
570
|
-
|
|
866
|
+
const method = VSBuffer[key];
|
|
867
|
+
VSBuffer[key] = VSBuffer$1[key] = function (...args) {
|
|
868
|
+
return toMonacoVSBuffer(method.call(VSBuffer$1, ...args.map(toVSCodeVSBuffer)));
|
|
571
869
|
};
|
|
572
870
|
}
|
|
573
871
|
}
|
|
@@ -984,4 +1282,4 @@ registerSingleton(ILanguageDetectionService, class LanguageDetectionService {
|
|
|
984
1282
|
return undefined;
|
|
985
1283
|
}
|
|
986
1284
|
});
|
|
987
|
-
export { Emitter as E, ILifecycleService as I,
|
|
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 };
|
package/dist/modelEditor.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { b as __decorate, d as __param,
|
|
2
|
-
import { E as Emitter,
|
|
3
|
-
import { Disposable, MutableDisposable, dispose, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
1
|
+
import { b as __decorate, d as __param, h as IFileService, j as IUriIdentityService, g as ITextFileService, S as SIDE_GROUP, A as ACTIVE_GROUP, o as IEditorService, D as isPreferredGroup } from './services-7a462d46.js';
|
|
2
|
+
import { E as Emitter, a as ILanguageDetectionService, u as unsupported } from './missing-services-8687ea11.js';
|
|
3
|
+
import { Disposable, MutableDisposable, dispose, toDisposable, ImmortalReference } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
|
+
import { w as withUndefinedAsNull } from './types-371cc315.js';
|
|
4
5
|
import { ThrottledDelayer } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
5
6
|
import { PLAINTEXT_LANGUAGE_ID } from 'monaco-editor/esm/vs/editor/common/languages/modesRegistry.js';
|
|
6
7
|
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
@@ -31,6 +32,7 @@ import 'monaco-editor/esm/vs/base/common/path.js';
|
|
|
31
32
|
import 'monaco-editor/esm/vs/base/common/linkedList.js';
|
|
32
33
|
import 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
33
34
|
import 'monaco-editor/esm/vs/editor/editor.api.js';
|
|
35
|
+
import 'monaco-editor/esm/vs/base/common/map.js';
|
|
34
36
|
import 'monaco-editor/esm/vs/base/common/errors.js';
|
|
35
37
|
import 'monaco-editor/esm/vs/base/common/stopwatch.js';
|
|
36
38
|
import 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
@@ -49,13 +51,15 @@ import 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
|
49
51
|
import 'monaco-editor/esm/vs/base/common/severity.js';
|
|
50
52
|
import 'monaco-editor/esm/vs/base/common/buffer.js';
|
|
51
53
|
import 'monaco-editor/esm/vs/base/browser/ui/progressbar/progressbar.js';
|
|
52
|
-
import 'monaco-editor/esm/vs/base/common/color.js';
|
|
53
54
|
import 'monaco-editor/esm/vs/base/common/objects.js';
|
|
54
55
|
import 'monaco-editor/esm/vs/base/common/types.js';
|
|
56
|
+
import 'monaco-editor/esm/vs/base/common/color.js';
|
|
55
57
|
import 'monaco-editor/esm/vs/editor/common/services/languageService.js';
|
|
56
58
|
import 'monaco-editor/esm/vs/editor/common/services/languagesRegistry.js';
|
|
57
59
|
import 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
58
60
|
import 'monaco-editor/esm/vs/editor/common/languages.js';
|
|
61
|
+
import 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
62
|
+
import 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
|
|
59
63
|
import 'monaco-editor/esm/vs/base/parts/quickinput/browser/quickInput.js';
|
|
60
64
|
import 'monaco-editor/esm/vs/platform/instantiation/common/extensions.js';
|
|
61
65
|
import 'monaco-editor/esm/vs/platform/label/common/label.js';
|
|
@@ -680,6 +684,7 @@ let EditorService = class EditorService {
|
|
|
680
684
|
let newModelRef;
|
|
681
685
|
if (model == null) {
|
|
682
686
|
const modelRef = await this.textModelService.createModelReference(resource);
|
|
687
|
+
newModelRef = modelRef;
|
|
683
688
|
model = modelRef.object.textEditorModel;
|
|
684
689
|
}
|
|
685
690
|
else {
|
|
@@ -703,15 +708,31 @@ let EditorService = class EditorService {
|
|
|
703
708
|
EditorService = __decorate([
|
|
704
709
|
__param(1, ITextModelService)
|
|
705
710
|
], EditorService);
|
|
706
|
-
class CustomTextModelResolverService extends TextModelResolverService {
|
|
711
|
+
let CustomTextModelResolverService = class CustomTextModelResolverService extends TextModelResolverService {
|
|
712
|
+
constructor(_instantiationService, fileService, undoRedoService, _modelService, uriIdentityService) {
|
|
713
|
+
super(_instantiationService, fileService, undoRedoService, _modelService, uriIdentityService);
|
|
714
|
+
this._instantiationService = _instantiationService;
|
|
715
|
+
this._modelService = _modelService;
|
|
716
|
+
}
|
|
707
717
|
async createModelReference(resource) {
|
|
718
|
+
const existingModel = this._modelService.getModel(resource);
|
|
719
|
+
if (existingModel != null) {
|
|
720
|
+
return new ImmortalReference(this._instantiationService.createInstance(TextResourceEditorModel, resource));
|
|
721
|
+
}
|
|
708
722
|
const ref = await super.createModelReference(resource);
|
|
709
723
|
ref.object.textEditorModel.onWillDispose(() => {
|
|
710
724
|
ref.dispose();
|
|
711
725
|
});
|
|
712
726
|
return ref;
|
|
713
727
|
}
|
|
714
|
-
}
|
|
728
|
+
};
|
|
729
|
+
CustomTextModelResolverService = __decorate([
|
|
730
|
+
__param(0, IInstantiationService),
|
|
731
|
+
__param(1, IFileService),
|
|
732
|
+
__param(2, IUndoRedoService),
|
|
733
|
+
__param(3, IModelService),
|
|
734
|
+
__param(4, IUriIdentityService)
|
|
735
|
+
], CustomTextModelResolverService);
|
|
715
736
|
function getServiceOverride(openEditor) {
|
|
716
737
|
return {
|
|
717
738
|
[ITextModelService.toString()]: new SyncDescriptor(CustomTextModelResolverService),
|