@codingame/monaco-vscode-api 1.68.7 → 1.69.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/services.js CHANGED
@@ -1,26 +1,23 @@
1
+ export { f as IEditorGroupsService, c as IEditorService, I as IFileService, l as IHostService, k as ILanguageStatusService, d as IPaneCompositePartService, i as IPathService, j as IProductService, m as ISnippetsService, e as ITextFileService, b as IUriIdentityService, g as IWorkbenchEnvironmentService, h as IWorkingCopyFileService, w as NotificationsFilter, S as Services } from './services2.js';
2
+ export { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
3
+ export { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
4
+ export { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
5
+ export { IBulkEditService } from 'monaco-editor/esm/vs/editor/browser/services/bulkEditService.js';
6
+ export { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
7
+ export { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
8
+ export { ILanguageConfigurationService } from 'monaco-editor/esm/vs/editor/common/languages/languageConfigurationRegistry.js';
9
+ export { IEditorWorkerService } from 'monaco-editor/esm/vs/editor/common/services/editorWorker.js';
10
+ export { ILanguageFeaturesService } from 'monaco-editor/esm/vs/editor/common/services/languageFeatures.js';
11
+ export { IModelService } from 'monaco-editor/esm/vs/editor/common/services/model.js';
12
+ export { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
13
+ export { IClipboardService } from 'monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js';
14
+ export { IDialogService } from 'monaco-editor/esm/vs/platform/dialogs/common/dialogs.js';
15
+ export { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
16
+ export { IMarkerService } from 'monaco-editor/esm/vs/platform/markers/common/markers.js';
17
+ export { IOpenerService } from 'monaco-editor/esm/vs/platform/opener/common/opener.js';
18
+ export { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
19
+ export { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
20
+ export { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
21
+ export { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
22
+ export { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
1
23
  export { default as Severity } from 'monaco-editor/esm/vs/base/common/severity.js';
2
- let services;
3
- var Services;
4
- (function (Services) {
5
- Services.get = () => {
6
- if (services == null) {
7
- throw new Error('Services has not been installed');
8
- }
9
- return services;
10
- };
11
- function install(_services) {
12
- if (services != null) {
13
- console.warn('Services have been overridden');
14
- }
15
- services = _services;
16
- return {
17
- dispose: () => {
18
- if (services === _services) {
19
- services = undefined;
20
- }
21
- }
22
- };
23
- }
24
- Services.install = install;
25
- })(Services || (Services = {}));
26
- export { Services };
@@ -0,0 +1,423 @@
1
+ import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
2
+ import { IEnvironmentService } from 'monaco-editor/esm/vs/platform/environment/common/environment.js';
3
+ import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js';
4
+ import { localize } from 'monaco-editor/esm/vs/nls.js';
5
+ import { TernarySearchTree } from 'monaco-editor/esm/vs/base/common/map.js';
6
+ import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
7
+ function refineServiceDecorator(serviceIdentifier) {
8
+ return serviceIdentifier;
9
+ }
10
+ const CancellationTokenSource = monaco.CancellationTokenSource;
11
+ function sortedDiff(before, after, compare) {
12
+ const result = [];
13
+ function pushSplice(start, deleteCount, toInsert) {
14
+ if (deleteCount === 0 && toInsert.length === 0) {
15
+ return;
16
+ }
17
+ const latest = result[result.length - 1];
18
+ if (latest && latest.start + latest.deleteCount === start) {
19
+ latest.deleteCount += deleteCount;
20
+ latest.toInsert.push(...toInsert);
21
+ }
22
+ else {
23
+ result.push({ start, deleteCount, toInsert });
24
+ }
25
+ }
26
+ let beforeIdx = 0;
27
+ let afterIdx = 0;
28
+ while (true) {
29
+ if (beforeIdx === before.length) {
30
+ pushSplice(beforeIdx, 0, after.slice(afterIdx));
31
+ break;
32
+ }
33
+ if (afterIdx === after.length) {
34
+ pushSplice(beforeIdx, before.length - beforeIdx, []);
35
+ break;
36
+ }
37
+ const beforeElement = before[beforeIdx];
38
+ const afterElement = after[afterIdx];
39
+ const n = compare(beforeElement, afterElement);
40
+ if (n === 0) {
41
+ beforeIdx += 1;
42
+ afterIdx += 1;
43
+ }
44
+ else if (n < 0) {
45
+ pushSplice(beforeIdx, 1, []);
46
+ beforeIdx += 1;
47
+ }
48
+ else if (n > 0) {
49
+ pushSplice(beforeIdx, 0, [afterElement]);
50
+ afterIdx += 1;
51
+ }
52
+ }
53
+ return result;
54
+ }
55
+ function delta(before, after, compare) {
56
+ const splices = sortedDiff(before, after, compare);
57
+ const removed = [];
58
+ const added = [];
59
+ for (const splice of splices) {
60
+ removed.push(...before.slice(splice.start, splice.start + splice.deleteCount));
61
+ added.push(...splice.toInsert);
62
+ }
63
+ return { removed, added };
64
+ }
65
+ function coalesceInPlace(array) {
66
+ let to = 0;
67
+ for (let i = 0; i < array.length; i++) {
68
+ if (!!array[i]) {
69
+ array[to] = array[i];
70
+ to += 1;
71
+ }
72
+ }
73
+ array.length = to;
74
+ }
75
+ function flatten(arr) {
76
+ return [].concat(...arr);
77
+ }
78
+ function index(array, indexer, mapper) {
79
+ return array.reduce((r, t) => {
80
+ r[indexer(t)] = mapper ? mapper(t) : t;
81
+ return r;
82
+ }, Object.create(null));
83
+ }
84
+ function shuffle(array, _seed) {
85
+ let rand;
86
+ if (typeof _seed === 'number') {
87
+ let seed = _seed;
88
+ rand = () => {
89
+ const x = Math.sin(seed++) * 179426549;
90
+ return x - Math.floor(x);
91
+ };
92
+ }
93
+ else {
94
+ rand = Math.random;
95
+ }
96
+ for (let i = array.length - 1; i > 0; i -= 1) {
97
+ const j = Math.floor(rand() * (i + 1));
98
+ const temp = array[i];
99
+ array[i] = array[j];
100
+ array[j] = temp;
101
+ }
102
+ }
103
+ function mapArrayOrNot(items, fn) {
104
+ return Array.isArray(items) ?
105
+ items.map(fn) :
106
+ fn(items);
107
+ }
108
+ var NeverShowAgainScope;
109
+ ( ((function(NeverShowAgainScope) {
110
+ NeverShowAgainScope[NeverShowAgainScope["WORKSPACE"] = 0] = "WORKSPACE";
111
+ NeverShowAgainScope[NeverShowAgainScope["PROFILE"] = 1] = "PROFILE";
112
+ NeverShowAgainScope[NeverShowAgainScope["APPLICATION"] = 2] = "APPLICATION";
113
+ })(NeverShowAgainScope || (NeverShowAgainScope = {}))));
114
+ var NotificationsFilter;
115
+ ( ((function(NotificationsFilter) {
116
+ NotificationsFilter[NotificationsFilter["OFF"] = 0] = "OFF";
117
+ NotificationsFilter[NotificationsFilter["SILENT"] = 1] = "SILENT";
118
+ NotificationsFilter[NotificationsFilter["ERROR"] = 2] = "ERROR";
119
+ })(NotificationsFilter || (NotificationsFilter = {}))));
120
+ class NoOpNotification {
121
+ constructor() {
122
+ this.progress = ( (new NoOpProgress()));
123
+ this.onDidClose = Event.None;
124
+ this.onDidChangeVisibility = Event.None;
125
+ }
126
+ updateSeverity(severity) { }
127
+ updateMessage(message) { }
128
+ updateActions(actions) { }
129
+ close() { }
130
+ }
131
+ class NoOpProgress {
132
+ infinite() { }
133
+ done() { }
134
+ total(value) { }
135
+ worked(value) { }
136
+ }
137
+ const IFileService = ( (createDecorator('fileService')));
138
+ var FileType;
139
+ ( ((function(FileType) {
140
+ FileType[FileType["Unknown"] = 0] = "Unknown";
141
+ FileType[FileType["File"] = 1] = "File";
142
+ FileType[FileType["Directory"] = 2] = "Directory";
143
+ FileType[FileType["SymbolicLink"] = 64] = "SymbolicLink";
144
+ })(FileType || (FileType = {}))));
145
+ var FilePermission;
146
+ ( ((function(FilePermission) {
147
+ FilePermission[FilePermission["Readonly"] = 1] = "Readonly";
148
+ })(FilePermission || (FilePermission = {}))));
149
+ function hasReadWriteCapability(provider) {
150
+ return !!((provider.capabilities & 2) );
151
+ }
152
+ function hasFileFolderCopyCapability(provider) {
153
+ return !!((provider.capabilities & 8) );
154
+ }
155
+ function hasFileCloneCapability(provider) {
156
+ return !!((provider.capabilities & 32768) );
157
+ }
158
+ function hasOpenReadWriteCloseCapability(provider) {
159
+ return !!((provider.capabilities & 4) );
160
+ }
161
+ function hasFileReadStreamCapability(provider) {
162
+ return !!((provider.capabilities & 16) );
163
+ }
164
+ function hasFileAtomicReadCapability(provider) {
165
+ if (!hasReadWriteCapability(provider)) {
166
+ return false;
167
+ }
168
+ return !!((provider.capabilities & 16384) );
169
+ }
170
+ var FileSystemProviderErrorCode;
171
+ ( ((function(FileSystemProviderErrorCode) {
172
+ FileSystemProviderErrorCode["FileExists"] = "EntryExists";
173
+ FileSystemProviderErrorCode["FileNotFound"] = "EntryNotFound";
174
+ FileSystemProviderErrorCode["FileNotADirectory"] = "EntryNotADirectory";
175
+ FileSystemProviderErrorCode["FileIsADirectory"] = "EntryIsADirectory";
176
+ FileSystemProviderErrorCode["FileExceedsMemoryLimit"] = "EntryExceedsMemoryLimit";
177
+ FileSystemProviderErrorCode["FileTooLarge"] = "EntryTooLarge";
178
+ FileSystemProviderErrorCode["FileWriteLocked"] = "EntryWriteLocked";
179
+ FileSystemProviderErrorCode["NoPermissions"] = "NoPermissions";
180
+ FileSystemProviderErrorCode["Unavailable"] = "Unavailable";
181
+ FileSystemProviderErrorCode["Unknown"] = "Unknown";
182
+ })(FileSystemProviderErrorCode || (FileSystemProviderErrorCode = {}))));
183
+ class FileSystemProviderError extends Error {
184
+ constructor(message, code) {
185
+ super(message);
186
+ this.code = code;
187
+ }
188
+ }
189
+ function createFileSystemProviderError(error, code) {
190
+ const providerError = ( (new FileSystemProviderError( (error.toString()), code)));
191
+ markAsFileSystemProviderError(providerError, code);
192
+ return providerError;
193
+ }
194
+ function ensureFileSystemProviderError(error) {
195
+ if (!error) {
196
+ return createFileSystemProviderError(( (localize('unknownError', "Unknown Error"))), FileSystemProviderErrorCode.Unknown);
197
+ }
198
+ return error;
199
+ }
200
+ function markAsFileSystemProviderError(error, code) {
201
+ error.name = code ? `${code} (FileSystemError)` : `FileSystemError`;
202
+ return error;
203
+ }
204
+ function toFileSystemProviderErrorCode(error) {
205
+ if (!error) {
206
+ return FileSystemProviderErrorCode.Unknown;
207
+ }
208
+ if (error instanceof FileSystemProviderError) {
209
+ return error.code;
210
+ }
211
+ const match = /^(.+) \(FileSystemError\)$/.exec(error.name);
212
+ if (!match) {
213
+ return FileSystemProviderErrorCode.Unknown;
214
+ }
215
+ switch (match[1]) {
216
+ case FileSystemProviderErrorCode.FileExists: return FileSystemProviderErrorCode.FileExists;
217
+ case FileSystemProviderErrorCode.FileIsADirectory: return FileSystemProviderErrorCode.FileIsADirectory;
218
+ case FileSystemProviderErrorCode.FileNotADirectory: return FileSystemProviderErrorCode.FileNotADirectory;
219
+ case FileSystemProviderErrorCode.FileNotFound: return FileSystemProviderErrorCode.FileNotFound;
220
+ case FileSystemProviderErrorCode.FileExceedsMemoryLimit: return FileSystemProviderErrorCode.FileExceedsMemoryLimit;
221
+ case FileSystemProviderErrorCode.FileTooLarge: return FileSystemProviderErrorCode.FileTooLarge;
222
+ case FileSystemProviderErrorCode.FileWriteLocked: return FileSystemProviderErrorCode.FileWriteLocked;
223
+ case FileSystemProviderErrorCode.NoPermissions: return FileSystemProviderErrorCode.NoPermissions;
224
+ case FileSystemProviderErrorCode.Unavailable: return FileSystemProviderErrorCode.Unavailable;
225
+ }
226
+ return FileSystemProviderErrorCode.Unknown;
227
+ }
228
+ function toFileOperationResult(error) {
229
+ if (error instanceof FileOperationError) {
230
+ return error.fileOperationResult;
231
+ }
232
+ switch (toFileSystemProviderErrorCode(error)) {
233
+ case FileSystemProviderErrorCode.FileNotFound:
234
+ return 1 ;
235
+ case FileSystemProviderErrorCode.FileIsADirectory:
236
+ return 0 ;
237
+ case FileSystemProviderErrorCode.FileNotADirectory:
238
+ return 10 ;
239
+ case FileSystemProviderErrorCode.FileWriteLocked:
240
+ return 5 ;
241
+ case FileSystemProviderErrorCode.NoPermissions:
242
+ return 6 ;
243
+ case FileSystemProviderErrorCode.FileExists:
244
+ return 4 ;
245
+ case FileSystemProviderErrorCode.FileExceedsMemoryLimit:
246
+ return 9 ;
247
+ case FileSystemProviderErrorCode.FileTooLarge:
248
+ return 7 ;
249
+ default:
250
+ return 11 ;
251
+ }
252
+ }
253
+ class FileOperationEvent {
254
+ constructor(resource, operation, target) {
255
+ this.resource = resource;
256
+ this.operation = operation;
257
+ this.target = target;
258
+ }
259
+ isOperation(operation) {
260
+ return this.operation === operation;
261
+ }
262
+ }
263
+ class FileChangesEvent {
264
+ constructor(changes, ignorePathCasing) {
265
+ this.added = undefined;
266
+ this.updated = undefined;
267
+ this.deleted = undefined;
268
+ this.rawChanges = [];
269
+ this.rawAdded = [];
270
+ this.rawUpdated = [];
271
+ this.rawDeleted = [];
272
+ this.rawChanges = changes;
273
+ const entriesByType = ( (new Map()));
274
+ for (const change of changes) {
275
+ const array = entriesByType.get(change.type);
276
+ if (array) {
277
+ array.push([change.resource, change]);
278
+ }
279
+ else {
280
+ entriesByType.set(change.type, [[change.resource, change]]);
281
+ }
282
+ switch (change.type) {
283
+ case 1 :
284
+ this.rawAdded.push(change.resource);
285
+ break;
286
+ case 0 :
287
+ this.rawUpdated.push(change.resource);
288
+ break;
289
+ case 2 :
290
+ this.rawDeleted.push(change.resource);
291
+ break;
292
+ }
293
+ }
294
+ for (const [key, value] of entriesByType) {
295
+ switch (key) {
296
+ case 1 :
297
+ this.added = TernarySearchTree.forUris(() => ignorePathCasing);
298
+ this.added.fill(value);
299
+ break;
300
+ case 0 :
301
+ this.updated = TernarySearchTree.forUris(() => ignorePathCasing);
302
+ this.updated.fill(value);
303
+ break;
304
+ case 2 :
305
+ this.deleted = TernarySearchTree.forUris(() => ignorePathCasing);
306
+ this.deleted.fill(value);
307
+ break;
308
+ }
309
+ }
310
+ }
311
+ contains(resource, ...types) {
312
+ return this.doContains(resource, { includeChildren: false }, ...types);
313
+ }
314
+ affects(resource, ...types) {
315
+ return this.doContains(resource, { includeChildren: true }, ...types);
316
+ }
317
+ doContains(resource, options, ...types) {
318
+ if (!resource) {
319
+ return false;
320
+ }
321
+ const hasTypesFilter = types.length > 0;
322
+ if (!hasTypesFilter || types.includes(1 )) {
323
+ if (this.added?.get(resource)) {
324
+ return true;
325
+ }
326
+ if (options.includeChildren && this.added?.findSuperstr(resource)) {
327
+ return true;
328
+ }
329
+ }
330
+ if (!hasTypesFilter || types.includes(0 )) {
331
+ if (this.updated?.get(resource)) {
332
+ return true;
333
+ }
334
+ if (options.includeChildren && this.updated?.findSuperstr(resource)) {
335
+ return true;
336
+ }
337
+ }
338
+ if (!hasTypesFilter || types.includes(2 )) {
339
+ if (this.deleted?.findSubstr(resource) ) {
340
+ return true;
341
+ }
342
+ if (options.includeChildren && this.deleted?.findSuperstr(resource)) {
343
+ return true;
344
+ }
345
+ }
346
+ return false;
347
+ }
348
+ gotAdded() {
349
+ return !!this.added;
350
+ }
351
+ gotDeleted() {
352
+ return !!this.deleted;
353
+ }
354
+ gotUpdated() {
355
+ return !!this.updated;
356
+ }
357
+ }
358
+ class FileOperationError extends Error {
359
+ constructor(message, fileOperationResult, options) {
360
+ super(message);
361
+ this.fileOperationResult = fileOperationResult;
362
+ this.options = options;
363
+ }
364
+ }
365
+ class NotModifiedSinceFileOperationError extends FileOperationError {
366
+ constructor(message, stat, options) {
367
+ super(message, 2 , options);
368
+ this.stat = stat;
369
+ }
370
+ }
371
+ const FILES_ASSOCIATIONS_CONFIG = 'files.associations';
372
+ const ETAG_DISABLED = '';
373
+ function etag(stat) {
374
+ if (typeof stat.size !== 'number' || typeof stat.mtime !== 'number') {
375
+ return undefined;
376
+ }
377
+ return ( (stat.mtime.toString(29))) + ( (stat.size.toString(31)));
378
+ }
379
+ const IUriIdentityService = ( (createDecorator('IUriIdentityService')));
380
+ const IEditorGroupsService = ( (createDecorator('editorGroupsService')));
381
+ function isEditorGroup(obj) {
382
+ const group = obj;
383
+ return !!group && typeof group.id === 'number' && Array.isArray(group.editors);
384
+ }
385
+ const IEditorService = ( (createDecorator('editorService')));
386
+ const ACTIVE_GROUP = -1;
387
+ const SIDE_GROUP = -2;
388
+ function isPreferredGroup(obj) {
389
+ const candidate = obj;
390
+ return typeof obj === 'number' || isEditorGroup(candidate);
391
+ }
392
+ const ITextFileService = ( (createDecorator('textFileService')));
393
+ const IWorkbenchEnvironmentService = refineServiceDecorator(IEnvironmentService);
394
+ const IWorkingCopyFileService = ( (createDecorator('workingCopyFileService')));
395
+ const IPathService = ( (createDecorator('pathService')));
396
+ const IPaneCompositePartService = ( (createDecorator('paneCompositePartService')));
397
+ const IProductService = ( (createDecorator('productService')));
398
+ const productSchemaId = 'vscode://schemas/vscode-product';
399
+ const ILanguageStatusService = ( (createDecorator('ILanguageStatusService')));
400
+ const IHostService = ( (createDecorator('hostService')));
401
+ const ISnippetsService = ( (createDecorator('snippetService')));
402
+ let services;
403
+ var Services;
404
+ ( (function(Services) {
405
+ Services.get = () => {
406
+ return services ?? {};
407
+ };
408
+ function install(_services) {
409
+ if (services != null) {
410
+ console.warn('Services have been overridden');
411
+ }
412
+ services = _services;
413
+ return {
414
+ dispose: () => {
415
+ if (services === _services) {
416
+ services = undefined;
417
+ }
418
+ }
419
+ };
420
+ }
421
+ Services.install = install;
422
+ })(Services || (Services = {})));
423
+ export { ACTIVE_GROUP as A, FileChangesEvent as B, CancellationTokenSource as C, FileOperationError as D, hasOpenReadWriteCloseCapability as E, FileType as F, hasReadWriteCapability as G, hasFileReadStreamCapability as H, IFileService as I, toFileSystemProviderErrorCode as J, ensureFileSystemProviderError as K, etag as L, FileOperationEvent as M, NoOpNotification as N, toFileOperationResult as O, ETAG_DISABLED as P, hasFileAtomicReadCapability as Q, NotModifiedSinceFileOperationError as R, Services as S, hasFileFolderCopyCapability as T, hasFileCloneCapability as U, createFileSystemProviderError as V, index as W, flatten as X, FILES_ASSOCIATIONS_CONFIG as Y, FilePermission as a, IUriIdentityService as b, IEditorService as c, IPaneCompositePartService as d, ITextFileService as e, IEditorGroupsService as f, IWorkbenchEnvironmentService as g, IWorkingCopyFileService as h, IPathService as i, IProductService as j, ILanguageStatusService as k, IHostService as l, ISnippetsService as m, coalesceInPlace as n, markAsFileSystemProviderError as o, productSchemaId as p, FileSystemProviderErrorCode as q, refineServiceDecorator as r, shuffle as s, mapArrayOrNot as t, SIDE_GROUP as u, delta as v, NotificationsFilter as w, NeverShowAgainScope as x, isPreferredGroup as y, FileSystemProviderError as z };