@codingame/monaco-vscode-api 1.83.1 → 1.83.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/monaco-editor-treemending.patch +555 -555
- package/package.json +1 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionNls.js +1 -1
- package/vscode/src/vs/platform/workspaces/common/workspaces.js +15 -15
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +49 -51
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +58 -69
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +23 -23
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +16 -16
- package/vscode/src/vs/workbench/api/common/extHostCommands.js +59 -65
- package/vscode/src/vs/workbench/api/common/extHostConsoleForwarder.js +8 -8
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +151 -215
- package/vscode/src/vs/workbench/api/common/extHostSCM.js +54 -58
- package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +53 -55
- package/vscode/src/vs/workbench/api/common/extHostTunnelService.js +28 -28
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +265 -277
- package/vscode/src/vs/workbench/api/common/extensionHostMain.js +17 -19
- package/vscode/src/vs/workbench/api/worker/extHostExtensionService.js +5 -5
- package/vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.js +26 -32
- package/vscode/src/vs/workbench/browser/parts/editor/textDiffEditor.js +20 -26
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.js +58 -74
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +19 -19
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +32 -36
- package/vscode/src/vs/workbench/contrib/debug/browser/debugColors.js +19 -19
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +73 -126
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsService.js +66 -74
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +82 -92
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +27 -29
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +122 -124
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +35 -39
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +25 -25
- package/vscode/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.js +30 -32
- package/vscode/src/vs/workbench/services/remote/common/tunnelModel.js +82 -92
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +31 -31
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.js +16 -16
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyBackupService.js +32 -42
|
@@ -32,9 +32,7 @@ class DocumentSymbolAdapter {
|
|
|
32
32
|
return undefined;
|
|
33
33
|
}
|
|
34
34
|
else if (value[0] instanceof DocumentSymbol) {
|
|
35
|
-
return (
|
|
36
|
-
(value.map(DocumentSymbol$1.from))
|
|
37
|
-
);
|
|
35
|
+
return ( value.map(DocumentSymbol$1.from));
|
|
38
36
|
}
|
|
39
37
|
else {
|
|
40
38
|
return DocumentSymbolAdapter._asDocumentSymbolTree(value);
|
|
@@ -85,8 +83,8 @@ class CodeLensAdapter {
|
|
|
85
83
|
this._documents = _documents;
|
|
86
84
|
this._commands = _commands;
|
|
87
85
|
this._provider = _provider;
|
|
88
|
-
this._cache = (
|
|
89
|
-
this._disposables = (
|
|
86
|
+
this._cache = ( new Cache('CodeLens'));
|
|
87
|
+
this._disposables = ( new Map());
|
|
90
88
|
}
|
|
91
89
|
async provideCodeLenses(resource, token) {
|
|
92
90
|
const doc = this._documents.getDocument(resource);
|
|
@@ -95,7 +93,7 @@ class CodeLensAdapter {
|
|
|
95
93
|
return undefined;
|
|
96
94
|
}
|
|
97
95
|
const cacheId = this._cache.add(lenses);
|
|
98
|
-
const disposables = (
|
|
96
|
+
const disposables = ( new DisposableStore());
|
|
99
97
|
this._disposables.set(cacheId, disposables);
|
|
100
98
|
const result = {
|
|
101
99
|
cacheId,
|
|
@@ -143,9 +141,7 @@ class CodeLensAdapter {
|
|
|
143
141
|
}
|
|
144
142
|
function convertToLocationLinks(value) {
|
|
145
143
|
if (Array.isArray(value)) {
|
|
146
|
-
return (
|
|
147
|
-
(value.map(DefinitionLink.from))
|
|
148
|
-
);
|
|
144
|
+
return ( value.map(DefinitionLink.from));
|
|
149
145
|
}
|
|
150
146
|
else if (value) {
|
|
151
147
|
return [DefinitionLink.from(value)];
|
|
@@ -216,7 +212,7 @@ class HoverAdapter {
|
|
|
216
212
|
value.range = doc.getWordRangeAtPosition(pos);
|
|
217
213
|
}
|
|
218
214
|
if (!value.range) {
|
|
219
|
-
value.range = (
|
|
215
|
+
value.range = ( new Range$2(pos, pos));
|
|
220
216
|
}
|
|
221
217
|
return Hover.from(value);
|
|
222
218
|
}
|
|
@@ -245,9 +241,7 @@ class InlineValuesAdapter {
|
|
|
245
241
|
const doc = this._documents.getDocument(resource);
|
|
246
242
|
const value = await this._provider.provideInlineValues(doc, Range.to(viewPort), InlineValueContext.to(context), token);
|
|
247
243
|
if (Array.isArray(value)) {
|
|
248
|
-
return (
|
|
249
|
-
(value.map(iv => InlineValue.from(iv)))
|
|
250
|
-
);
|
|
244
|
+
return ( value.map(iv => InlineValue.from(iv)));
|
|
251
245
|
}
|
|
252
246
|
return undefined;
|
|
253
247
|
}
|
|
@@ -262,9 +256,7 @@ class DocumentHighlightAdapter {
|
|
|
262
256
|
const pos = Position.to(position);
|
|
263
257
|
const value = await this._provider.provideDocumentHighlights(doc, pos, token);
|
|
264
258
|
if (Array.isArray(value)) {
|
|
265
|
-
return (
|
|
266
|
-
(value.map(DocumentHighlight.from))
|
|
267
|
-
);
|
|
259
|
+
return ( value.map(DocumentHighlight.from));
|
|
268
260
|
}
|
|
269
261
|
return undefined;
|
|
270
262
|
}
|
|
@@ -280,7 +272,7 @@ class LinkedEditingRangeAdapter {
|
|
|
280
272
|
const value = await this._provider.provideLinkedEditingRanges(doc, pos, token);
|
|
281
273
|
if (value && Array.isArray(value.ranges)) {
|
|
282
274
|
return {
|
|
283
|
-
ranges: coalesce((
|
|
275
|
+
ranges: coalesce(( value.ranges.map(Range.from))),
|
|
284
276
|
wordPattern: value.wordPattern
|
|
285
277
|
};
|
|
286
278
|
}
|
|
@@ -297,9 +289,7 @@ class ReferenceAdapter {
|
|
|
297
289
|
const pos = Position.to(position);
|
|
298
290
|
const value = await this._provider.provideReferences(doc, pos, context, token);
|
|
299
291
|
if (Array.isArray(value)) {
|
|
300
|
-
return (
|
|
301
|
-
(value.map(location.from))
|
|
302
|
-
);
|
|
292
|
+
return ( value.map(location.from));
|
|
303
293
|
}
|
|
304
294
|
return undefined;
|
|
305
295
|
}
|
|
@@ -314,8 +304,8 @@ class CodeActionAdapter {
|
|
|
314
304
|
this._logService = _logService;
|
|
315
305
|
this._extension = _extension;
|
|
316
306
|
this._apiDeprecation = _apiDeprecation;
|
|
317
|
-
this._cache = (
|
|
318
|
-
this._disposables = (
|
|
307
|
+
this._cache = ( new Cache('CodeAction'));
|
|
308
|
+
this._disposables = ( new Map());
|
|
319
309
|
}
|
|
320
310
|
async provideCodeActions(resource, rangeOrSelection, context, token) {
|
|
321
311
|
const doc = this._documents.getDocument(resource);
|
|
@@ -333,7 +323,7 @@ class CodeActionAdapter {
|
|
|
333
323
|
}
|
|
334
324
|
const codeActionContext = {
|
|
335
325
|
diagnostics: allDiagnostics,
|
|
336
|
-
only: context.only ? (
|
|
326
|
+
only: context.only ? ( new CodeActionKind(context.only)) : undefined,
|
|
337
327
|
triggerKind: CodeActionTriggerKind.to(context.trigger),
|
|
338
328
|
};
|
|
339
329
|
const commandsOrActions = await this._provider.provideCodeActions(doc, ran, codeActionContext, token);
|
|
@@ -341,7 +331,7 @@ class CodeActionAdapter {
|
|
|
341
331
|
return undefined;
|
|
342
332
|
}
|
|
343
333
|
const cacheId = this._cache.add(commandsOrActions);
|
|
344
|
-
const disposables = (
|
|
334
|
+
const disposables = ( new DisposableStore());
|
|
345
335
|
this._disposables.set(cacheId, disposables);
|
|
346
336
|
const actions = [];
|
|
347
337
|
for (let i = 0; i < commandsOrActions.length; i++) {
|
|
@@ -370,7 +360,7 @@ class CodeActionAdapter {
|
|
|
370
360
|
cacheId: [cacheId, i],
|
|
371
361
|
title: candidate.title,
|
|
372
362
|
command: candidate.command && this._commands.toInternal(candidate.command, disposables),
|
|
373
|
-
diagnostics: candidate.diagnostics && (
|
|
363
|
+
diagnostics: candidate.diagnostics && ( candidate.diagnostics.map(Diagnostic.from)),
|
|
374
364
|
edit: candidate.edit && WorkspaceEdit.from(candidate.edit, undefined),
|
|
375
365
|
kind: candidate.kind && candidate.kind.value,
|
|
376
366
|
isPreferred: candidate.isPreferred,
|
|
@@ -428,7 +418,7 @@ class DocumentPasteEditProvider {
|
|
|
428
418
|
return;
|
|
429
419
|
}
|
|
430
420
|
const doc = this._documents.getDocument(resource);
|
|
431
|
-
const vscodeRanges = (
|
|
421
|
+
const vscodeRanges = ( ranges.map(range => Range.to(range)));
|
|
432
422
|
const dataTransfer = DataTransfer.toDataTransfer(dataTransferDto, () => {
|
|
433
423
|
throw new NotImplementedError();
|
|
434
424
|
});
|
|
@@ -444,7 +434,7 @@ class DocumentPasteEditProvider {
|
|
|
444
434
|
return;
|
|
445
435
|
}
|
|
446
436
|
const doc = this._documents.getDocument(resource);
|
|
447
|
-
const vscodeRanges = (
|
|
437
|
+
const vscodeRanges = ( ranges.map(range => Range.to(range)));
|
|
448
438
|
const dataTransfer = DataTransfer.toDataTransfer(dataTransferDto, async (id) => {
|
|
449
439
|
return (await this._proxy.$resolvePasteFileData(this._handle, requestId, id)).buffer;
|
|
450
440
|
});
|
|
@@ -453,11 +443,11 @@ class DocumentPasteEditProvider {
|
|
|
453
443
|
return;
|
|
454
444
|
}
|
|
455
445
|
return {
|
|
456
|
-
label: edit.label ?? (
|
|
446
|
+
label: edit.label ?? ( localize(
|
|
457
447
|
'defaultPasteLabel',
|
|
458
448
|
"Paste using '{0}' extension",
|
|
459
449
|
this._extension.displayName || this._extension.name
|
|
460
|
-
))
|
|
450
|
+
)),
|
|
461
451
|
detail: this._extension.displayName || this._extension.name,
|
|
462
452
|
yieldTo: edit.yieldTo?.map(yTo => {
|
|
463
453
|
return 'mimeType' in yTo ? yTo : { providerId: DocumentPasteEditProvider.toInternalProviderId(yTo.extensionId, yTo.providerId) };
|
|
@@ -476,9 +466,7 @@ class DocumentFormattingAdapter {
|
|
|
476
466
|
const document = this._documents.getDocument(resource);
|
|
477
467
|
const value = await this._provider.provideDocumentFormattingEdits(document, options, token);
|
|
478
468
|
if (Array.isArray(value)) {
|
|
479
|
-
return (
|
|
480
|
-
(value.map(TextEdit.from))
|
|
481
|
-
);
|
|
469
|
+
return ( value.map(TextEdit.from));
|
|
482
470
|
}
|
|
483
471
|
return undefined;
|
|
484
472
|
}
|
|
@@ -493,21 +481,17 @@ class RangeFormattingAdapter {
|
|
|
493
481
|
const ran = Range.to(range);
|
|
494
482
|
const value = await this._provider.provideDocumentRangeFormattingEdits(document, ran, options, token);
|
|
495
483
|
if (Array.isArray(value)) {
|
|
496
|
-
return (
|
|
497
|
-
(value.map(TextEdit.from))
|
|
498
|
-
);
|
|
484
|
+
return ( value.map(TextEdit.from));
|
|
499
485
|
}
|
|
500
486
|
return undefined;
|
|
501
487
|
}
|
|
502
488
|
async provideDocumentRangesFormattingEdits(resource, ranges, options, token) {
|
|
503
489
|
assertType(typeof this._provider.provideDocumentRangesFormattingEdits === 'function', 'INVALID invocation of `provideDocumentRangesFormattingEdits`');
|
|
504
490
|
const document = this._documents.getDocument(resource);
|
|
505
|
-
const _ranges = (
|
|
491
|
+
const _ranges = ( ranges.map(Range.to));
|
|
506
492
|
const value = await this._provider.provideDocumentRangesFormattingEdits(document, _ranges, options, token);
|
|
507
493
|
if (Array.isArray(value)) {
|
|
508
|
-
return (
|
|
509
|
-
(value.map(TextEdit.from))
|
|
510
|
-
);
|
|
494
|
+
return ( value.map(TextEdit.from));
|
|
511
495
|
}
|
|
512
496
|
return undefined;
|
|
513
497
|
}
|
|
@@ -523,9 +507,7 @@ class OnTypeFormattingAdapter {
|
|
|
523
507
|
const pos = Position.to(position);
|
|
524
508
|
const value = await this._provider.provideOnTypeFormattingEdits(document, pos, ch, options, token);
|
|
525
509
|
if (Array.isArray(value)) {
|
|
526
|
-
return (
|
|
527
|
-
(value.map(TextEdit.from))
|
|
528
|
-
);
|
|
510
|
+
return ( value.map(TextEdit.from));
|
|
529
511
|
}
|
|
530
512
|
return undefined;
|
|
531
513
|
}
|
|
@@ -534,7 +516,7 @@ class NavigateTypeAdapter {
|
|
|
534
516
|
constructor(_provider, _logService) {
|
|
535
517
|
this._provider = _provider;
|
|
536
518
|
this._logService = _logService;
|
|
537
|
-
this._cache = (
|
|
519
|
+
this._cache = ( new Cache('WorkspaceSymbols'));
|
|
538
520
|
}
|
|
539
521
|
async provideWorkspaceSymbols(search, token) {
|
|
540
522
|
const value = await this._provider.provideWorkspaceSymbols(search, token);
|
|
@@ -666,7 +648,7 @@ class DocumentSemanticTokensAdapter {
|
|
|
666
648
|
this._documents = _documents;
|
|
667
649
|
this._provider = _provider;
|
|
668
650
|
this._nextResultId = 1;
|
|
669
|
-
this._previousResults = (
|
|
651
|
+
this._previousResults = ( new Map());
|
|
670
652
|
}
|
|
671
653
|
async provideDocumentSemanticTokens(resource, previousResultId, token) {
|
|
672
654
|
const doc = this._documents.getDocument(resource);
|
|
@@ -691,21 +673,13 @@ class DocumentSemanticTokensAdapter {
|
|
|
691
673
|
if (DocumentSemanticTokensAdapter._isCorrectSemanticTokens(v)) {
|
|
692
674
|
return v;
|
|
693
675
|
}
|
|
694
|
-
return (
|
|
695
|
-
(new SemanticTokens( (new Uint32Array(v.data)), v.resultId))
|
|
696
|
-
);
|
|
676
|
+
return ( new SemanticTokens(( new Uint32Array(v.data)), v.resultId));
|
|
697
677
|
}
|
|
698
678
|
else if (DocumentSemanticTokensAdapter._isSemanticTokensEdits(v)) {
|
|
699
679
|
if (DocumentSemanticTokensAdapter._isCorrectSemanticTokensEdits(v)) {
|
|
700
680
|
return v;
|
|
701
681
|
}
|
|
702
|
-
return (
|
|
703
|
-
(new SemanticTokensEdits( (v.edits.map(edit => ( (new SemanticTokensEdit(
|
|
704
|
-
edit.start,
|
|
705
|
-
edit.deleteCount,
|
|
706
|
-
edit.data ? ( (new Uint32Array(edit.data))) : edit.data
|
|
707
|
-
))))), v.resultId))
|
|
708
|
-
);
|
|
682
|
+
return ( new SemanticTokensEdits(( v.edits.map(edit => ( new SemanticTokensEdit(edit.start, edit.deleteCount, edit.data ? ( new Uint32Array(edit.data)) : edit.data)))), v.resultId));
|
|
709
683
|
}
|
|
710
684
|
return v;
|
|
711
685
|
}
|
|
@@ -743,27 +717,23 @@ class DocumentSemanticTokensAdapter {
|
|
|
743
717
|
commonPrefixLength++;
|
|
744
718
|
}
|
|
745
719
|
if (commonPrefixLength === oldLength && commonPrefixLength === newLength) {
|
|
746
|
-
return (
|
|
747
|
-
(new SemanticTokensEdits([], newResult.resultId))
|
|
748
|
-
);
|
|
720
|
+
return ( new SemanticTokensEdits([], newResult.resultId));
|
|
749
721
|
}
|
|
750
722
|
let commonSuffixLength = 0;
|
|
751
723
|
const maxCommonSuffixLength = maxCommonPrefixLength - commonPrefixLength;
|
|
752
724
|
while (commonSuffixLength < maxCommonSuffixLength && oldData[oldLength - commonSuffixLength - 1] === newData[newLength - commonSuffixLength - 1]) {
|
|
753
725
|
commonSuffixLength++;
|
|
754
726
|
}
|
|
755
|
-
return (
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
}], newResult.resultId))
|
|
761
|
-
);
|
|
727
|
+
return ( new SemanticTokensEdits([{
|
|
728
|
+
start: commonPrefixLength,
|
|
729
|
+
deleteCount: (oldLength - commonPrefixLength - commonSuffixLength),
|
|
730
|
+
data: newData.subarray(commonPrefixLength, newLength - commonSuffixLength)
|
|
731
|
+
}], newResult.resultId));
|
|
762
732
|
}
|
|
763
733
|
_send(value, original) {
|
|
764
734
|
if (DocumentSemanticTokensAdapter._isSemanticTokens(value)) {
|
|
765
735
|
const myId = this._nextResultId++;
|
|
766
|
-
this._previousResults.set(myId, (
|
|
736
|
+
this._previousResults.set(myId, ( new SemanticTokensPreviousResult(value.resultId, value.data)));
|
|
767
737
|
return encodeSemanticTokensDto({
|
|
768
738
|
id: myId,
|
|
769
739
|
type: 'full',
|
|
@@ -773,17 +743,17 @@ class DocumentSemanticTokensAdapter {
|
|
|
773
743
|
if (DocumentSemanticTokensAdapter._isSemanticTokensEdits(value)) {
|
|
774
744
|
const myId = this._nextResultId++;
|
|
775
745
|
if (DocumentSemanticTokensAdapter._isSemanticTokens(original)) {
|
|
776
|
-
this._previousResults.set(myId, (
|
|
746
|
+
this._previousResults.set(myId, ( new SemanticTokensPreviousResult(original.resultId, original.data)));
|
|
777
747
|
}
|
|
778
748
|
else {
|
|
779
|
-
this._previousResults.set(myId, (
|
|
749
|
+
this._previousResults.set(myId, ( new SemanticTokensPreviousResult(value.resultId)));
|
|
780
750
|
}
|
|
781
751
|
return encodeSemanticTokensDto({
|
|
782
752
|
id: myId,
|
|
783
753
|
type: 'delta',
|
|
784
|
-
deltas: ( (
|
|
754
|
+
deltas: ( (value.edits || []).map(
|
|
785
755
|
edit => ({ start: edit.start, deleteCount: edit.deleteCount, data: edit.data })
|
|
786
|
-
))
|
|
756
|
+
))
|
|
787
757
|
});
|
|
788
758
|
}
|
|
789
759
|
return null;
|
|
@@ -820,15 +790,15 @@ class CompletionsAdapter {
|
|
|
820
790
|
this._provider = _provider;
|
|
821
791
|
this._apiDeprecation = _apiDeprecation;
|
|
822
792
|
this._extension = _extension;
|
|
823
|
-
this._cache = (
|
|
824
|
-
this._disposables = (
|
|
793
|
+
this._cache = ( new Cache('CompletionItem'));
|
|
794
|
+
this._disposables = ( new Map());
|
|
825
795
|
}
|
|
826
796
|
async provideCompletionItems(resource, position, context, token) {
|
|
827
797
|
const doc = this._documents.getDocument(resource);
|
|
828
798
|
const pos = Position.to(position);
|
|
829
|
-
const replaceRange = doc.getWordRangeAtPosition(pos) || (
|
|
799
|
+
const replaceRange = doc.getWordRangeAtPosition(pos) || ( new Range$2(pos, pos));
|
|
830
800
|
const insertRange = replaceRange.with({ end: pos });
|
|
831
|
-
const sw = (
|
|
801
|
+
const sw = ( new StopWatch());
|
|
832
802
|
const itemsOrList = await this._provider.provideCompletionItems(doc, pos, token, CompletionContext.to(context));
|
|
833
803
|
if (!itemsOrList) {
|
|
834
804
|
return undefined;
|
|
@@ -836,9 +806,9 @@ class CompletionsAdapter {
|
|
|
836
806
|
if (token.isCancellationRequested) {
|
|
837
807
|
return undefined;
|
|
838
808
|
}
|
|
839
|
-
const list = Array.isArray(itemsOrList) ? (
|
|
809
|
+
const list = Array.isArray(itemsOrList) ? ( new CompletionList(itemsOrList)) : itemsOrList;
|
|
840
810
|
const pid = CompletionsAdapter.supportsResolving(this._provider) ? this._cache.add(list.items) : this._cache.add([]);
|
|
841
|
-
const disposables = (
|
|
811
|
+
const disposables = ( new DisposableStore());
|
|
842
812
|
this._disposables.set(pid, disposables);
|
|
843
813
|
const completions = [];
|
|
844
814
|
const result = {
|
|
@@ -905,7 +875,7 @@ class CompletionsAdapter {
|
|
|
905
875
|
x: id,
|
|
906
876
|
["a" ]: item.label,
|
|
907
877
|
["b" ]: item.kind !== undefined ? CompletionItemKind.from(item.kind) : undefined,
|
|
908
|
-
["m" ]: item.tags && (
|
|
878
|
+
["m" ]: item.tags && ( item.tags.map(CompletionItemTag.from)),
|
|
909
879
|
["c" ]: item.detail,
|
|
910
880
|
["d" ]: typeof item.documentation === 'undefined' ? undefined : MarkdownString.fromStrict(item.documentation),
|
|
911
881
|
["e" ]: item.sortText !== item.label ? item.sortText : undefined,
|
|
@@ -913,7 +883,7 @@ class CompletionsAdapter {
|
|
|
913
883
|
["g" ]: item.preselect || undefined,
|
|
914
884
|
["i" ]: item.keepWhitespace ? 1 : 0 ,
|
|
915
885
|
["k" ]: item.commitCharacters?.join(''),
|
|
916
|
-
["l" ]: item.additionalTextEdits && (
|
|
886
|
+
["l" ]: item.additionalTextEdits && ( item.additionalTextEdits.map(TextEdit.from)),
|
|
917
887
|
["n" ]: command?.$ident,
|
|
918
888
|
["o" ]: command?.id,
|
|
919
889
|
["p" ]: command?.$ident ? undefined : command?.arguments,
|
|
@@ -963,7 +933,7 @@ class InlineCompletionAdapter extends InlineCompletionAdapterBase {
|
|
|
963
933
|
this._documents = _documents;
|
|
964
934
|
this._provider = _provider;
|
|
965
935
|
this._commands = _commands;
|
|
966
|
-
this._references = (
|
|
936
|
+
this._references = ( new ReferenceMap());
|
|
967
937
|
this._isAdditionsProposedApiEnabled = isProposedApiEnabled(this._extension, 'inlineCompletionsAdditions');
|
|
968
938
|
this.languageTriggerKindToVSCodeTriggerKind = {
|
|
969
939
|
[languages.InlineCompletionTriggerKind.Automatic]: InlineCompletionTriggerKind.Automatic,
|
|
@@ -1005,11 +975,11 @@ class InlineCompletionAdapter extends InlineCompletionAdapterBase {
|
|
|
1005
975
|
});
|
|
1006
976
|
return {
|
|
1007
977
|
pid,
|
|
1008
|
-
items: (
|
|
978
|
+
items: ( normalizedResult.map((item, idx) => {
|
|
1009
979
|
let command = undefined;
|
|
1010
980
|
if (item.command) {
|
|
1011
981
|
if (!disposableStore) {
|
|
1012
|
-
disposableStore = (
|
|
982
|
+
disposableStore = ( new DisposableStore());
|
|
1013
983
|
}
|
|
1014
984
|
command = this._commands.toInternal(item.command, disposableStore);
|
|
1015
985
|
}
|
|
@@ -1022,13 +992,13 @@ class InlineCompletionAdapter extends InlineCompletionAdapterBase {
|
|
|
1022
992
|
idx: idx,
|
|
1023
993
|
completeBracketPairs: this._isAdditionsProposedApiEnabled ? item.completeBracketPairs : false,
|
|
1024
994
|
});
|
|
1025
|
-
}))
|
|
1026
|
-
commands: (
|
|
995
|
+
})),
|
|
996
|
+
commands: ( commands.map(c => {
|
|
1027
997
|
if (!disposableStore) {
|
|
1028
|
-
disposableStore = (
|
|
998
|
+
disposableStore = ( new DisposableStore());
|
|
1029
999
|
}
|
|
1030
1000
|
return this._commands.toInternal(c, disposableStore);
|
|
1031
|
-
}))
|
|
1001
|
+
})),
|
|
1032
1002
|
suppressSuggestions: false,
|
|
1033
1003
|
enableForwardStability,
|
|
1034
1004
|
};
|
|
@@ -1056,7 +1026,7 @@ class InlineCompletionAdapter extends InlineCompletionAdapterBase {
|
|
|
1056
1026
|
}
|
|
1057
1027
|
class ReferenceMap {
|
|
1058
1028
|
constructor() {
|
|
1059
|
-
this._references = (
|
|
1029
|
+
this._references = ( new Map());
|
|
1060
1030
|
this._idPool = 1;
|
|
1061
1031
|
}
|
|
1062
1032
|
createReferenceId(value) {
|
|
@@ -1077,7 +1047,7 @@ class SignatureHelpAdapter {
|
|
|
1077
1047
|
constructor(_documents, _provider) {
|
|
1078
1048
|
this._documents = _documents;
|
|
1079
1049
|
this._provider = _provider;
|
|
1080
|
-
this._cache = (
|
|
1050
|
+
this._cache = ( new Cache('SignatureHelp'));
|
|
1081
1051
|
}
|
|
1082
1052
|
async provideSignatureHelp(resource, position, context, token) {
|
|
1083
1053
|
const doc = this._documents.getDocument(resource);
|
|
@@ -1117,8 +1087,8 @@ class InlayHintsAdapter {
|
|
|
1117
1087
|
this._provider = _provider;
|
|
1118
1088
|
this._logService = _logService;
|
|
1119
1089
|
this._extension = _extension;
|
|
1120
|
-
this._cache = (
|
|
1121
|
-
this._disposables = (
|
|
1090
|
+
this._cache = ( new Cache('InlayHints'));
|
|
1091
|
+
this._disposables = ( new Map());
|
|
1122
1092
|
}
|
|
1123
1093
|
async provideInlayHints(resource, ran, token) {
|
|
1124
1094
|
const doc = this._documents.getDocument(resource);
|
|
@@ -1132,7 +1102,7 @@ class InlayHintsAdapter {
|
|
|
1132
1102
|
return undefined;
|
|
1133
1103
|
}
|
|
1134
1104
|
const pid = this._cache.add(hints);
|
|
1135
|
-
this._disposables.set(pid, (
|
|
1105
|
+
this._disposables.set(pid, ( new DisposableStore()));
|
|
1136
1106
|
const result = { hints: [], cacheId: pid };
|
|
1137
1107
|
for (let i = 0; i < hints.length; i++) {
|
|
1138
1108
|
if (this._isValidInlayHint(hints[i], range)) {
|
|
@@ -1184,7 +1154,7 @@ class InlayHintsAdapter {
|
|
|
1184
1154
|
cacheId: id,
|
|
1185
1155
|
tooltip: MarkdownString.fromStrict(hint.tooltip),
|
|
1186
1156
|
position: Position.from(hint.position),
|
|
1187
|
-
textEdits: hint.textEdits && (
|
|
1157
|
+
textEdits: hint.textEdits && ( hint.textEdits.map(TextEdit.from)),
|
|
1188
1158
|
kind: hint.kind && InlayHintKind.from(hint.kind),
|
|
1189
1159
|
paddingLeft: hint.paddingLeft,
|
|
1190
1160
|
paddingRight: hint.paddingRight,
|
|
@@ -1193,7 +1163,7 @@ class InlayHintsAdapter {
|
|
|
1193
1163
|
result.label = hint.label;
|
|
1194
1164
|
}
|
|
1195
1165
|
else {
|
|
1196
|
-
result.label = (
|
|
1166
|
+
result.label = ( hint.label.map(part => {
|
|
1197
1167
|
const result = { label: part.value };
|
|
1198
1168
|
result.tooltip = MarkdownString.fromStrict(part.tooltip);
|
|
1199
1169
|
if (Location.isLocation(part.location)) {
|
|
@@ -1203,7 +1173,7 @@ class InlayHintsAdapter {
|
|
|
1203
1173
|
result.command = this._commands.toInternal(part.command, disposables);
|
|
1204
1174
|
}
|
|
1205
1175
|
return result;
|
|
1206
|
-
}))
|
|
1176
|
+
}));
|
|
1207
1177
|
}
|
|
1208
1178
|
return result;
|
|
1209
1179
|
}
|
|
@@ -1212,7 +1182,7 @@ class LinkProviderAdapter {
|
|
|
1212
1182
|
constructor(_documents, _provider) {
|
|
1213
1183
|
this._documents = _documents;
|
|
1214
1184
|
this._provider = _provider;
|
|
1215
|
-
this._cache = (
|
|
1185
|
+
this._cache = ( new Cache('DocumentLink'));
|
|
1216
1186
|
}
|
|
1217
1187
|
async provideLinks(resource, token) {
|
|
1218
1188
|
const doc = this._documents.getDocument(resource);
|
|
@@ -1224,7 +1194,7 @@ class LinkProviderAdapter {
|
|
|
1224
1194
|
return undefined;
|
|
1225
1195
|
}
|
|
1226
1196
|
if (typeof this._provider.resolveDocumentLink !== 'function') {
|
|
1227
|
-
return { links: (
|
|
1197
|
+
return { links: ( links.filter(LinkProviderAdapter._validateLink).map(DocumentLink.from)) };
|
|
1228
1198
|
}
|
|
1229
1199
|
else {
|
|
1230
1200
|
const pid = this._cache.add(links);
|
|
@@ -1276,12 +1246,12 @@ class ColorProviderAdapter {
|
|
|
1276
1246
|
if (!Array.isArray(colors)) {
|
|
1277
1247
|
return [];
|
|
1278
1248
|
}
|
|
1279
|
-
const colorInfos = (
|
|
1249
|
+
const colorInfos = ( colors.map(ci => {
|
|
1280
1250
|
return {
|
|
1281
1251
|
color: Color.from(ci.color),
|
|
1282
1252
|
range: Range.from(ci.range)
|
|
1283
1253
|
};
|
|
1284
|
-
}))
|
|
1254
|
+
}));
|
|
1285
1255
|
return colorInfos;
|
|
1286
1256
|
}
|
|
1287
1257
|
async provideColorPresentations(resource, raw, token) {
|
|
@@ -1292,9 +1262,7 @@ class ColorProviderAdapter {
|
|
|
1292
1262
|
if (!Array.isArray(value)) {
|
|
1293
1263
|
return undefined;
|
|
1294
1264
|
}
|
|
1295
|
-
return (
|
|
1296
|
-
(value.map(ColorPresentation.from))
|
|
1297
|
-
);
|
|
1265
|
+
return ( value.map(ColorPresentation.from));
|
|
1298
1266
|
}
|
|
1299
1267
|
}
|
|
1300
1268
|
class FoldingProviderAdapter {
|
|
@@ -1308,9 +1276,7 @@ class FoldingProviderAdapter {
|
|
|
1308
1276
|
if (!Array.isArray(ranges)) {
|
|
1309
1277
|
return undefined;
|
|
1310
1278
|
}
|
|
1311
|
-
return (
|
|
1312
|
-
(ranges.map(FoldingRange.from))
|
|
1313
|
-
);
|
|
1279
|
+
return ( ranges.map(FoldingRange.from));
|
|
1314
1280
|
}
|
|
1315
1281
|
}
|
|
1316
1282
|
class SelectionRangeAdapter {
|
|
@@ -1321,7 +1287,7 @@ class SelectionRangeAdapter {
|
|
|
1321
1287
|
}
|
|
1322
1288
|
async provideSelectionRanges(resource, pos, token) {
|
|
1323
1289
|
const document = this._documents.getDocument(resource);
|
|
1324
|
-
const positions = (
|
|
1290
|
+
const positions = ( pos.map(Position.to));
|
|
1325
1291
|
const allProviderRanges = await this._provider.provideSelectionRanges(document, positions, token);
|
|
1326
1292
|
if (!isNonEmptyArray(allProviderRanges)) {
|
|
1327
1293
|
return [];
|
|
@@ -1355,8 +1321,8 @@ class CallHierarchyAdapter {
|
|
|
1355
1321
|
constructor(_documents, _provider) {
|
|
1356
1322
|
this._documents = _documents;
|
|
1357
1323
|
this._provider = _provider;
|
|
1358
|
-
this._idPool = (
|
|
1359
|
-
this._cache = (
|
|
1324
|
+
this._idPool = ( new IdGenerator(''));
|
|
1325
|
+
this._cache = ( new Map());
|
|
1360
1326
|
}
|
|
1361
1327
|
async prepareSession(uri, position, token) {
|
|
1362
1328
|
const doc = this._documents.getDocument(uri);
|
|
@@ -1366,11 +1332,9 @@ class CallHierarchyAdapter {
|
|
|
1366
1332
|
return undefined;
|
|
1367
1333
|
}
|
|
1368
1334
|
const sessionId = this._idPool.nextId();
|
|
1369
|
-
this._cache.set(sessionId, (
|
|
1335
|
+
this._cache.set(sessionId, ( new Map()));
|
|
1370
1336
|
if (Array.isArray(items)) {
|
|
1371
|
-
return (
|
|
1372
|
-
(items.map(item => this._cacheAndConvertItem(sessionId, item)))
|
|
1373
|
-
);
|
|
1337
|
+
return ( items.map(item => this._cacheAndConvertItem(sessionId, item)));
|
|
1374
1338
|
}
|
|
1375
1339
|
else {
|
|
1376
1340
|
return [this._cacheAndConvertItem(sessionId, items)];
|
|
@@ -1385,14 +1349,12 @@ class CallHierarchyAdapter {
|
|
|
1385
1349
|
if (!calls) {
|
|
1386
1350
|
return undefined;
|
|
1387
1351
|
}
|
|
1388
|
-
return (
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
}))
|
|
1395
|
-
);
|
|
1352
|
+
return ( calls.map(call => {
|
|
1353
|
+
return {
|
|
1354
|
+
from: this._cacheAndConvertItem(sessionId, call.from),
|
|
1355
|
+
fromRanges: ( call.fromRanges.map(r => Range.from(r)))
|
|
1356
|
+
};
|
|
1357
|
+
}));
|
|
1396
1358
|
}
|
|
1397
1359
|
async provideCallsFrom(sessionId, itemId, token) {
|
|
1398
1360
|
const item = this._itemFromCache(sessionId, itemId);
|
|
@@ -1403,21 +1365,19 @@ class CallHierarchyAdapter {
|
|
|
1403
1365
|
if (!calls) {
|
|
1404
1366
|
return undefined;
|
|
1405
1367
|
}
|
|
1406
|
-
return (
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
}))
|
|
1413
|
-
);
|
|
1368
|
+
return ( calls.map(call => {
|
|
1369
|
+
return {
|
|
1370
|
+
to: this._cacheAndConvertItem(sessionId, call.to),
|
|
1371
|
+
fromRanges: ( call.fromRanges.map(r => Range.from(r)))
|
|
1372
|
+
};
|
|
1373
|
+
}));
|
|
1414
1374
|
}
|
|
1415
1375
|
releaseSession(sessionId) {
|
|
1416
1376
|
this._cache.delete(sessionId);
|
|
1417
1377
|
}
|
|
1418
1378
|
_cacheAndConvertItem(sessionId, item) {
|
|
1419
1379
|
const map = this._cache.get(sessionId);
|
|
1420
|
-
const dto = CallHierarchyItem.from(item, sessionId, (
|
|
1380
|
+
const dto = CallHierarchyItem.from(item, sessionId, ( map.size.toString(36)));
|
|
1421
1381
|
map.set(dto._itemId, item);
|
|
1422
1382
|
return dto;
|
|
1423
1383
|
}
|
|
@@ -1430,8 +1390,8 @@ class TypeHierarchyAdapter {
|
|
|
1430
1390
|
constructor(_documents, _provider) {
|
|
1431
1391
|
this._documents = _documents;
|
|
1432
1392
|
this._provider = _provider;
|
|
1433
|
-
this._idPool = (
|
|
1434
|
-
this._cache = (
|
|
1393
|
+
this._idPool = ( new IdGenerator(''));
|
|
1394
|
+
this._cache = ( new Map());
|
|
1435
1395
|
}
|
|
1436
1396
|
async prepareSession(uri, position, token) {
|
|
1437
1397
|
const doc = this._documents.getDocument(uri);
|
|
@@ -1441,11 +1401,9 @@ class TypeHierarchyAdapter {
|
|
|
1441
1401
|
return undefined;
|
|
1442
1402
|
}
|
|
1443
1403
|
const sessionId = this._idPool.nextId();
|
|
1444
|
-
this._cache.set(sessionId, (
|
|
1404
|
+
this._cache.set(sessionId, ( new Map()));
|
|
1445
1405
|
if (Array.isArray(items)) {
|
|
1446
|
-
return (
|
|
1447
|
-
(items.map(item => this._cacheAndConvertItem(sessionId, item)))
|
|
1448
|
-
);
|
|
1406
|
+
return ( items.map(item => this._cacheAndConvertItem(sessionId, item)));
|
|
1449
1407
|
}
|
|
1450
1408
|
else {
|
|
1451
1409
|
return [this._cacheAndConvertItem(sessionId, items)];
|
|
@@ -1460,11 +1418,9 @@ class TypeHierarchyAdapter {
|
|
|
1460
1418
|
if (!supertypes) {
|
|
1461
1419
|
return undefined;
|
|
1462
1420
|
}
|
|
1463
|
-
return (
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
}))
|
|
1467
|
-
);
|
|
1421
|
+
return ( supertypes.map(supertype => {
|
|
1422
|
+
return this._cacheAndConvertItem(sessionId, supertype);
|
|
1423
|
+
}));
|
|
1468
1424
|
}
|
|
1469
1425
|
async provideSubtypes(sessionId, itemId, token) {
|
|
1470
1426
|
const item = this._itemFromCache(sessionId, itemId);
|
|
@@ -1475,18 +1431,16 @@ class TypeHierarchyAdapter {
|
|
|
1475
1431
|
if (!subtypes) {
|
|
1476
1432
|
return undefined;
|
|
1477
1433
|
}
|
|
1478
|
-
return (
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
}))
|
|
1482
|
-
);
|
|
1434
|
+
return ( subtypes.map(subtype => {
|
|
1435
|
+
return this._cacheAndConvertItem(sessionId, subtype);
|
|
1436
|
+
}));
|
|
1483
1437
|
}
|
|
1484
1438
|
releaseSession(sessionId) {
|
|
1485
1439
|
this._cache.delete(sessionId);
|
|
1486
1440
|
}
|
|
1487
1441
|
_cacheAndConvertItem(sessionId, item) {
|
|
1488
1442
|
const map = this._cache.get(sessionId);
|
|
1489
|
-
const dto = TypeHierarchyItem.from(item, sessionId, (
|
|
1443
|
+
const dto = TypeHierarchyItem.from(item, sessionId, ( map.size.toString(36)));
|
|
1490
1444
|
map.set(dto._itemId, item);
|
|
1491
1445
|
return dto;
|
|
1492
1446
|
}
|
|
@@ -1517,11 +1471,11 @@ class DocumentOnDropEditAdapter {
|
|
|
1517
1471
|
return undefined;
|
|
1518
1472
|
}
|
|
1519
1473
|
return {
|
|
1520
|
-
label: edit.label ?? (
|
|
1474
|
+
label: edit.label ?? ( localize(
|
|
1521
1475
|
'defaultDropLabel',
|
|
1522
1476
|
"Drop using '{0}' extension",
|
|
1523
1477
|
this._extension.displayName || this._extension.name
|
|
1524
|
-
))
|
|
1478
|
+
)),
|
|
1525
1479
|
yieldTo: edit.yieldTo?.map(yTo => {
|
|
1526
1480
|
return 'mimeType' in yTo ? yTo : { providerId: DocumentOnDropEditAdapter.toInternalProviderId(yTo.extensionId, yTo.providerId) };
|
|
1527
1481
|
}),
|
|
@@ -1538,13 +1492,13 @@ class MappedEditsAdapter {
|
|
|
1538
1492
|
async provideMappedEdits(resource, codeBlocks, context, token) {
|
|
1539
1493
|
const uri = URI.revive(resource);
|
|
1540
1494
|
const doc = this._documents.getDocument(uri);
|
|
1541
|
-
const usedContext = (
|
|
1495
|
+
const usedContext = ( context.documents.map((docSubArray) => ( docSubArray.map((r) => {
|
|
1542
1496
|
return {
|
|
1543
1497
|
uri: URI.revive(r.uri),
|
|
1544
1498
|
version: r.version,
|
|
1545
|
-
ranges: (
|
|
1499
|
+
ranges: ( r.ranges.map((range) => Range.to(range))),
|
|
1546
1500
|
};
|
|
1547
|
-
}))))
|
|
1501
|
+
}))));
|
|
1548
1502
|
const ctx = {
|
|
1549
1503
|
documents: usedContext,
|
|
1550
1504
|
selections: usedContext[0]?.[0]?.ranges ?? []
|
|
@@ -1569,19 +1523,17 @@ class ExtHostLanguageFeatures {
|
|
|
1569
1523
|
this._logService = _logService;
|
|
1570
1524
|
this._apiDeprecation = _apiDeprecation;
|
|
1571
1525
|
this._extensionTelemetry = _extensionTelemetry;
|
|
1572
|
-
this._adapter = (
|
|
1573
|
-
this._proxy = (
|
|
1526
|
+
this._adapter = ( new Map());
|
|
1527
|
+
this._proxy = ( mainContext.getProxy(MainContext.MainThreadLanguageFeatures));
|
|
1574
1528
|
}
|
|
1575
1529
|
_transformDocumentSelector(selector, extension) {
|
|
1576
1530
|
return DocumentSelector.from(selector, this._uriTransformer, extension);
|
|
1577
1531
|
}
|
|
1578
1532
|
_createDisposable(handle) {
|
|
1579
|
-
return (
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
}))
|
|
1584
|
-
);
|
|
1533
|
+
return ( new Disposable(() => {
|
|
1534
|
+
this._adapter.delete(handle);
|
|
1535
|
+
this._proxy.$unregister(handle);
|
|
1536
|
+
}));
|
|
1585
1537
|
}
|
|
1586
1538
|
_nextHandle() {
|
|
1587
1539
|
return ExtHostLanguageFeatures._handlePool++;
|
|
@@ -1593,7 +1545,7 @@ class ExtHostLanguageFeatures {
|
|
|
1593
1545
|
}
|
|
1594
1546
|
const t1 = Date.now();
|
|
1595
1547
|
if (!doNotLog) {
|
|
1596
|
-
this._logService.trace(`[${data.extension.identifier.value}] INVOKE provider '${(
|
|
1548
|
+
this._logService.trace(`[${data.extension.identifier.value}] INVOKE provider '${( callback.toString()).replace(/[\r\n]/g, '')}'`);
|
|
1597
1549
|
}
|
|
1598
1550
|
const result = callback(data.adapter, data.extension);
|
|
1599
1551
|
Promise.resolve(result).catch(err => {
|
|
@@ -1614,14 +1566,14 @@ class ExtHostLanguageFeatures {
|
|
|
1614
1566
|
}
|
|
1615
1567
|
_addNewAdapter(adapter, extension) {
|
|
1616
1568
|
const handle = this._nextHandle();
|
|
1617
|
-
this._adapter.set(handle, (
|
|
1569
|
+
this._adapter.set(handle, ( new AdapterData(adapter, extension)));
|
|
1618
1570
|
return handle;
|
|
1619
1571
|
}
|
|
1620
1572
|
static _extLabel(ext) {
|
|
1621
1573
|
return ext.displayName || ext.name;
|
|
1622
1574
|
}
|
|
1623
1575
|
registerDocumentSymbolProvider(extension, selector, provider, metadata) {
|
|
1624
|
-
const handle = this._addNewAdapter((
|
|
1576
|
+
const handle = this._addNewAdapter(( new DocumentSymbolAdapter(this._documents, provider)), extension);
|
|
1625
1577
|
const displayName = (metadata && metadata.label) || ExtHostLanguageFeatures._extLabel(extension);
|
|
1626
1578
|
this._proxy.$registerDocumentSymbolProvider(handle, this._transformDocumentSelector(selector, extension), displayName);
|
|
1627
1579
|
return this._createDisposable(handle);
|
|
@@ -1632,10 +1584,7 @@ class ExtHostLanguageFeatures {
|
|
|
1632
1584
|
registerCodeLensProvider(extension, selector, provider) {
|
|
1633
1585
|
const handle = this._nextHandle();
|
|
1634
1586
|
const eventHandle = typeof provider.onDidChangeCodeLenses === 'function' ? this._nextHandle() : undefined;
|
|
1635
|
-
this._adapter.set(handle, (
|
|
1636
|
-
(new CodeLensAdapter(this._documents, this._commands.converter, provider)),
|
|
1637
|
-
extension
|
|
1638
|
-
))));
|
|
1587
|
+
this._adapter.set(handle, ( new AdapterData(( new CodeLensAdapter(this._documents, this._commands.converter, provider)), extension)));
|
|
1639
1588
|
this._proxy.$registerCodeLensSupport(handle, this._transformDocumentSelector(selector, extension), eventHandle);
|
|
1640
1589
|
let result = this._createDisposable(handle);
|
|
1641
1590
|
if (eventHandle !== undefined) {
|
|
@@ -1654,7 +1603,7 @@ class ExtHostLanguageFeatures {
|
|
|
1654
1603
|
this._withAdapter(handle, CodeLensAdapter, adapter => Promise.resolve(adapter.releaseCodeLenses(cacheId)), undefined, undefined);
|
|
1655
1604
|
}
|
|
1656
1605
|
registerDefinitionProvider(extension, selector, provider) {
|
|
1657
|
-
const handle = this._addNewAdapter((
|
|
1606
|
+
const handle = this._addNewAdapter(( new DefinitionAdapter(this._documents, provider)), extension);
|
|
1658
1607
|
this._proxy.$registerDefinitionSupport(handle, this._transformDocumentSelector(selector, extension));
|
|
1659
1608
|
return this._createDisposable(handle);
|
|
1660
1609
|
}
|
|
@@ -1662,7 +1611,7 @@ class ExtHostLanguageFeatures {
|
|
|
1662
1611
|
return this._withAdapter(handle, DefinitionAdapter, adapter => adapter.provideDefinition(URI.revive(resource), position, token), [], token);
|
|
1663
1612
|
}
|
|
1664
1613
|
registerDeclarationProvider(extension, selector, provider) {
|
|
1665
|
-
const handle = this._addNewAdapter((
|
|
1614
|
+
const handle = this._addNewAdapter(( new DeclarationAdapter(this._documents, provider)), extension);
|
|
1666
1615
|
this._proxy.$registerDeclarationSupport(handle, this._transformDocumentSelector(selector, extension));
|
|
1667
1616
|
return this._createDisposable(handle);
|
|
1668
1617
|
}
|
|
@@ -1670,7 +1619,7 @@ class ExtHostLanguageFeatures {
|
|
|
1670
1619
|
return this._withAdapter(handle, DeclarationAdapter, adapter => adapter.provideDeclaration(URI.revive(resource), position, token), [], token);
|
|
1671
1620
|
}
|
|
1672
1621
|
registerImplementationProvider(extension, selector, provider) {
|
|
1673
|
-
const handle = this._addNewAdapter((
|
|
1622
|
+
const handle = this._addNewAdapter(( new ImplementationAdapter(this._documents, provider)), extension);
|
|
1674
1623
|
this._proxy.$registerImplementationSupport(handle, this._transformDocumentSelector(selector, extension));
|
|
1675
1624
|
return this._createDisposable(handle);
|
|
1676
1625
|
}
|
|
@@ -1678,7 +1627,7 @@ class ExtHostLanguageFeatures {
|
|
|
1678
1627
|
return this._withAdapter(handle, ImplementationAdapter, adapter => adapter.provideImplementation(URI.revive(resource), position, token), [], token);
|
|
1679
1628
|
}
|
|
1680
1629
|
registerTypeDefinitionProvider(extension, selector, provider) {
|
|
1681
|
-
const handle = this._addNewAdapter((
|
|
1630
|
+
const handle = this._addNewAdapter(( new TypeDefinitionAdapter(this._documents, provider)), extension);
|
|
1682
1631
|
this._proxy.$registerTypeDefinitionSupport(handle, this._transformDocumentSelector(selector, extension));
|
|
1683
1632
|
return this._createDisposable(handle);
|
|
1684
1633
|
}
|
|
@@ -1686,7 +1635,7 @@ class ExtHostLanguageFeatures {
|
|
|
1686
1635
|
return this._withAdapter(handle, TypeDefinitionAdapter, adapter => adapter.provideTypeDefinition(URI.revive(resource), position, token), [], token);
|
|
1687
1636
|
}
|
|
1688
1637
|
registerHoverProvider(extension, selector, provider, extensionId) {
|
|
1689
|
-
const handle = this._addNewAdapter((
|
|
1638
|
+
const handle = this._addNewAdapter(( new HoverAdapter(this._documents, provider)), extension);
|
|
1690
1639
|
this._proxy.$registerHoverProvider(handle, this._transformDocumentSelector(selector, extension));
|
|
1691
1640
|
return this._createDisposable(handle);
|
|
1692
1641
|
}
|
|
@@ -1694,7 +1643,7 @@ class ExtHostLanguageFeatures {
|
|
|
1694
1643
|
return this._withAdapter(handle, HoverAdapter, adapter => adapter.provideHover(URI.revive(resource), position, token), undefined, token);
|
|
1695
1644
|
}
|
|
1696
1645
|
registerEvaluatableExpressionProvider(extension, selector, provider, extensionId) {
|
|
1697
|
-
const handle = this._addNewAdapter((
|
|
1646
|
+
const handle = this._addNewAdapter(( new EvaluatableExpressionAdapter(this._documents, provider)), extension);
|
|
1698
1647
|
this._proxy.$registerEvaluatableExpressionProvider(handle, this._transformDocumentSelector(selector, extension));
|
|
1699
1648
|
return this._createDisposable(handle);
|
|
1700
1649
|
}
|
|
@@ -1703,7 +1652,7 @@ class ExtHostLanguageFeatures {
|
|
|
1703
1652
|
}
|
|
1704
1653
|
registerInlineValuesProvider(extension, selector, provider, extensionId) {
|
|
1705
1654
|
const eventHandle = typeof provider.onDidChangeInlineValues === 'function' ? this._nextHandle() : undefined;
|
|
1706
|
-
const handle = this._addNewAdapter((
|
|
1655
|
+
const handle = this._addNewAdapter(( new InlineValuesAdapter(this._documents, provider)), extension);
|
|
1707
1656
|
this._proxy.$registerInlineValuesProvider(handle, this._transformDocumentSelector(selector, extension), eventHandle);
|
|
1708
1657
|
let result = this._createDisposable(handle);
|
|
1709
1658
|
if (eventHandle !== undefined) {
|
|
@@ -1716,7 +1665,7 @@ class ExtHostLanguageFeatures {
|
|
|
1716
1665
|
return this._withAdapter(handle, InlineValuesAdapter, adapter => adapter.provideInlineValues(URI.revive(resource), range, context, token), undefined, token);
|
|
1717
1666
|
}
|
|
1718
1667
|
registerDocumentHighlightProvider(extension, selector, provider) {
|
|
1719
|
-
const handle = this._addNewAdapter((
|
|
1668
|
+
const handle = this._addNewAdapter(( new DocumentHighlightAdapter(this._documents, provider)), extension);
|
|
1720
1669
|
this._proxy.$registerDocumentHighlightProvider(handle, this._transformDocumentSelector(selector, extension));
|
|
1721
1670
|
return this._createDisposable(handle);
|
|
1722
1671
|
}
|
|
@@ -1724,7 +1673,7 @@ class ExtHostLanguageFeatures {
|
|
|
1724
1673
|
return this._withAdapter(handle, DocumentHighlightAdapter, adapter => adapter.provideDocumentHighlights(URI.revive(resource), position, token), undefined, token);
|
|
1725
1674
|
}
|
|
1726
1675
|
registerLinkedEditingRangeProvider(extension, selector, provider) {
|
|
1727
|
-
const handle = this._addNewAdapter((
|
|
1676
|
+
const handle = this._addNewAdapter(( new LinkedEditingRangeAdapter(this._documents, provider)), extension);
|
|
1728
1677
|
this._proxy.$registerLinkedEditingRangeProvider(handle, this._transformDocumentSelector(selector, extension));
|
|
1729
1678
|
return this._createDisposable(handle);
|
|
1730
1679
|
}
|
|
@@ -1741,7 +1690,7 @@ class ExtHostLanguageFeatures {
|
|
|
1741
1690
|
}, undefined, token);
|
|
1742
1691
|
}
|
|
1743
1692
|
registerReferenceProvider(extension, selector, provider) {
|
|
1744
|
-
const handle = this._addNewAdapter((
|
|
1693
|
+
const handle = this._addNewAdapter(( new ReferenceAdapter(this._documents, provider)), extension);
|
|
1745
1694
|
this._proxy.$registerReferenceSupport(handle, this._transformDocumentSelector(selector, extension));
|
|
1746
1695
|
return this._createDisposable(handle);
|
|
1747
1696
|
}
|
|
@@ -1749,8 +1698,8 @@ class ExtHostLanguageFeatures {
|
|
|
1749
1698
|
return this._withAdapter(handle, ReferenceAdapter, adapter => adapter.provideReferences(URI.revive(resource), position, context, token), undefined, token);
|
|
1750
1699
|
}
|
|
1751
1700
|
registerCodeActionProvider(extension, selector, provider, metadata) {
|
|
1752
|
-
const store = (
|
|
1753
|
-
const handle = this._addNewAdapter((
|
|
1701
|
+
const store = ( new DisposableStore());
|
|
1702
|
+
const handle = this._addNewAdapter(( new CodeActionAdapter(
|
|
1754
1703
|
this._documents,
|
|
1755
1704
|
this._commands.converter,
|
|
1756
1705
|
this._diagnostics,
|
|
@@ -1758,7 +1707,7 @@ class ExtHostLanguageFeatures {
|
|
|
1758
1707
|
this._logService,
|
|
1759
1708
|
extension,
|
|
1760
1709
|
this._apiDeprecation
|
|
1761
|
-
))
|
|
1710
|
+
)), extension);
|
|
1762
1711
|
this._proxy.$registerQuickFixSupport(handle, this._transformDocumentSelector(selector, extension), {
|
|
1763
1712
|
providedKinds: metadata?.providedCodeActionKinds?.map(kind => kind.value),
|
|
1764
1713
|
documentation: metadata?.documentation?.map(x => ({
|
|
@@ -1779,7 +1728,7 @@ class ExtHostLanguageFeatures {
|
|
|
1779
1728
|
this._withAdapter(handle, CodeActionAdapter, adapter => Promise.resolve(adapter.releaseCodeActions(cacheId)), undefined, undefined);
|
|
1780
1729
|
}
|
|
1781
1730
|
registerDocumentFormattingEditProvider(extension, selector, provider) {
|
|
1782
|
-
const handle = this._addNewAdapter((
|
|
1731
|
+
const handle = this._addNewAdapter(( new DocumentFormattingAdapter(this._documents, provider)), extension);
|
|
1783
1732
|
this._proxy.$registerDocumentFormattingSupport(handle, this._transformDocumentSelector(selector, extension), extension.identifier, extension.displayName || extension.name);
|
|
1784
1733
|
return this._createDisposable(handle);
|
|
1785
1734
|
}
|
|
@@ -1788,7 +1737,7 @@ class ExtHostLanguageFeatures {
|
|
|
1788
1737
|
}
|
|
1789
1738
|
registerDocumentRangeFormattingEditProvider(extension, selector, provider) {
|
|
1790
1739
|
const canFormatMultipleRanges = typeof provider.provideDocumentRangesFormattingEdits === 'function';
|
|
1791
|
-
const handle = this._addNewAdapter((
|
|
1740
|
+
const handle = this._addNewAdapter(( new RangeFormattingAdapter(this._documents, provider)), extension);
|
|
1792
1741
|
this._proxy.$registerRangeFormattingSupport(handle, this._transformDocumentSelector(selector, extension), extension.identifier, extension.displayName || extension.name, canFormatMultipleRanges);
|
|
1793
1742
|
return this._createDisposable(handle);
|
|
1794
1743
|
}
|
|
@@ -1799,7 +1748,7 @@ class ExtHostLanguageFeatures {
|
|
|
1799
1748
|
return this._withAdapter(handle, RangeFormattingAdapter, adapter => adapter.provideDocumentRangesFormattingEdits(URI.revive(resource), ranges, options, token), undefined, token);
|
|
1800
1749
|
}
|
|
1801
1750
|
registerOnTypeFormattingEditProvider(extension, selector, provider, triggerCharacters) {
|
|
1802
|
-
const handle = this._addNewAdapter((
|
|
1751
|
+
const handle = this._addNewAdapter(( new OnTypeFormattingAdapter(this._documents, provider)), extension);
|
|
1803
1752
|
this._proxy.$registerOnTypeFormattingSupport(handle, this._transformDocumentSelector(selector, extension), triggerCharacters, extension.identifier);
|
|
1804
1753
|
return this._createDisposable(handle);
|
|
1805
1754
|
}
|
|
@@ -1807,7 +1756,7 @@ class ExtHostLanguageFeatures {
|
|
|
1807
1756
|
return this._withAdapter(handle, OnTypeFormattingAdapter, adapter => adapter.provideOnTypeFormattingEdits(URI.revive(resource), position, ch, options, token), undefined, token);
|
|
1808
1757
|
}
|
|
1809
1758
|
registerWorkspaceSymbolProvider(extension, provider) {
|
|
1810
|
-
const handle = this._addNewAdapter((
|
|
1759
|
+
const handle = this._addNewAdapter(( new NavigateTypeAdapter(provider, this._logService)), extension);
|
|
1811
1760
|
this._proxy.$registerNavigateTypeSupport(handle, typeof provider.resolveWorkspaceSymbol === 'function');
|
|
1812
1761
|
return this._createDisposable(handle);
|
|
1813
1762
|
}
|
|
@@ -1821,7 +1770,7 @@ class ExtHostLanguageFeatures {
|
|
|
1821
1770
|
this._withAdapter(handle, NavigateTypeAdapter, adapter => adapter.releaseWorkspaceSymbols(id), undefined, undefined);
|
|
1822
1771
|
}
|
|
1823
1772
|
registerRenameProvider(extension, selector, provider) {
|
|
1824
|
-
const handle = this._addNewAdapter((
|
|
1773
|
+
const handle = this._addNewAdapter(( new RenameAdapter(this._documents, provider, this._logService)), extension);
|
|
1825
1774
|
this._proxy.$registerRenameSupport(handle, this._transformDocumentSelector(selector, extension), RenameAdapter.supportsResolving(provider));
|
|
1826
1775
|
return this._createDisposable(handle);
|
|
1827
1776
|
}
|
|
@@ -1832,7 +1781,7 @@ class ExtHostLanguageFeatures {
|
|
|
1832
1781
|
return this._withAdapter(handle, RenameAdapter, adapter => adapter.resolveRenameLocation(URI.revive(resource), position, token), undefined, token);
|
|
1833
1782
|
}
|
|
1834
1783
|
registerDocumentSemanticTokensProvider(extension, selector, provider, legend) {
|
|
1835
|
-
const handle = this._addNewAdapter((
|
|
1784
|
+
const handle = this._addNewAdapter(( new DocumentSemanticTokensAdapter(this._documents, provider)), extension);
|
|
1836
1785
|
const eventHandle = (typeof provider.onDidChangeSemanticTokens === 'function' ? this._nextHandle() : undefined);
|
|
1837
1786
|
this._proxy.$registerDocumentSemanticTokensProvider(handle, this._transformDocumentSelector(selector, extension), legend, eventHandle);
|
|
1838
1787
|
let result = this._createDisposable(handle);
|
|
@@ -1849,7 +1798,7 @@ class ExtHostLanguageFeatures {
|
|
|
1849
1798
|
this._withAdapter(handle, DocumentSemanticTokensAdapter, adapter => adapter.releaseDocumentSemanticColoring(semanticColoringResultId), undefined, undefined);
|
|
1850
1799
|
}
|
|
1851
1800
|
registerDocumentRangeSemanticTokensProvider(extension, selector, provider, legend) {
|
|
1852
|
-
const handle = this._addNewAdapter((
|
|
1801
|
+
const handle = this._addNewAdapter(( new DocumentRangeSemanticTokensAdapter(this._documents, provider)), extension);
|
|
1853
1802
|
this._proxy.$registerDocumentRangeSemanticTokensProvider(handle, this._transformDocumentSelector(selector, extension), legend);
|
|
1854
1803
|
return this._createDisposable(handle);
|
|
1855
1804
|
}
|
|
@@ -1857,13 +1806,13 @@ class ExtHostLanguageFeatures {
|
|
|
1857
1806
|
return this._withAdapter(handle, DocumentRangeSemanticTokensAdapter, adapter => adapter.provideDocumentRangeSemanticTokens(URI.revive(resource), range, token), null, token);
|
|
1858
1807
|
}
|
|
1859
1808
|
registerCompletionItemProvider(extension, selector, provider, triggerCharacters) {
|
|
1860
|
-
const handle = this._addNewAdapter((
|
|
1809
|
+
const handle = this._addNewAdapter(( new CompletionsAdapter(
|
|
1861
1810
|
this._documents,
|
|
1862
1811
|
this._commands.converter,
|
|
1863
1812
|
provider,
|
|
1864
1813
|
this._apiDeprecation,
|
|
1865
1814
|
extension
|
|
1866
|
-
))
|
|
1815
|
+
)), extension);
|
|
1867
1816
|
this._proxy.$registerCompletionsProvider(handle, this._transformDocumentSelector(selector, extension), triggerCharacters, CompletionsAdapter.supportsResolving(provider), extension.identifier);
|
|
1868
1817
|
return this._createDisposable(handle);
|
|
1869
1818
|
}
|
|
@@ -1877,7 +1826,7 @@ class ExtHostLanguageFeatures {
|
|
|
1877
1826
|
this._withAdapter(handle, CompletionsAdapter, adapter => adapter.releaseCompletionItems(id), undefined, undefined);
|
|
1878
1827
|
}
|
|
1879
1828
|
registerInlineCompletionsProvider(extension, selector, provider, metadata) {
|
|
1880
|
-
const adapter = (
|
|
1829
|
+
const adapter = ( new InlineCompletionAdapter(extension, this._documents, provider, this._commands.converter));
|
|
1881
1830
|
const handle = this._addNewAdapter(adapter, extension);
|
|
1882
1831
|
this._proxy.$registerInlineCompletionsSupport(handle, this._transformDocumentSelector(selector, extension), adapter.supportsHandleEvents, ExtensionIdentifier.toKey(extension.identifier.value), metadata?.yieldTo?.map(extId => ExtensionIdentifier.toKey(extId)) || []);
|
|
1883
1832
|
return this._createDisposable(handle);
|
|
@@ -1902,7 +1851,7 @@ class ExtHostLanguageFeatures {
|
|
|
1902
1851
|
const metadata = Array.isArray(metadataOrTriggerChars)
|
|
1903
1852
|
? { triggerCharacters: metadataOrTriggerChars, retriggerCharacters: [] }
|
|
1904
1853
|
: metadataOrTriggerChars;
|
|
1905
|
-
const handle = this._addNewAdapter((
|
|
1854
|
+
const handle = this._addNewAdapter(( new SignatureHelpAdapter(this._documents, provider)), extension);
|
|
1906
1855
|
this._proxy.$registerSignatureHelpProvider(handle, this._transformDocumentSelector(selector, extension), metadata);
|
|
1907
1856
|
return this._createDisposable(handle);
|
|
1908
1857
|
}
|
|
@@ -1914,13 +1863,13 @@ class ExtHostLanguageFeatures {
|
|
|
1914
1863
|
}
|
|
1915
1864
|
registerInlayHintsProvider(extension, selector, provider) {
|
|
1916
1865
|
const eventHandle = typeof provider.onDidChangeInlayHints === 'function' ? this._nextHandle() : undefined;
|
|
1917
|
-
const handle = this._addNewAdapter((
|
|
1866
|
+
const handle = this._addNewAdapter(( new InlayHintsAdapter(
|
|
1918
1867
|
this._documents,
|
|
1919
1868
|
this._commands.converter,
|
|
1920
1869
|
provider,
|
|
1921
1870
|
this._logService,
|
|
1922
1871
|
extension
|
|
1923
|
-
))
|
|
1872
|
+
)), extension);
|
|
1924
1873
|
this._proxy.$registerInlayHintsProvider(handle, this._transformDocumentSelector(selector, extension), typeof provider.resolveInlayHint === 'function', eventHandle, ExtHostLanguageFeatures._extLabel(extension));
|
|
1925
1874
|
let result = this._createDisposable(handle);
|
|
1926
1875
|
if (eventHandle !== undefined) {
|
|
@@ -1939,7 +1888,7 @@ class ExtHostLanguageFeatures {
|
|
|
1939
1888
|
this._withAdapter(handle, InlayHintsAdapter, adapter => adapter.releaseHints(id), undefined, undefined);
|
|
1940
1889
|
}
|
|
1941
1890
|
registerDocumentLinkProvider(extension, selector, provider) {
|
|
1942
|
-
const handle = this._addNewAdapter((
|
|
1891
|
+
const handle = this._addNewAdapter(( new LinkProviderAdapter(this._documents, provider)), extension);
|
|
1943
1892
|
this._proxy.$registerDocumentLinkProvider(handle, this._transformDocumentSelector(selector, extension), typeof provider.resolveDocumentLink === 'function');
|
|
1944
1893
|
return this._createDisposable(handle);
|
|
1945
1894
|
}
|
|
@@ -1953,7 +1902,7 @@ class ExtHostLanguageFeatures {
|
|
|
1953
1902
|
this._withAdapter(handle, LinkProviderAdapter, adapter => adapter.releaseLinks(id), undefined, undefined, true);
|
|
1954
1903
|
}
|
|
1955
1904
|
registerColorProvider(extension, selector, provider) {
|
|
1956
|
-
const handle = this._addNewAdapter((
|
|
1905
|
+
const handle = this._addNewAdapter(( new ColorProviderAdapter(this._documents, provider)), extension);
|
|
1957
1906
|
this._proxy.$registerDocumentColorProvider(handle, this._transformDocumentSelector(selector, extension));
|
|
1958
1907
|
return this._createDisposable(handle);
|
|
1959
1908
|
}
|
|
@@ -1966,10 +1915,7 @@ class ExtHostLanguageFeatures {
|
|
|
1966
1915
|
registerFoldingRangeProvider(extension, selector, provider) {
|
|
1967
1916
|
const handle = this._nextHandle();
|
|
1968
1917
|
const eventHandle = typeof provider.onDidChangeFoldingRanges === 'function' ? this._nextHandle() : undefined;
|
|
1969
|
-
this._adapter.set(handle, (
|
|
1970
|
-
(new FoldingProviderAdapter(this._documents, provider)),
|
|
1971
|
-
extension
|
|
1972
|
-
))));
|
|
1918
|
+
this._adapter.set(handle, ( new AdapterData(( new FoldingProviderAdapter(this._documents, provider)), extension)));
|
|
1973
1919
|
this._proxy.$registerFoldingRangeProvider(handle, this._transformDocumentSelector(selector, extension), extension.identifier, eventHandle);
|
|
1974
1920
|
let result = this._createDisposable(handle);
|
|
1975
1921
|
if (eventHandle !== undefined) {
|
|
@@ -1982,7 +1928,7 @@ class ExtHostLanguageFeatures {
|
|
|
1982
1928
|
return this._withAdapter(handle, FoldingProviderAdapter, (adapter) => adapter.provideFoldingRanges(URI.revive(resource), context, token), undefined, token);
|
|
1983
1929
|
}
|
|
1984
1930
|
registerSelectionRangeProvider(extension, selector, provider) {
|
|
1985
|
-
const handle = this._addNewAdapter((
|
|
1931
|
+
const handle = this._addNewAdapter(( new SelectionRangeAdapter(this._documents, provider, this._logService)), extension);
|
|
1986
1932
|
this._proxy.$registerSelectionRangeProvider(handle, this._transformDocumentSelector(selector, extension));
|
|
1987
1933
|
return this._createDisposable(handle);
|
|
1988
1934
|
}
|
|
@@ -1990,7 +1936,7 @@ class ExtHostLanguageFeatures {
|
|
|
1990
1936
|
return this._withAdapter(handle, SelectionRangeAdapter, adapter => adapter.provideSelectionRanges(URI.revive(resource), positions, token), [], token);
|
|
1991
1937
|
}
|
|
1992
1938
|
registerCallHierarchyProvider(extension, selector, provider) {
|
|
1993
|
-
const handle = this._addNewAdapter((
|
|
1939
|
+
const handle = this._addNewAdapter(( new CallHierarchyAdapter(this._documents, provider)), extension);
|
|
1994
1940
|
this._proxy.$registerCallHierarchyProvider(handle, this._transformDocumentSelector(selector, extension));
|
|
1995
1941
|
return this._createDisposable(handle);
|
|
1996
1942
|
}
|
|
@@ -2007,7 +1953,7 @@ class ExtHostLanguageFeatures {
|
|
|
2007
1953
|
this._withAdapter(handle, CallHierarchyAdapter, adapter => Promise.resolve(adapter.releaseSession(sessionId)), undefined, undefined);
|
|
2008
1954
|
}
|
|
2009
1955
|
registerTypeHierarchyProvider(extension, selector, provider) {
|
|
2010
|
-
const handle = this._addNewAdapter((
|
|
1956
|
+
const handle = this._addNewAdapter(( new TypeHierarchyAdapter(this._documents, provider)), extension);
|
|
2011
1957
|
this._proxy.$registerTypeHierarchyProvider(handle, this._transformDocumentSelector(selector, extension));
|
|
2012
1958
|
return this._createDisposable(handle);
|
|
2013
1959
|
}
|
|
@@ -2025,10 +1971,7 @@ class ExtHostLanguageFeatures {
|
|
|
2025
1971
|
}
|
|
2026
1972
|
registerDocumentOnDropEditProvider(extension, selector, provider, metadata) {
|
|
2027
1973
|
const handle = this._nextHandle();
|
|
2028
|
-
this._adapter.set(handle, (
|
|
2029
|
-
(new DocumentOnDropEditAdapter(this._proxy, this._documents, provider, handle, extension)),
|
|
2030
|
-
extension
|
|
2031
|
-
))));
|
|
1974
|
+
this._adapter.set(handle, ( new AdapterData(( new DocumentOnDropEditAdapter(this._proxy, this._documents, provider, handle, extension)), extension)));
|
|
2032
1975
|
const id = isProposedApiEnabled(extension, 'dropMetadata') && metadata ? DocumentOnDropEditAdapter.toInternalProviderId(extension.identifier.value, metadata.id) : undefined;
|
|
2033
1976
|
this._proxy.$registerDocumentOnDropEditProvider(handle, this._transformDocumentSelector(selector, extension), id, isProposedApiEnabled(extension, 'dropMetadata') ? metadata : undefined);
|
|
2034
1977
|
return this._createDisposable(handle);
|
|
@@ -2037,7 +1980,7 @@ class ExtHostLanguageFeatures {
|
|
|
2037
1980
|
return this._withAdapter(handle, DocumentOnDropEditAdapter, adapter => Promise.resolve(adapter.provideDocumentOnDropEdits(requestId, URI.revive(resource), position, dataTransferDto, token)), undefined, undefined);
|
|
2038
1981
|
}
|
|
2039
1982
|
registerMappedEditsProvider(extension, selector, provider) {
|
|
2040
|
-
const handle = this._addNewAdapter((
|
|
1983
|
+
const handle = this._addNewAdapter(( new MappedEditsAdapter(this._documents, provider)), extension);
|
|
2041
1984
|
this._proxy.$registerMappedEditsProvider(handle, this._transformDocumentSelector(selector, extension));
|
|
2042
1985
|
return this._createDisposable(handle);
|
|
2043
1986
|
}
|
|
@@ -2046,10 +1989,7 @@ class ExtHostLanguageFeatures {
|
|
|
2046
1989
|
}
|
|
2047
1990
|
registerDocumentPasteEditProvider(extension, selector, provider, metadata) {
|
|
2048
1991
|
const handle = this._nextHandle();
|
|
2049
|
-
this._adapter.set(handle, (
|
|
2050
|
-
(new DocumentPasteEditProvider(this._proxy, this._documents, provider, handle, extension)),
|
|
2051
|
-
extension
|
|
2052
|
-
))));
|
|
1992
|
+
this._adapter.set(handle, ( new AdapterData(( new DocumentPasteEditProvider(this._proxy, this._documents, provider, handle, extension)), extension)));
|
|
2053
1993
|
const internalId = DocumentPasteEditProvider.toInternalProviderId(extension.identifier.value, metadata.id);
|
|
2054
1994
|
this._proxy.$registerPasteEditProvider(handle, this._transformDocumentSelector(selector, extension), internalId, {
|
|
2055
1995
|
supportsCopy: !!provider.prepareDocumentPaste,
|
|
@@ -2088,21 +2028,17 @@ class ExtHostLanguageFeatures {
|
|
|
2088
2028
|
};
|
|
2089
2029
|
}
|
|
2090
2030
|
static _serializeOnEnterRules(onEnterRules) {
|
|
2091
|
-
return (
|
|
2092
|
-
(onEnterRules.map(ExtHostLanguageFeatures._serializeOnEnterRule))
|
|
2093
|
-
);
|
|
2031
|
+
return ( onEnterRules.map(ExtHostLanguageFeatures._serializeOnEnterRule));
|
|
2094
2032
|
}
|
|
2095
2033
|
static _serializeAutoClosingPair(autoClosingPair) {
|
|
2096
2034
|
return {
|
|
2097
2035
|
open: autoClosingPair.open,
|
|
2098
2036
|
close: autoClosingPair.close,
|
|
2099
|
-
notIn: autoClosingPair.notIn ? (
|
|
2037
|
+
notIn: autoClosingPair.notIn ? ( autoClosingPair.notIn.map(v => ( SyntaxTokenType.toString(v)))) : undefined,
|
|
2100
2038
|
};
|
|
2101
2039
|
}
|
|
2102
2040
|
static _serializeAutoClosingPairs(autoClosingPairs) {
|
|
2103
|
-
return (
|
|
2104
|
-
(autoClosingPairs.map(ExtHostLanguageFeatures._serializeAutoClosingPair))
|
|
2105
|
-
);
|
|
2041
|
+
return ( autoClosingPairs.map(ExtHostLanguageFeatures._serializeAutoClosingPair));
|
|
2106
2042
|
}
|
|
2107
2043
|
setLanguageConfiguration(extension, languageId, configuration) {
|
|
2108
2044
|
const { wordPattern } = configuration;
|
|
@@ -2137,7 +2073,7 @@ class ExtHostLanguageFeatures {
|
|
|
2137
2073
|
}
|
|
2138
2074
|
$setWordDefinitions(wordDefinitions) {
|
|
2139
2075
|
for (const wordDefinition of wordDefinitions) {
|
|
2140
|
-
this._documents.setWordDefinitionFor(wordDefinition.languageId, (
|
|
2076
|
+
this._documents.setWordDefinitionFor(wordDefinition.languageId, ( new RegExp(wordDefinition.regexSource, wordDefinition.regexFlags)));
|
|
2141
2077
|
}
|
|
2142
2078
|
}
|
|
2143
2079
|
}
|