@codingame/monaco-languageclient-wrapper 5.0.0-next.0 → 5.0.0-next.1
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/_virtual/_commonjsHelpers.js +32 -0
- package/dist/_virtual/_rollupPluginBabelHelpers.js +50 -0
- package/dist/_virtual/_vscode.js +4 -0
- package/dist/_virtual/api.js +2 -0
- package/dist/_virtual/api2.js +2 -0
- package/dist/_virtual/api3.js +2 -0
- package/dist/_virtual/async.js +2 -0
- package/dist/_virtual/callHierarchy.js +2 -0
- package/dist/_virtual/cancellation.js +2 -0
- package/dist/_virtual/client.js +2 -0
- package/dist/_virtual/codeAction.js +2 -0
- package/dist/_virtual/codeConverter.js +2 -0
- package/dist/_virtual/codeLens.js +2 -0
- package/dist/_virtual/colorProvider.js +2 -0
- package/dist/_virtual/completion.js +2 -0
- package/dist/_virtual/configuration.js +2 -0
- package/dist/_virtual/connection.js +2 -0
- package/dist/_virtual/connection2.js +2 -0
- package/dist/_virtual/declaration.js +2 -0
- package/dist/_virtual/definition.js +2 -0
- package/dist/_virtual/diagnostic.js +2 -0
- package/dist/_virtual/disposable.js +2 -0
- package/dist/_virtual/documentHighlight.js +2 -0
- package/dist/_virtual/documentLink.js +2 -0
- package/dist/_virtual/documentSymbol.js +2 -0
- package/dist/_virtual/events.js +2 -0
- package/dist/_virtual/executeCommand.js +2 -0
- package/dist/_virtual/features.js +2 -0
- package/dist/_virtual/fileOperations.js +2 -0
- package/dist/_virtual/fileSystemWatcher.js +2 -0
- package/dist/_virtual/foldingRange.js +2 -0
- package/dist/_virtual/formatting.js +2 -0
- package/dist/_virtual/hover.js +2 -0
- package/dist/_virtual/implementation.js +2 -0
- package/dist/_virtual/inlayHint.js +2 -0
- package/dist/_virtual/inlineValue.js +2 -0
- package/dist/_virtual/is.js +2 -0
- package/dist/_virtual/is2.js +2 -0
- package/dist/_virtual/is3.js +2 -0
- package/dist/_virtual/linkedEditingRange.js +2 -0
- package/dist/_virtual/linkedMap.js +2 -0
- package/dist/_virtual/main.js +2 -0
- package/dist/_virtual/main2.js +2 -0
- package/dist/_virtual/main3.js +2 -0
- package/dist/_virtual/main4.js +4 -0
- package/dist/_virtual/messageBuffer.js +2 -0
- package/dist/_virtual/messageReader.js +2 -0
- package/dist/_virtual/messageWriter.js +2 -0
- package/dist/_virtual/messages.js +2 -0
- package/dist/_virtual/messages2.js +2 -0
- package/dist/_virtual/notebook.js +2 -0
- package/dist/_virtual/once.js +2 -0
- package/dist/_virtual/path.js +4 -0
- package/dist/_virtual/progress.js +2 -0
- package/dist/_virtual/progressPart.js +2 -0
- package/dist/_virtual/protocol.callHierarchy.js +2 -0
- package/dist/_virtual/protocol.colorProvider.js +2 -0
- package/dist/_virtual/protocol.configuration.js +2 -0
- package/dist/_virtual/protocol.declaration.js +2 -0
- package/dist/_virtual/protocol.diagnostic.js +2 -0
- package/dist/_virtual/protocol.fileOperations.js +2 -0
- package/dist/_virtual/protocol.foldingRange.js +2 -0
- package/dist/_virtual/protocol.implementation.js +2 -0
- package/dist/_virtual/protocol.inlayHint.js +2 -0
- package/dist/_virtual/protocol.inlineValue.js +2 -0
- package/dist/_virtual/protocol.js +2 -0
- package/dist/_virtual/protocol.linkedEditingRange.js +2 -0
- package/dist/_virtual/protocol.moniker.js +2 -0
- package/dist/_virtual/protocol.notebook.js +2 -0
- package/dist/_virtual/protocol.progress.js +2 -0
- package/dist/_virtual/protocol.selectionRange.js +2 -0
- package/dist/_virtual/protocol.semanticTokens.js +2 -0
- package/dist/_virtual/protocol.showDocument.js +2 -0
- package/dist/_virtual/protocol.typeDefinition.js +2 -0
- package/dist/_virtual/protocol.typeHierarchy.js +2 -0
- package/dist/_virtual/protocol.workspaceFolder.js +2 -0
- package/dist/_virtual/protocolCallHierarchyItem.js +2 -0
- package/dist/_virtual/protocolCodeAction.js +2 -0
- package/dist/_virtual/protocolCodeLens.js +2 -0
- package/dist/_virtual/protocolCompletionItem.js +2 -0
- package/dist/_virtual/protocolConverter.js +2 -0
- package/dist/_virtual/protocolDiagnostic.js +2 -0
- package/dist/_virtual/protocolDocumentLink.js +2 -0
- package/dist/_virtual/protocolInlayHint.js +2 -0
- package/dist/_virtual/protocolTypeHierarchyItem.js +2 -0
- package/dist/_virtual/protocolWorkspaceSymbol.js +2 -0
- package/dist/_virtual/ral.js +2 -0
- package/dist/_virtual/reference.js +2 -0
- package/dist/_virtual/rename.js +2 -0
- package/dist/_virtual/ril.js +2 -0
- package/dist/_virtual/selectionRange.js +2 -0
- package/dist/_virtual/semanticTokens.js +2 -0
- package/dist/_virtual/semaphore.js +2 -0
- package/dist/_virtual/sharedArrayCancellation.js +2 -0
- package/dist/_virtual/signatureHelp.js +2 -0
- package/dist/_virtual/textSynchronization.js +2 -0
- package/dist/_virtual/typeDefinition.js +2 -0
- package/dist/_virtual/typeHierarchy.js +2 -0
- package/dist/_virtual/uuid.js +2 -0
- package/dist/_virtual/workspaceFolder.js +2 -0
- package/dist/_virtual/workspaceSymbol.js +2 -0
- package/dist/extensions/java/commands.js +74 -0
- package/dist/extensions/java/extension.js +13 -0
- package/dist/extensions/java/inlayHintsProvider.js +59 -0
- package/dist/extensions/java/protocol.js +69 -0
- package/dist/{java.js → extensions/java/sourceAction.js} +6 -244
- package/dist/index.d.ts +1 -2
- package/dist/index.js +5 -1
- package/dist/node_modules/balanced-match/index.js +52 -0
- package/dist/node_modules/delay/index.js +46 -0
- package/dist/node_modules/monaco-languageclient/lib/monaco-language-client.js +127 -0
- package/dist/node_modules/once/once.js +44 -0
- package/dist/node_modules/tslib/tslib.es6.js +14 -0
- package/dist/node_modules/vscode-jsonrpc/browser.js +4 -0
- package/dist/node_modules/vscode-jsonrpc/lib/browser/main.js +77 -0
- package/dist/node_modules/vscode-jsonrpc/lib/browser/ril.js +153 -0
- package/dist/node_modules/vscode-jsonrpc/lib/common/api.js +96 -0
- package/dist/node_modules/vscode-jsonrpc/lib/common/cancellation.js +97 -0
- package/dist/node_modules/vscode-jsonrpc/lib/common/connection.js +1180 -0
- package/dist/node_modules/vscode-jsonrpc/lib/common/disposable.js +20 -0
- package/dist/node_modules/vscode-jsonrpc/lib/common/events.js +122 -0
- package/dist/node_modules/vscode-jsonrpc/lib/common/is.js +38 -0
- package/dist/node_modules/vscode-jsonrpc/lib/common/linkedMap.js +388 -0
- package/dist/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js +149 -0
- package/dist/node_modules/vscode-jsonrpc/lib/common/messageReader.js +194 -0
- package/dist/node_modules/vscode-jsonrpc/lib/common/messageWriter.js +123 -0
- package/dist/node_modules/vscode-jsonrpc/lib/common/messages.js +241 -0
- package/dist/node_modules/vscode-jsonrpc/lib/common/ral.js +26 -0
- package/dist/node_modules/vscode-jsonrpc/lib/common/semaphore.js +72 -0
- package/dist/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +80 -0
- package/dist/node_modules/vscode-languageclient/lib/browser/main.js +49 -0
- package/dist/node_modules/vscode-languageclient/lib/common/api.js +51 -0
- package/dist/node_modules/vscode-languageclient/lib/common/callHierarchy.js +98 -0
- package/dist/node_modules/vscode-languageclient/lib/common/client.js +1527 -0
- package/dist/node_modules/vscode-languageclient/lib/common/codeAction.js +92 -0
- package/dist/node_modules/vscode-languageclient/lib/common/codeConverter.js +881 -0
- package/dist/node_modules/vscode-languageclient/lib/common/codeLens.js +84 -0
- package/dist/node_modules/vscode-languageclient/lib/common/colorProvider.js +77 -0
- package/dist/node_modules/vscode-languageclient/lib/common/completion.js +105 -0
- package/dist/node_modules/vscode-languageclient/lib/common/configuration.js +214 -0
- package/dist/node_modules/vscode-languageclient/lib/common/declaration.js +59 -0
- package/dist/node_modules/vscode-languageclient/lib/common/definition.js +62 -0
- package/dist/node_modules/vscode-languageclient/lib/common/diagnostic.js +839 -0
- package/dist/node_modules/vscode-languageclient/lib/common/documentHighlight.js +57 -0
- package/dist/node_modules/vscode-languageclient/lib/common/documentLink.js +74 -0
- package/dist/node_modules/vscode-languageclient/lib/common/documentSymbol.js +82 -0
- package/dist/node_modules/vscode-languageclient/lib/common/executeCommand.js +83 -0
- package/dist/node_modules/vscode-languageclient/lib/common/features.js +310 -0
- package/dist/node_modules/vscode-languageclient/lib/common/fileOperations.js +319 -0
- package/dist/node_modules/vscode-languageclient/lib/common/fileSystemWatcher.js +104 -0
- package/dist/node_modules/vscode-languageclient/lib/common/foldingRange.js +66 -0
- package/dist/node_modules/vscode-languageclient/lib/common/formatting.js +165 -0
- package/dist/node_modules/vscode-languageclient/lib/common/hover.js +62 -0
- package/dist/node_modules/vscode-languageclient/lib/common/implementation.js +59 -0
- package/dist/node_modules/vscode-languageclient/lib/common/inlayHint.js +94 -0
- package/dist/node_modules/vscode-languageclient/lib/common/inlineValue.js +73 -0
- package/dist/node_modules/vscode-languageclient/lib/common/linkedEditingRange.js +58 -0
- package/dist/node_modules/vscode-languageclient/lib/common/notebook.js +858 -0
- package/dist/node_modules/vscode-languageclient/lib/common/progress.js +51 -0
- package/dist/node_modules/vscode-languageclient/lib/common/progressPart.js +107 -0
- package/dist/node_modules/vscode-languageclient/lib/common/protocolCallHierarchyItem.js +15 -0
- package/dist/node_modules/vscode-languageclient/lib/common/protocolCodeAction.js +13 -0
- package/dist/node_modules/vscode-languageclient/lib/common/protocolCodeLens.js +12 -0
- package/dist/node_modules/vscode-languageclient/lib/common/protocolCompletionItem.js +12 -0
- package/dist/node_modules/vscode-languageclient/lib/common/protocolConverter.js +1129 -0
- package/dist/node_modules/vscode-languageclient/lib/common/protocolDiagnostic.js +27 -0
- package/dist/node_modules/vscode-languageclient/lib/common/protocolDocumentLink.js +12 -0
- package/dist/node_modules/vscode-languageclient/lib/common/protocolInlayHint.js +12 -0
- package/dist/node_modules/vscode-languageclient/lib/common/protocolTypeHierarchyItem.js +15 -0
- package/dist/node_modules/vscode-languageclient/lib/common/protocolWorkspaceSymbol.js +17 -0
- package/dist/node_modules/vscode-languageclient/lib/common/reference.js +60 -0
- package/dist/node_modules/vscode-languageclient/lib/common/rename.js +112 -0
- package/dist/node_modules/vscode-languageclient/lib/common/selectionRange.js +62 -0
- package/dist/node_modules/vscode-languageclient/lib/common/semanticTokens.js +144 -0
- package/dist/node_modules/vscode-languageclient/lib/common/signatureHelp.js +78 -0
- package/dist/node_modules/vscode-languageclient/lib/common/textSynchronization.js +422 -0
- package/dist/node_modules/vscode-languageclient/lib/common/typeDefinition.js +60 -0
- package/dist/node_modules/vscode-languageclient/lib/common/typeHierarchy.js +97 -0
- package/dist/node_modules/vscode-languageclient/lib/common/utils/async.js +269 -0
- package/dist/node_modules/vscode-languageclient/lib/common/utils/is.js +54 -0
- package/dist/node_modules/vscode-languageclient/lib/common/utils/uuid.js +51 -0
- package/dist/node_modules/vscode-languageclient/lib/common/workspaceFolder.js +154 -0
- package/dist/node_modules/vscode-languageclient/lib/common/workspaceSymbol.js +87 -0
- package/dist/node_modules/vscode-languageclient/node_modules/brace-expansion/index.js +160 -0
- package/dist/node_modules/vscode-languageclient/node_modules/minimatch/lib/path.js +2 -0
- package/dist/node_modules/vscode-languageclient/node_modules/minimatch/minimatch.js +567 -0
- package/dist/node_modules/vscode-languageserver-protocol/browser.js +4 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/browser/main.js +30 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/api.js +43 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/connection.js +14 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/messages.js +43 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js +23 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js +18 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js +13 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js +13 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js +42 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js +42 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js +13 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js +13 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js +23 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js +18 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.js +494 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js +13 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js +25 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js +185 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js +28 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js +13 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js +39 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js +13 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js +13 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js +23 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js +18 -0
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js +40 -0
- package/dist/node_modules/vscode-languageserver-types/lib/esm/main.js +1583 -0
- package/dist/node_modules/wrappy/wrappy.js +25 -0
- package/dist/src/createLanguageClient.js +107 -0
- package/dist/src/customRequests.js +21 -0
- package/dist/src/extensionConfiguration.js +5 -0
- package/dist/{cobol.js → src/extensions/cobol.js} +3 -2
- package/dist/{csharp.js → src/extensions/csharp.js} +3 -2
- package/dist/src/extensions/java.js +36 -0
- package/dist/{tools.js → src/extensions/tools.js} +2 -2
- package/dist/src/extensions.js +170 -0
- package/dist/src/infrastructure.js +68 -0
- package/dist/src/languageClient.js +308 -0
- package/dist/src/languageClientOptions.js +17 -0
- package/dist/src/services.js +8 -0
- package/dist/src/staticOptions.js +441 -0
- package/package.json +31 -32
- package/stats.html +1 -1
- package/dist/index2.js +0 -17150
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { __exports as async } from '../../../../../_virtual/async.js';
|
|
2
|
+
import { __exports as main } from '../../../../../_virtual/main.js';
|
|
3
|
+
import '../../../../vscode-languageserver-protocol/lib/browser/main.js';
|
|
4
|
+
Object.defineProperty(async, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
async.forEach = async.mapAsync = async.map = async.clearTestMode = async.setTestMode = async.Semaphore = async.Delayer = void 0;
|
|
8
|
+
const vscode_languageserver_protocol_1 = main;
|
|
9
|
+
class Delayer {
|
|
10
|
+
constructor(defaultDelay) {
|
|
11
|
+
this.defaultDelay = defaultDelay;
|
|
12
|
+
this.timeout = undefined;
|
|
13
|
+
this.completionPromise = undefined;
|
|
14
|
+
this.onSuccess = undefined;
|
|
15
|
+
this.task = undefined;
|
|
16
|
+
}
|
|
17
|
+
trigger(task) {
|
|
18
|
+
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.defaultDelay;
|
|
19
|
+
this.task = task;
|
|
20
|
+
if (delay >= 0) {
|
|
21
|
+
this.cancelTimeout();
|
|
22
|
+
}
|
|
23
|
+
if (!this.completionPromise) {
|
|
24
|
+
this.completionPromise = new Promise(resolve => {
|
|
25
|
+
this.onSuccess = resolve;
|
|
26
|
+
}).then(() => {
|
|
27
|
+
this.completionPromise = undefined;
|
|
28
|
+
this.onSuccess = undefined;
|
|
29
|
+
var result = this.task();
|
|
30
|
+
this.task = undefined;
|
|
31
|
+
return result;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (delay >= 0 || this.timeout === void 0) {
|
|
35
|
+
this.timeout = (0, vscode_languageserver_protocol_1.RAL)().timer.setTimeout(() => {
|
|
36
|
+
this.timeout = undefined;
|
|
37
|
+
this.onSuccess(undefined);
|
|
38
|
+
}, delay >= 0 ? delay : this.defaultDelay);
|
|
39
|
+
}
|
|
40
|
+
return this.completionPromise;
|
|
41
|
+
}
|
|
42
|
+
forceDelivery() {
|
|
43
|
+
if (!this.completionPromise) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
this.cancelTimeout();
|
|
47
|
+
let result = this.task();
|
|
48
|
+
this.completionPromise = undefined;
|
|
49
|
+
this.onSuccess = undefined;
|
|
50
|
+
this.task = undefined;
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
isTriggered() {
|
|
54
|
+
return this.timeout !== undefined;
|
|
55
|
+
}
|
|
56
|
+
cancel() {
|
|
57
|
+
this.cancelTimeout();
|
|
58
|
+
this.completionPromise = undefined;
|
|
59
|
+
}
|
|
60
|
+
cancelTimeout() {
|
|
61
|
+
if (this.timeout !== undefined) {
|
|
62
|
+
this.timeout.dispose();
|
|
63
|
+
this.timeout = undefined;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async.Delayer = Delayer;
|
|
68
|
+
class Semaphore {
|
|
69
|
+
constructor() {
|
|
70
|
+
let capacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
71
|
+
if (capacity <= 0) {
|
|
72
|
+
throw new Error('Capacity must be greater than 0');
|
|
73
|
+
}
|
|
74
|
+
this._capacity = capacity;
|
|
75
|
+
this._active = 0;
|
|
76
|
+
this._waiting = [];
|
|
77
|
+
}
|
|
78
|
+
lock(thunk) {
|
|
79
|
+
return new Promise((resolve, reject) => {
|
|
80
|
+
this._waiting.push({
|
|
81
|
+
thunk,
|
|
82
|
+
resolve,
|
|
83
|
+
reject
|
|
84
|
+
});
|
|
85
|
+
this.runNext();
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
get active() {
|
|
89
|
+
return this._active;
|
|
90
|
+
}
|
|
91
|
+
runNext() {
|
|
92
|
+
if (this._waiting.length === 0 || this._active === this._capacity) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
(0, vscode_languageserver_protocol_1.RAL)().timer.setImmediate(() => this.doRunNext());
|
|
96
|
+
}
|
|
97
|
+
doRunNext() {
|
|
98
|
+
if (this._waiting.length === 0 || this._active === this._capacity) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const next = this._waiting.shift();
|
|
102
|
+
this._active++;
|
|
103
|
+
if (this._active > this._capacity) {
|
|
104
|
+
throw new Error("To many thunks active");
|
|
105
|
+
}
|
|
106
|
+
try {
|
|
107
|
+
const result = next.thunk();
|
|
108
|
+
if (result instanceof Promise) {
|
|
109
|
+
result.then(value => {
|
|
110
|
+
this._active--;
|
|
111
|
+
next.resolve(value);
|
|
112
|
+
this.runNext();
|
|
113
|
+
}, err => {
|
|
114
|
+
this._active--;
|
|
115
|
+
next.reject(err);
|
|
116
|
+
this.runNext();
|
|
117
|
+
});
|
|
118
|
+
} else {
|
|
119
|
+
this._active--;
|
|
120
|
+
next.resolve(result);
|
|
121
|
+
this.runNext();
|
|
122
|
+
}
|
|
123
|
+
} catch (err) {
|
|
124
|
+
this._active--;
|
|
125
|
+
next.reject(err);
|
|
126
|
+
this.runNext();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
async.Semaphore = Semaphore;
|
|
131
|
+
let $test = false;
|
|
132
|
+
function setTestMode() {
|
|
133
|
+
$test = true;
|
|
134
|
+
}
|
|
135
|
+
async.setTestMode = setTestMode;
|
|
136
|
+
function clearTestMode() {
|
|
137
|
+
$test = false;
|
|
138
|
+
}
|
|
139
|
+
async.clearTestMode = clearTestMode;
|
|
140
|
+
const defaultYieldTimeout = 15 ;
|
|
141
|
+
class Timer {
|
|
142
|
+
constructor() {
|
|
143
|
+
let yieldAfter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultYieldTimeout;
|
|
144
|
+
this.yieldAfter = $test === true ? Math.max(yieldAfter, 2) : Math.max(yieldAfter, defaultYieldTimeout);
|
|
145
|
+
this.startTime = Date.now();
|
|
146
|
+
this.counter = 0;
|
|
147
|
+
this.total = 0;
|
|
148
|
+
this.counterInterval = 1;
|
|
149
|
+
}
|
|
150
|
+
start() {
|
|
151
|
+
this.counter = 0;
|
|
152
|
+
this.total = 0;
|
|
153
|
+
this.counterInterval = 1;
|
|
154
|
+
this.startTime = Date.now();
|
|
155
|
+
}
|
|
156
|
+
shouldYield() {
|
|
157
|
+
if (++this.counter >= this.counterInterval) {
|
|
158
|
+
const timeTaken = Date.now() - this.startTime;
|
|
159
|
+
const timeLeft = Math.max(0, this.yieldAfter - timeTaken);
|
|
160
|
+
this.total += this.counter;
|
|
161
|
+
this.counter = 0;
|
|
162
|
+
if (timeTaken >= this.yieldAfter || timeLeft <= 1) {
|
|
163
|
+
this.counterInterval = 1;
|
|
164
|
+
this.total = 0;
|
|
165
|
+
return true;
|
|
166
|
+
} else {
|
|
167
|
+
switch (timeTaken) {
|
|
168
|
+
case 0:
|
|
169
|
+
case 1:
|
|
170
|
+
this.counterInterval = this.total * 2;
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
async function map(items, func, token, options) {
|
|
179
|
+
if (items.length === 0) {
|
|
180
|
+
return [];
|
|
181
|
+
}
|
|
182
|
+
const result = new Array(items.length);
|
|
183
|
+
const timer = new Timer(options === null || options === void 0 ? void 0 : options.yieldAfter);
|
|
184
|
+
function convertBatch(start) {
|
|
185
|
+
timer.start();
|
|
186
|
+
for (let i = start; i < items.length; i++) {
|
|
187
|
+
result[i] = func(items[i]);
|
|
188
|
+
if (timer.shouldYield()) {
|
|
189
|
+
(options === null || options === void 0 ? void 0 : options.yieldCallback) && options.yieldCallback();
|
|
190
|
+
return i + 1;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return -1;
|
|
194
|
+
}
|
|
195
|
+
let index = convertBatch(0);
|
|
196
|
+
while (index !== -1) {
|
|
197
|
+
if (token !== undefined && token.isCancellationRequested) {
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
index = await new Promise(resolve => {
|
|
201
|
+
(0, vscode_languageserver_protocol_1.RAL)().timer.setImmediate(() => {
|
|
202
|
+
resolve(convertBatch(index));
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
return result;
|
|
207
|
+
}
|
|
208
|
+
async.map = map;
|
|
209
|
+
async function mapAsync(items, func, token, options) {
|
|
210
|
+
if (items.length === 0) {
|
|
211
|
+
return [];
|
|
212
|
+
}
|
|
213
|
+
const result = new Array(items.length);
|
|
214
|
+
const timer = new Timer(options === null || options === void 0 ? void 0 : options.yieldAfter);
|
|
215
|
+
async function convertBatch(start) {
|
|
216
|
+
timer.start();
|
|
217
|
+
for (let i = start; i < items.length; i++) {
|
|
218
|
+
result[i] = await func(items[i], token);
|
|
219
|
+
if (timer.shouldYield()) {
|
|
220
|
+
(options === null || options === void 0 ? void 0 : options.yieldCallback) && options.yieldCallback();
|
|
221
|
+
return i + 1;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return -1;
|
|
225
|
+
}
|
|
226
|
+
let index = await convertBatch(0);
|
|
227
|
+
while (index !== -1) {
|
|
228
|
+
if (token !== undefined && token.isCancellationRequested) {
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
index = await new Promise(resolve => {
|
|
232
|
+
(0, vscode_languageserver_protocol_1.RAL)().timer.setImmediate(() => {
|
|
233
|
+
resolve(convertBatch(index));
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
return result;
|
|
238
|
+
}
|
|
239
|
+
async.mapAsync = mapAsync;
|
|
240
|
+
async function forEach(items, func, token, options) {
|
|
241
|
+
if (items.length === 0) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
const timer = new Timer(options === null || options === void 0 ? void 0 : options.yieldAfter);
|
|
245
|
+
function runBatch(start) {
|
|
246
|
+
timer.start();
|
|
247
|
+
for (let i = start; i < items.length; i++) {
|
|
248
|
+
func(items[i]);
|
|
249
|
+
if (timer.shouldYield()) {
|
|
250
|
+
(options === null || options === void 0 ? void 0 : options.yieldCallback) && options.yieldCallback();
|
|
251
|
+
return i + 1;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return -1;
|
|
255
|
+
}
|
|
256
|
+
let index = runBatch(0);
|
|
257
|
+
while (index !== -1) {
|
|
258
|
+
if (token !== undefined && token.isCancellationRequested) {
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
index = await new Promise(resolve => {
|
|
262
|
+
(0, vscode_languageserver_protocol_1.RAL)().timer.setImmediate(() => {
|
|
263
|
+
resolve(runBatch(index));
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
async.forEach = forEach;
|
|
269
|
+
export { async as default };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { __exports as is } from '../../../../../_virtual/is.js';
|
|
2
|
+
Object.defineProperty(is, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
is.asPromise = is.thenable = is.typedArray = is.stringArray = is.array = is.func = is.error = is.number = is.string = is.boolean = void 0;
|
|
6
|
+
function boolean(value) {
|
|
7
|
+
return value === true || value === false;
|
|
8
|
+
}
|
|
9
|
+
is.boolean = boolean;
|
|
10
|
+
function string(value) {
|
|
11
|
+
return typeof value === 'string' || value instanceof String;
|
|
12
|
+
}
|
|
13
|
+
is.string = string;
|
|
14
|
+
function number(value) {
|
|
15
|
+
return typeof value === 'number' || value instanceof Number;
|
|
16
|
+
}
|
|
17
|
+
is.number = number;
|
|
18
|
+
function error(value) {
|
|
19
|
+
return value instanceof Error;
|
|
20
|
+
}
|
|
21
|
+
is.error = error;
|
|
22
|
+
function func(value) {
|
|
23
|
+
return typeof value === 'function';
|
|
24
|
+
}
|
|
25
|
+
is.func = func;
|
|
26
|
+
function array(value) {
|
|
27
|
+
return Array.isArray(value);
|
|
28
|
+
}
|
|
29
|
+
is.array = array;
|
|
30
|
+
function stringArray(value) {
|
|
31
|
+
return array(value) && value.every(elem => string(elem));
|
|
32
|
+
}
|
|
33
|
+
is.stringArray = stringArray;
|
|
34
|
+
function typedArray(value, check) {
|
|
35
|
+
return Array.isArray(value) && value.every(check);
|
|
36
|
+
}
|
|
37
|
+
is.typedArray = typedArray;
|
|
38
|
+
function thenable(value) {
|
|
39
|
+
return value && func(value.then);
|
|
40
|
+
}
|
|
41
|
+
is.thenable = thenable;
|
|
42
|
+
function asPromise(value) {
|
|
43
|
+
if (value instanceof Promise) {
|
|
44
|
+
return value;
|
|
45
|
+
} else if (thenable(value)) {
|
|
46
|
+
return new Promise((resolve, reject) => {
|
|
47
|
+
value.then(resolved => resolve(resolved), error => reject(error));
|
|
48
|
+
});
|
|
49
|
+
} else {
|
|
50
|
+
return Promise.resolve(value);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
is.asPromise = asPromise;
|
|
54
|
+
export { is as default };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { __exports as uuid } from '../../../../../_virtual/uuid.js';
|
|
2
|
+
Object.defineProperty(uuid, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
uuid.generateUuid = uuid.parse = uuid.isUUID = uuid.v4 = uuid.empty = void 0;
|
|
6
|
+
class ValueUUID {
|
|
7
|
+
constructor(_value) {
|
|
8
|
+
this._value = _value;
|
|
9
|
+
}
|
|
10
|
+
asHex() {
|
|
11
|
+
return this._value;
|
|
12
|
+
}
|
|
13
|
+
equals(other) {
|
|
14
|
+
return this.asHex() === other.asHex();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
class V4UUID extends ValueUUID {
|
|
18
|
+
constructor() {
|
|
19
|
+
super([V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), '-', V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), '-', '4', V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), '-', V4UUID._oneOf(V4UUID._timeHighBits), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), '-', V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex()].join(''));
|
|
20
|
+
}
|
|
21
|
+
static _oneOf(array) {
|
|
22
|
+
return array[Math.floor(array.length * Math.random())];
|
|
23
|
+
}
|
|
24
|
+
static _randomHex() {
|
|
25
|
+
return V4UUID._oneOf(V4UUID._chars);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
V4UUID._chars = ['0', '1', '2', '3', '4', '5', '6', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];
|
|
29
|
+
V4UUID._timeHighBits = ['8', '9', 'a', 'b'];
|
|
30
|
+
uuid.empty = new ValueUUID('00000000-0000-0000-0000-000000000000');
|
|
31
|
+
function v4() {
|
|
32
|
+
return new V4UUID();
|
|
33
|
+
}
|
|
34
|
+
uuid.v4 = v4;
|
|
35
|
+
const _UUIDPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
36
|
+
function isUUID(value) {
|
|
37
|
+
return _UUIDPattern.test(value);
|
|
38
|
+
}
|
|
39
|
+
uuid.isUUID = isUUID;
|
|
40
|
+
function parse(value) {
|
|
41
|
+
if (!isUUID(value)) {
|
|
42
|
+
throw new Error('invalid uuid');
|
|
43
|
+
}
|
|
44
|
+
return new ValueUUID(value);
|
|
45
|
+
}
|
|
46
|
+
uuid.parse = parse;
|
|
47
|
+
function generateUuid() {
|
|
48
|
+
return v4().asHex();
|
|
49
|
+
}
|
|
50
|
+
uuid.generateUuid = generateUuid;
|
|
51
|
+
export { uuid as default };
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { __exports as workspaceFolder } from '../../../../_virtual/workspaceFolder.js';
|
|
2
|
+
import require$$0 from '../../../../_virtual/_vscode.js';
|
|
3
|
+
import { __exports as uuid } from '../../../../_virtual/uuid.js';
|
|
4
|
+
import './utils/uuid.js';
|
|
5
|
+
import { __exports as main } from '../../../../_virtual/main.js';
|
|
6
|
+
import '../../../vscode-languageserver-protocol/lib/browser/main.js';
|
|
7
|
+
Object.defineProperty(workspaceFolder, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
var WorkspaceFoldersFeature_1 = workspaceFolder.WorkspaceFoldersFeature = workspaceFolder.arrayDiff = void 0;
|
|
11
|
+
const UUID = uuid;
|
|
12
|
+
const vscode_1 = require$$0;
|
|
13
|
+
const vscode_languageserver_protocol_1 = main;
|
|
14
|
+
function access(target, key) {
|
|
15
|
+
if (target === undefined || target === null) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
return target[key];
|
|
19
|
+
}
|
|
20
|
+
function arrayDiff(left, right) {
|
|
21
|
+
return left.filter(element => right.indexOf(element) < 0);
|
|
22
|
+
}
|
|
23
|
+
workspaceFolder.arrayDiff = arrayDiff;
|
|
24
|
+
class WorkspaceFoldersFeature {
|
|
25
|
+
constructor(client) {
|
|
26
|
+
this._client = client;
|
|
27
|
+
this._listeners = new Map();
|
|
28
|
+
}
|
|
29
|
+
getState() {
|
|
30
|
+
return {
|
|
31
|
+
kind: 'workspace',
|
|
32
|
+
id: this.registrationType.method,
|
|
33
|
+
registrations: this._listeners.size > 0
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
get registrationType() {
|
|
37
|
+
return vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type;
|
|
38
|
+
}
|
|
39
|
+
fillInitializeParams(params) {
|
|
40
|
+
const folders = vscode_1.workspace.workspaceFolders;
|
|
41
|
+
this.initializeWithFolders(folders);
|
|
42
|
+
if (folders === void 0) {
|
|
43
|
+
params.workspaceFolders = null;
|
|
44
|
+
} else {
|
|
45
|
+
params.workspaceFolders = folders.map(folder => this.asProtocol(folder));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
initializeWithFolders(currentWorkspaceFolders) {
|
|
49
|
+
this._initialFolders = currentWorkspaceFolders;
|
|
50
|
+
}
|
|
51
|
+
fillClientCapabilities(capabilities) {
|
|
52
|
+
capabilities.workspace = capabilities.workspace || {};
|
|
53
|
+
capabilities.workspace.workspaceFolders = true;
|
|
54
|
+
}
|
|
55
|
+
initialize(capabilities) {
|
|
56
|
+
const client = this._client;
|
|
57
|
+
client.onRequest(vscode_languageserver_protocol_1.WorkspaceFoldersRequest.type, token => {
|
|
58
|
+
const workspaceFolders = () => {
|
|
59
|
+
const folders = vscode_1.workspace.workspaceFolders;
|
|
60
|
+
if (folders === undefined) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
const result = folders.map(folder => {
|
|
64
|
+
return this.asProtocol(folder);
|
|
65
|
+
});
|
|
66
|
+
return result;
|
|
67
|
+
};
|
|
68
|
+
const middleware = client.middleware.workspace;
|
|
69
|
+
return middleware && middleware.workspaceFolders ? middleware.workspaceFolders(token, workspaceFolders) : workspaceFolders();
|
|
70
|
+
});
|
|
71
|
+
const value = access(access(access(capabilities, 'workspace'), 'workspaceFolders'), 'changeNotifications');
|
|
72
|
+
let id;
|
|
73
|
+
if (typeof value === 'string') {
|
|
74
|
+
id = value;
|
|
75
|
+
} else if (value === true) {
|
|
76
|
+
id = UUID.generateUuid();
|
|
77
|
+
}
|
|
78
|
+
if (id) {
|
|
79
|
+
this.register({
|
|
80
|
+
id: id,
|
|
81
|
+
registerOptions: undefined
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
sendInitialEvent(currentWorkspaceFolders) {
|
|
86
|
+
let promise;
|
|
87
|
+
if (this._initialFolders && currentWorkspaceFolders) {
|
|
88
|
+
const removed = arrayDiff(this._initialFolders, currentWorkspaceFolders);
|
|
89
|
+
const added = arrayDiff(currentWorkspaceFolders, this._initialFolders);
|
|
90
|
+
if (added.length > 0 || removed.length > 0) {
|
|
91
|
+
promise = this.doSendEvent(added, removed);
|
|
92
|
+
}
|
|
93
|
+
} else if (this._initialFolders) {
|
|
94
|
+
promise = this.doSendEvent([], this._initialFolders);
|
|
95
|
+
} else if (currentWorkspaceFolders) {
|
|
96
|
+
promise = this.doSendEvent(currentWorkspaceFolders, []);
|
|
97
|
+
}
|
|
98
|
+
if (promise !== undefined) {
|
|
99
|
+
promise.catch(error => {
|
|
100
|
+
this._client.error("Sending notification ".concat(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type.method, " failed"), error);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
doSendEvent(addedFolders, removedFolders) {
|
|
105
|
+
let params = {
|
|
106
|
+
event: {
|
|
107
|
+
added: addedFolders.map(folder => this.asProtocol(folder)),
|
|
108
|
+
removed: removedFolders.map(folder => this.asProtocol(folder))
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
return this._client.sendNotification(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type, params);
|
|
112
|
+
}
|
|
113
|
+
register(data) {
|
|
114
|
+
let id = data.id;
|
|
115
|
+
let client = this._client;
|
|
116
|
+
let disposable = vscode_1.workspace.onDidChangeWorkspaceFolders(event => {
|
|
117
|
+
let didChangeWorkspaceFolders = event => {
|
|
118
|
+
return this.doSendEvent(event.added, event.removed);
|
|
119
|
+
};
|
|
120
|
+
let middleware = client.middleware.workspace;
|
|
121
|
+
const promise = middleware && middleware.didChangeWorkspaceFolders ? middleware.didChangeWorkspaceFolders(event, didChangeWorkspaceFolders) : didChangeWorkspaceFolders(event);
|
|
122
|
+
promise.catch(error => {
|
|
123
|
+
this._client.error("Sending notification ".concat(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type.method, " failed"), error);
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
this._listeners.set(id, disposable);
|
|
127
|
+
this.sendInitialEvent(vscode_1.workspace.workspaceFolders);
|
|
128
|
+
}
|
|
129
|
+
unregister(id) {
|
|
130
|
+
let disposable = this._listeners.get(id);
|
|
131
|
+
if (disposable === void 0) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
this._listeners.delete(id);
|
|
135
|
+
disposable.dispose();
|
|
136
|
+
}
|
|
137
|
+
dispose() {
|
|
138
|
+
for (let disposable of this._listeners.values()) {
|
|
139
|
+
disposable.dispose();
|
|
140
|
+
}
|
|
141
|
+
this._listeners.clear();
|
|
142
|
+
}
|
|
143
|
+
asProtocol(workspaceFolder) {
|
|
144
|
+
if (workspaceFolder === void 0) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
uri: this._client.code2ProtocolConverter.asUri(workspaceFolder.uri),
|
|
149
|
+
name: workspaceFolder.name
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
WorkspaceFoldersFeature_1 = workspaceFolder.WorkspaceFoldersFeature = WorkspaceFoldersFeature;
|
|
154
|
+
export { WorkspaceFoldersFeature_1 as WorkspaceFoldersFeature, workspaceFolder as default };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { __exports as workspaceSymbol } from '../../../../_virtual/workspaceSymbol.js';
|
|
2
|
+
import require$$0 from '../../../../_virtual/_vscode.js';
|
|
3
|
+
import { __exports as main } from '../../../../_virtual/main.js';
|
|
4
|
+
import '../../../vscode-languageserver-protocol/lib/browser/main.js';
|
|
5
|
+
import { __exports as features } from '../../../../_virtual/features.js';
|
|
6
|
+
import './features.js';
|
|
7
|
+
import { __exports as documentSymbol } from '../../../../_virtual/documentSymbol.js';
|
|
8
|
+
import './documentSymbol.js';
|
|
9
|
+
import { __exports as uuid } from '../../../../_virtual/uuid.js';
|
|
10
|
+
import './utils/uuid.js';
|
|
11
|
+
Object.defineProperty(workspaceSymbol, "__esModule", {
|
|
12
|
+
value: true
|
|
13
|
+
});
|
|
14
|
+
var WorkspaceSymbolFeature_1 = workspaceSymbol.WorkspaceSymbolFeature = void 0;
|
|
15
|
+
const vscode_1 = require$$0;
|
|
16
|
+
const vscode_languageserver_protocol_1 = main;
|
|
17
|
+
const features_1 = features;
|
|
18
|
+
const documentSymbol_1 = documentSymbol;
|
|
19
|
+
const UUID = uuid;
|
|
20
|
+
class WorkspaceSymbolFeature extends features_1.WorkspaceFeature {
|
|
21
|
+
constructor(client) {
|
|
22
|
+
super(client, vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type);
|
|
23
|
+
}
|
|
24
|
+
fillClientCapabilities(capabilities) {
|
|
25
|
+
let symbolCapabilities = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'symbol');
|
|
26
|
+
symbolCapabilities.dynamicRegistration = true;
|
|
27
|
+
symbolCapabilities.symbolKind = {
|
|
28
|
+
valueSet: documentSymbol_1.SupportedSymbolKinds
|
|
29
|
+
};
|
|
30
|
+
symbolCapabilities.tagSupport = {
|
|
31
|
+
valueSet: documentSymbol_1.SupportedSymbolTags
|
|
32
|
+
};
|
|
33
|
+
symbolCapabilities.resolveSupport = {
|
|
34
|
+
properties: ['location.range']
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
initialize(capabilities) {
|
|
38
|
+
if (!capabilities.workspaceSymbolProvider) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this.register({
|
|
42
|
+
id: UUID.generateUuid(),
|
|
43
|
+
registerOptions: capabilities.workspaceSymbolProvider === true ? {
|
|
44
|
+
workDoneProgress: false
|
|
45
|
+
} : capabilities.workspaceSymbolProvider
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
registerLanguageProvider(options) {
|
|
49
|
+
const provider = {
|
|
50
|
+
provideWorkspaceSymbols: (query, token) => {
|
|
51
|
+
const client = this._client;
|
|
52
|
+
const provideWorkspaceSymbols = (query, token) => {
|
|
53
|
+
return client.sendRequest(vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type, {
|
|
54
|
+
query
|
|
55
|
+
}, token).then(result => {
|
|
56
|
+
if (token.isCancellationRequested) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
return client.protocol2CodeConverter.asSymbolInformations(result, token);
|
|
60
|
+
}, error => {
|
|
61
|
+
return client.handleFailedRequest(vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type, token, error, null);
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
const middleware = client.middleware;
|
|
65
|
+
return middleware.provideWorkspaceSymbols ? middleware.provideWorkspaceSymbols(query, token, provideWorkspaceSymbols) : provideWorkspaceSymbols(query, token);
|
|
66
|
+
},
|
|
67
|
+
resolveWorkspaceSymbol: options.resolveProvider === true ? (item, token) => {
|
|
68
|
+
const client = this._client;
|
|
69
|
+
const resolveWorkspaceSymbol = (item, token) => {
|
|
70
|
+
return client.sendRequest(vscode_languageserver_protocol_1.WorkspaceSymbolResolveRequest.type, client.code2ProtocolConverter.asWorkspaceSymbol(item), token).then(result => {
|
|
71
|
+
if (token.isCancellationRequested) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
return client.protocol2CodeConverter.asSymbolInformation(result);
|
|
75
|
+
}, error => {
|
|
76
|
+
return client.handleFailedRequest(vscode_languageserver_protocol_1.WorkspaceSymbolResolveRequest.type, token, error, null);
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
const middleware = client.middleware;
|
|
80
|
+
return middleware.resolveWorkspaceSymbol ? middleware.resolveWorkspaceSymbol(item, token, resolveWorkspaceSymbol) : resolveWorkspaceSymbol(item, token);
|
|
81
|
+
} : undefined
|
|
82
|
+
};
|
|
83
|
+
return [vscode_1.languages.registerWorkspaceSymbolProvider(provider), provider];
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
WorkspaceSymbolFeature_1 = workspaceSymbol.WorkspaceSymbolFeature = WorkspaceSymbolFeature;
|
|
87
|
+
export { WorkspaceSymbolFeature_1 as WorkspaceSymbolFeature, workspaceSymbol as default };
|