@codingame/monaco-vscode-api 1.67.14 → 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 +1213 -32
- package/dist/async-f842d13c.js +212 -0
- package/dist/configuration.d.ts +293 -0
- package/dist/configuration.js +2069 -0
- package/dist/messages.js +25 -18
- package/dist/{missing-services-0f9c8f22.js → missing-services-8687ea11.js} +357 -31
- package/dist/modelEditor.js +6 -2
- package/dist/{services-621e567e.js → services-7a462d46.js} +263 -1
- package/dist/services.d.ts +481 -483
- package/dist/services.js +3 -2
- package/dist/types-371cc315.js +27 -0
- package/package.json +8 -1
- package/dist/async-9ffe4d42.js +0 -46
|
@@ -13,6 +13,7 @@ import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configurati
|
|
|
13
13
|
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js';
|
|
14
14
|
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
15
15
|
import { raceCancellation, Promises } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
16
|
+
import { TernarySearchTree } from 'monaco-editor/esm/vs/base/common/map.js';
|
|
16
17
|
import { onUnexpectedError } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
17
18
|
import { StopWatch } from 'monaco-editor/esm/vs/base/common/stopwatch.js';
|
|
18
19
|
import { CancellationToken } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
@@ -269,6 +270,60 @@ function isValidBasename(name, isWindowsOS = isWindows) {
|
|
|
269
270
|
}
|
|
270
271
|
return true;
|
|
271
272
|
}
|
|
273
|
+
function sortedDiff(before, after, compare) {
|
|
274
|
+
const result = [];
|
|
275
|
+
function pushSplice(start, deleteCount, toInsert) {
|
|
276
|
+
if (deleteCount === 0 && toInsert.length === 0) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const latest = result[result.length - 1];
|
|
280
|
+
if (latest && latest.start + latest.deleteCount === start) {
|
|
281
|
+
latest.deleteCount += deleteCount;
|
|
282
|
+
latest.toInsert.push(...toInsert);
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
result.push({ start, deleteCount, toInsert });
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
let beforeIdx = 0;
|
|
289
|
+
let afterIdx = 0;
|
|
290
|
+
while (true) {
|
|
291
|
+
if (beforeIdx === before.length) {
|
|
292
|
+
pushSplice(beforeIdx, 0, after.slice(afterIdx));
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
if (afterIdx === after.length) {
|
|
296
|
+
pushSplice(beforeIdx, before.length - beforeIdx, []);
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
const beforeElement = before[beforeIdx];
|
|
300
|
+
const afterElement = after[afterIdx];
|
|
301
|
+
const n = compare(beforeElement, afterElement);
|
|
302
|
+
if (n === 0) {
|
|
303
|
+
beforeIdx += 1;
|
|
304
|
+
afterIdx += 1;
|
|
305
|
+
}
|
|
306
|
+
else if (n < 0) {
|
|
307
|
+
pushSplice(beforeIdx, 1, []);
|
|
308
|
+
beforeIdx += 1;
|
|
309
|
+
}
|
|
310
|
+
else if (n > 0) {
|
|
311
|
+
pushSplice(beforeIdx, 0, [afterElement]);
|
|
312
|
+
afterIdx += 1;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return result;
|
|
316
|
+
}
|
|
317
|
+
function delta(before, after, compare) {
|
|
318
|
+
const splices = sortedDiff(before, after, compare);
|
|
319
|
+
const removed = [];
|
|
320
|
+
const added = [];
|
|
321
|
+
for (const splice of splices) {
|
|
322
|
+
removed.push(...before.slice(splice.start, splice.start + splice.deleteCount));
|
|
323
|
+
added.push(...splice.toInsert);
|
|
324
|
+
}
|
|
325
|
+
return { removed, added };
|
|
326
|
+
}
|
|
272
327
|
function coalesceInPlace(array) {
|
|
273
328
|
let to = 0;
|
|
274
329
|
for (let i = 0; i < array.length; i++) {
|
|
@@ -291,6 +346,11 @@ function remove(array, element) {
|
|
|
291
346
|
}
|
|
292
347
|
return undefined;
|
|
293
348
|
}
|
|
349
|
+
function mapArrayOrNot(items, fn) {
|
|
350
|
+
return Array.isArray(items) ?
|
|
351
|
+
items.map(fn) :
|
|
352
|
+
fn(items);
|
|
353
|
+
}
|
|
294
354
|
var NeverShowAgainScope;
|
|
295
355
|
(function(NeverShowAgainScope) {
|
|
296
356
|
NeverShowAgainScope[NeverShowAgainScope["WORKSPACE"] = 0] = "WORKSPACE";
|
|
@@ -351,6 +411,24 @@ var FilePermission;
|
|
|
351
411
|
(function(FilePermission) {
|
|
352
412
|
FilePermission[FilePermission["Readonly"] = 1] = "Readonly";
|
|
353
413
|
})(FilePermission || (FilePermission = {}));
|
|
414
|
+
function hasReadWriteCapability(provider) {
|
|
415
|
+
return !!((provider.capabilities & 2) );
|
|
416
|
+
}
|
|
417
|
+
function hasFileFolderCopyCapability(provider) {
|
|
418
|
+
return !!((provider.capabilities & 8) );
|
|
419
|
+
}
|
|
420
|
+
function hasOpenReadWriteCloseCapability(provider) {
|
|
421
|
+
return !!((provider.capabilities & 4) );
|
|
422
|
+
}
|
|
423
|
+
function hasFileReadStreamCapability(provider) {
|
|
424
|
+
return !!((provider.capabilities & 16) );
|
|
425
|
+
}
|
|
426
|
+
function hasFileAtomicReadCapability(provider) {
|
|
427
|
+
if (!hasReadWriteCapability(provider)) {
|
|
428
|
+
return false;
|
|
429
|
+
}
|
|
430
|
+
return !!((provider.capabilities & 16384) );
|
|
431
|
+
}
|
|
354
432
|
var FileSystemProviderErrorCode;
|
|
355
433
|
(function(FileSystemProviderErrorCode) {
|
|
356
434
|
FileSystemProviderErrorCode["FileExists"] = "EntryExists";
|
|
@@ -364,10 +442,181 @@ var FileSystemProviderErrorCode;
|
|
|
364
442
|
FileSystemProviderErrorCode["Unavailable"] = "Unavailable";
|
|
365
443
|
FileSystemProviderErrorCode["Unknown"] = "Unknown";
|
|
366
444
|
})(FileSystemProviderErrorCode || (FileSystemProviderErrorCode = {}));
|
|
445
|
+
class FileSystemProviderError extends Error {
|
|
446
|
+
constructor(message, code) {
|
|
447
|
+
super(message);
|
|
448
|
+
this.code = code;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
function createFileSystemProviderError(error, code) {
|
|
452
|
+
const providerError = new FileSystemProviderError(error.toString(), code);
|
|
453
|
+
markAsFileSystemProviderError(providerError, code);
|
|
454
|
+
return providerError;
|
|
455
|
+
}
|
|
456
|
+
function ensureFileSystemProviderError(error) {
|
|
457
|
+
if (!error) {
|
|
458
|
+
return createFileSystemProviderError( localize('unknownError', "Unknown Error"), FileSystemProviderErrorCode.Unknown);
|
|
459
|
+
}
|
|
460
|
+
return error;
|
|
461
|
+
}
|
|
367
462
|
function markAsFileSystemProviderError(error, code) {
|
|
368
463
|
error.name = code ? `${code} (FileSystemError)` : `FileSystemError`;
|
|
369
464
|
return error;
|
|
370
465
|
}
|
|
466
|
+
function toFileSystemProviderErrorCode(error) {
|
|
467
|
+
if (!error) {
|
|
468
|
+
return FileSystemProviderErrorCode.Unknown;
|
|
469
|
+
}
|
|
470
|
+
if (error instanceof FileSystemProviderError) {
|
|
471
|
+
return error.code;
|
|
472
|
+
}
|
|
473
|
+
const match = /^(.+) \(FileSystemError\)$/.exec(error.name);
|
|
474
|
+
if (!match) {
|
|
475
|
+
return FileSystemProviderErrorCode.Unknown;
|
|
476
|
+
}
|
|
477
|
+
switch (match[1]) {
|
|
478
|
+
case FileSystemProviderErrorCode.FileExists: return FileSystemProviderErrorCode.FileExists;
|
|
479
|
+
case FileSystemProviderErrorCode.FileIsADirectory: return FileSystemProviderErrorCode.FileIsADirectory;
|
|
480
|
+
case FileSystemProviderErrorCode.FileNotADirectory: return FileSystemProviderErrorCode.FileNotADirectory;
|
|
481
|
+
case FileSystemProviderErrorCode.FileNotFound: return FileSystemProviderErrorCode.FileNotFound;
|
|
482
|
+
case FileSystemProviderErrorCode.FileExceedsMemoryLimit: return FileSystemProviderErrorCode.FileExceedsMemoryLimit;
|
|
483
|
+
case FileSystemProviderErrorCode.FileTooLarge: return FileSystemProviderErrorCode.FileTooLarge;
|
|
484
|
+
case FileSystemProviderErrorCode.FileWriteLocked: return FileSystemProviderErrorCode.FileWriteLocked;
|
|
485
|
+
case FileSystemProviderErrorCode.NoPermissions: return FileSystemProviderErrorCode.NoPermissions;
|
|
486
|
+
case FileSystemProviderErrorCode.Unavailable: return FileSystemProviderErrorCode.Unavailable;
|
|
487
|
+
}
|
|
488
|
+
return FileSystemProviderErrorCode.Unknown;
|
|
489
|
+
}
|
|
490
|
+
function toFileOperationResult(error) {
|
|
491
|
+
if (error instanceof FileOperationError) {
|
|
492
|
+
return error.fileOperationResult;
|
|
493
|
+
}
|
|
494
|
+
switch (toFileSystemProviderErrorCode(error)) {
|
|
495
|
+
case FileSystemProviderErrorCode.FileNotFound:
|
|
496
|
+
return 1 ;
|
|
497
|
+
case FileSystemProviderErrorCode.FileIsADirectory:
|
|
498
|
+
return 0 ;
|
|
499
|
+
case FileSystemProviderErrorCode.FileNotADirectory:
|
|
500
|
+
return 10 ;
|
|
501
|
+
case FileSystemProviderErrorCode.FileWriteLocked:
|
|
502
|
+
return 5 ;
|
|
503
|
+
case FileSystemProviderErrorCode.NoPermissions:
|
|
504
|
+
return 6 ;
|
|
505
|
+
case FileSystemProviderErrorCode.FileExists:
|
|
506
|
+
return 4 ;
|
|
507
|
+
case FileSystemProviderErrorCode.FileExceedsMemoryLimit:
|
|
508
|
+
return 9 ;
|
|
509
|
+
case FileSystemProviderErrorCode.FileTooLarge:
|
|
510
|
+
return 7 ;
|
|
511
|
+
default:
|
|
512
|
+
return 11 ;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
class FileOperationEvent {
|
|
516
|
+
constructor(resource, operation, target) {
|
|
517
|
+
this.resource = resource;
|
|
518
|
+
this.operation = operation;
|
|
519
|
+
this.target = target;
|
|
520
|
+
}
|
|
521
|
+
isOperation(operation) {
|
|
522
|
+
return this.operation === operation;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
class FileChangesEvent {
|
|
526
|
+
constructor(changes, ignorePathCasing) {
|
|
527
|
+
this.added = undefined;
|
|
528
|
+
this.updated = undefined;
|
|
529
|
+
this.deleted = undefined;
|
|
530
|
+
this.rawChanges = [];
|
|
531
|
+
this.rawAdded = [];
|
|
532
|
+
this.rawUpdated = [];
|
|
533
|
+
this.rawDeleted = [];
|
|
534
|
+
this.rawChanges = changes;
|
|
535
|
+
const entriesByType = new Map();
|
|
536
|
+
for (const change of changes) {
|
|
537
|
+
const array = entriesByType.get(change.type);
|
|
538
|
+
if (array) {
|
|
539
|
+
array.push([change.resource, change]);
|
|
540
|
+
}
|
|
541
|
+
else {
|
|
542
|
+
entriesByType.set(change.type, [[change.resource, change]]);
|
|
543
|
+
}
|
|
544
|
+
switch (change.type) {
|
|
545
|
+
case 1 :
|
|
546
|
+
this.rawAdded.push(change.resource);
|
|
547
|
+
break;
|
|
548
|
+
case 0 :
|
|
549
|
+
this.rawUpdated.push(change.resource);
|
|
550
|
+
break;
|
|
551
|
+
case 2 :
|
|
552
|
+
this.rawDeleted.push(change.resource);
|
|
553
|
+
break;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
for (const [key, value] of entriesByType) {
|
|
557
|
+
switch (key) {
|
|
558
|
+
case 1 :
|
|
559
|
+
this.added = TernarySearchTree.forUris(() => ignorePathCasing);
|
|
560
|
+
this.added.fill(value);
|
|
561
|
+
break;
|
|
562
|
+
case 0 :
|
|
563
|
+
this.updated = TernarySearchTree.forUris(() => ignorePathCasing);
|
|
564
|
+
this.updated.fill(value);
|
|
565
|
+
break;
|
|
566
|
+
case 2 :
|
|
567
|
+
this.deleted = TernarySearchTree.forUris(() => ignorePathCasing);
|
|
568
|
+
this.deleted.fill(value);
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
contains(resource, ...types) {
|
|
574
|
+
return this.doContains(resource, { includeChildren: false }, ...types);
|
|
575
|
+
}
|
|
576
|
+
affects(resource, ...types) {
|
|
577
|
+
return this.doContains(resource, { includeChildren: true }, ...types);
|
|
578
|
+
}
|
|
579
|
+
doContains(resource, options, ...types) {
|
|
580
|
+
if (!resource) {
|
|
581
|
+
return false;
|
|
582
|
+
}
|
|
583
|
+
const hasTypesFilter = types.length > 0;
|
|
584
|
+
if (!hasTypesFilter || types.includes(1 )) {
|
|
585
|
+
if (this.added?.get(resource)) {
|
|
586
|
+
return true;
|
|
587
|
+
}
|
|
588
|
+
if (options.includeChildren && this.added?.findSuperstr(resource)) {
|
|
589
|
+
return true;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
if (!hasTypesFilter || types.includes(0 )) {
|
|
593
|
+
if (this.updated?.get(resource)) {
|
|
594
|
+
return true;
|
|
595
|
+
}
|
|
596
|
+
if (options.includeChildren && this.updated?.findSuperstr(resource)) {
|
|
597
|
+
return true;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
if (!hasTypesFilter || types.includes(2 )) {
|
|
601
|
+
if (this.deleted?.findSubstr(resource) ) {
|
|
602
|
+
return true;
|
|
603
|
+
}
|
|
604
|
+
if (options.includeChildren && this.deleted?.findSuperstr(resource)) {
|
|
605
|
+
return true;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
return false;
|
|
609
|
+
}
|
|
610
|
+
gotAdded() {
|
|
611
|
+
return !!this.added;
|
|
612
|
+
}
|
|
613
|
+
gotDeleted() {
|
|
614
|
+
return !!this.deleted;
|
|
615
|
+
}
|
|
616
|
+
gotUpdated() {
|
|
617
|
+
return !!this.updated;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
371
620
|
class FileOperationError extends ErrorNoTelemetry {
|
|
372
621
|
constructor(message, fileOperationResult, options) {
|
|
373
622
|
super(message);
|
|
@@ -375,6 +624,19 @@ class FileOperationError extends ErrorNoTelemetry {
|
|
|
375
624
|
this.options = options;
|
|
376
625
|
}
|
|
377
626
|
}
|
|
627
|
+
class NotModifiedSinceFileOperationError extends FileOperationError {
|
|
628
|
+
constructor(message, stat, options) {
|
|
629
|
+
super(message, 2 , options);
|
|
630
|
+
this.stat = stat;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
const ETAG_DISABLED = '';
|
|
634
|
+
function etag(stat) {
|
|
635
|
+
if (typeof stat.size !== 'number' || typeof stat.mtime !== 'number') {
|
|
636
|
+
return undefined;
|
|
637
|
+
}
|
|
638
|
+
return stat.mtime.toString(29) + stat.size.toString(31);
|
|
639
|
+
}
|
|
378
640
|
const IEditorGroupsService = createDecorator('editorGroupsService');
|
|
379
641
|
function isEditorGroup(obj) {
|
|
380
642
|
const group = obj;
|
|
@@ -770,4 +1032,4 @@ var Services;
|
|
|
770
1032
|
}
|
|
771
1033
|
Services.install = install;
|
|
772
1034
|
})(Services || (Services = {}));
|
|
773
|
-
export { ACTIVE_GROUP as A, CancellationTokenSource as C, FileSystemProviderErrorCode as F, IProgressService as I, NoOpNotification as N, SIDE_GROUP as S, __classPrivateFieldSet as _, __classPrivateFieldGet as a, __decorate as b, coalesceInPlace as c, __param as d,
|
|
1035
|
+
export { ACTIVE_GROUP as A, NeverShowAgainScope as B, CancellationTokenSource as C, isPreferredGroup as D, ensureFileSystemProviderError as E, FileSystemProviderErrorCode as F, createFileSystemProviderError as G, FileChangesEvent as H, IProgressService as I, FileOperationError as J, hasOpenReadWriteCloseCapability as K, hasReadWriteCapability as L, hasFileReadStreamCapability as M, NoOpNotification as N, toFileSystemProviderErrorCode as O, etag as P, FileOperationEvent as Q, toFileOperationResult as R, SIDE_GROUP as S, ETAG_DISABLED as T, hasFileAtomicReadCapability as U, NotModifiedSinceFileOperationError as V, hasFileFolderCopyCapability as W, __classPrivateFieldSet as _, __classPrivateFieldGet as a, __decorate as b, coalesceInPlace as c, __param as d, delta as e, mapArrayOrNot as f, ITextFileService as g, IFileService as h, IWorkbenchEnvironmentService as i, IUriIdentityService as j, IWorkingCopyFileService as k, IPathService as l, markAsFileSystemProviderError as m, disposed as n, IEditorService as o, IEditorGroupsService as p, IPaneCompositePartService as q, readonly as r, IProductService as s, ILanguageStatusService as t, IHostService as u, Services as v, FileType as w, FilePermission as x, NotificationsFilter as y, refineServiceDecorator as z };
|