@difizen/libro-language-client 0.1.18
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/LICENSE +21 -0
- package/README.md +0 -0
- package/es/common/api.d.ts +38 -0
- package/es/common/api.d.ts.map +1 -0
- package/es/common/api.js +9 -0
- package/es/common/callHierarchy.d.ts +39 -0
- package/es/common/callHierarchy.d.ts.map +1 -0
- package/es/common/callHierarchy.js +139 -0
- package/es/common/client.d.ts +482 -0
- package/es/common/client.d.ts.map +1 -0
- package/es/common/client.js +2731 -0
- package/es/common/codeAction.d.ts +22 -0
- package/es/common/codeAction.d.ts.map +1 -0
- package/es/common/codeAction.js +149 -0
- package/es/common/codeConverter.d.ts +81 -0
- package/es/common/codeConverter.d.ts.map +1 -0
- package/es/common/codeConverter.js +1040 -0
- package/es/common/codeLens.d.ts +26 -0
- package/es/common/codeLens.d.ts.map +1 -0
- package/es/common/codeLens.js +125 -0
- package/es/common/colorProvider.d.ts +27 -0
- package/es/common/colorProvider.d.ts.map +1 -0
- package/es/common/colorProvider.js +104 -0
- package/es/common/completion.d.ts +22 -0
- package/es/common/completion.d.ts.map +1 -0
- package/es/common/completion.js +130 -0
- package/es/common/configuration.d.ts +71 -0
- package/es/common/configuration.d.ts.map +1 -0
- package/es/common/configuration.js +292 -0
- package/es/common/declaration.d.ts +18 -0
- package/es/common/declaration.d.ts.map +1 -0
- package/es/common/declaration.js +88 -0
- package/es/common/definition.d.ts +18 -0
- package/es/common/definition.d.ts.map +1 -0
- package/es/common/definition.js +80 -0
- package/es/common/diagnostic.d.ts +125 -0
- package/es/common/diagnostic.d.ts.map +1 -0
- package/es/common/diagnostic.js +1442 -0
- package/es/common/documentHighlight.d.ts +17 -0
- package/es/common/documentHighlight.d.ts.map +1 -0
- package/es/common/documentHighlight.js +73 -0
- package/es/common/documentLink.d.ts +21 -0
- package/es/common/documentLink.d.ts.map +1 -0
- package/es/common/documentLink.js +90 -0
- package/es/common/documentSymbol.d.ts +20 -0
- package/es/common/documentSymbol.d.ts.map +1 -0
- package/es/common/documentSymbol.js +134 -0
- package/es/common/executeCommand.d.ts +22 -0
- package/es/common/executeCommand.d.ts.map +1 -0
- package/es/common/executeCommand.js +117 -0
- package/es/common/features.d.ts +421 -0
- package/es/common/features.d.ts.map +1 -0
- package/es/common/features.js +576 -0
- package/es/common/fileOperations.d.ts +118 -0
- package/es/common/fileOperations.d.ts.map +1 -0
- package/es/common/fileOperations.js +705 -0
- package/es/common/fileSystemWatcher.d.ts +19 -0
- package/es/common/fileSystemWatcher.d.ts.map +1 -0
- package/es/common/fileSystemWatcher.js +173 -0
- package/es/common/foldingRange.d.ts +22 -0
- package/es/common/foldingRange.d.ts.map +1 -0
- package/es/common/foldingRange.js +127 -0
- package/es/common/formatting.d.ts +41 -0
- package/es/common/formatting.d.ts.map +1 -0
- package/es/common/formatting.js +233 -0
- package/es/common/hover.d.ts +18 -0
- package/es/common/hover.d.ts.map +1 -0
- package/es/common/hover.js +80 -0
- package/es/common/implementation.d.ts +18 -0
- package/es/common/implementation.d.ts.map +1 -0
- package/es/common/implementation.js +88 -0
- package/es/common/inlayHint.d.ts +23 -0
- package/es/common/inlayHint.d.ts.map +1 -0
- package/es/common/inlayHint.js +187 -0
- package/es/common/inlineCompletion.d.ts +20 -0
- package/es/common/inlineCompletion.d.ts.map +1 -0
- package/es/common/inlineCompletion.js +74 -0
- package/es/common/inlineValue.d.ts +21 -0
- package/es/common/inlineValue.d.ts.map +1 -0
- package/es/common/inlineValue.js +124 -0
- package/es/common/linkedEditingRange.d.ts +23 -0
- package/es/common/linkedEditingRange.d.ts.map +1 -0
- package/es/common/linkedEditingRange.js +94 -0
- package/es/common/notebook.d.ts +97 -0
- package/es/common/notebook.d.ts.map +1 -0
- package/es/common/notebook.js +1444 -0
- package/es/common/progress.d.ts +12 -0
- package/es/common/progress.d.ts.map +1 -0
- package/es/common/progress.js +75 -0
- package/es/common/progressPart.d.ts +25 -0
- package/es/common/progressPart.d.ts.map +1 -0
- package/es/common/progressPart.js +147 -0
- package/es/common/protocolCallHierarchyItem.d.ts +9 -0
- package/es/common/protocolCallHierarchyItem.d.ts.map +1 -0
- package/es/common/protocolCallHierarchyItem.js +34 -0
- package/es/common/protocolCodeAction.d.ts +7 -0
- package/es/common/protocolCodeAction.d.ts.map +1 -0
- package/es/common/protocolCodeAction.js +32 -0
- package/es/common/protocolCodeLens.d.ts +7 -0
- package/es/common/protocolCodeLens.d.ts.map +1 -0
- package/es/common/protocolCodeLens.js +29 -0
- package/es/common/protocolCompletionItem.d.ts +13 -0
- package/es/common/protocolCompletionItem.d.ts.map +1 -0
- package/es/common/protocolCompletionItem.js +29 -0
- package/es/common/protocolConverter.d.ts +174 -0
- package/es/common/protocolConverter.d.ts.map +1 -0
- package/es/common/protocolConverter.js +1982 -0
- package/es/common/protocolDiagnostic.d.ts +20 -0
- package/es/common/protocolDiagnostic.d.ts.map +1 -0
- package/es/common/protocolDiagnostic.js +46 -0
- package/es/common/protocolDocumentLink.d.ts +8 -0
- package/es/common/protocolDocumentLink.d.ts.map +1 -0
- package/es/common/protocolDocumentLink.js +29 -0
- package/es/common/protocolInlayHint.d.ts +8 -0
- package/es/common/protocolInlayHint.d.ts.map +1 -0
- package/es/common/protocolInlayHint.js +29 -0
- package/es/common/protocolTypeHierarchyItem.d.ts +9 -0
- package/es/common/protocolTypeHierarchyItem.d.ts.map +1 -0
- package/es/common/protocolTypeHierarchyItem.js +34 -0
- package/es/common/protocolWorkspaceSymbol.d.ts +9 -0
- package/es/common/protocolWorkspaceSymbol.d.ts.map +1 -0
- package/es/common/protocolWorkspaceSymbol.js +36 -0
- package/es/common/reference.d.ts +22 -0
- package/es/common/reference.d.ts.map +1 -0
- package/es/common/reference.js +78 -0
- package/es/common/rename.d.ts +29 -0
- package/es/common/rename.d.ts.map +1 -0
- package/es/common/rename.js +132 -0
- package/es/common/selectionRange.d.ts +18 -0
- package/es/common/selectionRange.d.ts.map +1 -0
- package/es/common/selectionRange.js +108 -0
- package/es/common/semanticTokens.d.ts +36 -0
- package/es/common/semanticTokens.d.ts.map +1 -0
- package/es/common/semanticTokens.js +226 -0
- package/es/common/signatureHelp.d.ts +18 -0
- package/es/common/signatureHelp.d.ts.map +1 -0
- package/es/common/signatureHelp.js +103 -0
- package/es/common/textSynchronization.d.ts +104 -0
- package/es/common/textSynchronization.d.ts.map +1 -0
- package/es/common/textSynchronization.js +771 -0
- package/es/common/typeDefinition.d.ts +18 -0
- package/es/common/typeDefinition.d.ts.map +1 -0
- package/es/common/typeDefinition.js +89 -0
- package/es/common/typeHierarchy.d.ts +33 -0
- package/es/common/typeHierarchy.d.ts.map +1 -0
- package/es/common/typeHierarchy.js +138 -0
- package/es/common/utils/async.d.ts +42 -0
- package/es/common/utils/async.d.ts.map +1 -0
- package/es/common/utils/async.js +441 -0
- package/es/common/utils/is.d.ts +13 -0
- package/es/common/utils/is.d.ts.map +1 -0
- package/es/common/utils/is.js +52 -0
- package/es/common/utils/uuid.d.ts +23 -0
- package/es/common/utils/uuid.d.ts.map +1 -0
- package/es/common/utils/uuid.js +85 -0
- package/es/common/vscodeAdaptor/convertor.d.ts +7 -0
- package/es/common/vscodeAdaptor/convertor.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/convertor.js +66 -0
- package/es/common/vscodeAdaptor/diagnosticCollection.d.ts +33 -0
- package/es/common/vscodeAdaptor/diagnosticCollection.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/diagnosticCollection.js +310 -0
- package/es/common/vscodeAdaptor/extHostTypes.d.ts +1496 -0
- package/es/common/vscodeAdaptor/extHostTypes.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/extHostTypes.js +3825 -0
- package/es/common/vscodeAdaptor/fileWatcher.d.ts +19 -0
- package/es/common/vscodeAdaptor/fileWatcher.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/fileWatcher.js +45 -0
- package/es/common/vscodeAdaptor/hostTypeUtil.d.ts +192 -0
- package/es/common/vscodeAdaptor/hostTypeUtil.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/hostTypeUtil.js +566 -0
- package/es/common/vscodeAdaptor/libro-fs.d.ts +21 -0
- package/es/common/vscodeAdaptor/libro-fs.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/libro-fs.js +64 -0
- package/es/common/vscodeAdaptor/libroWindow.d.ts +21 -0
- package/es/common/vscodeAdaptor/libroWindow.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/libroWindow.js +75 -0
- package/es/common/vscodeAdaptor/libroWorkspace.d.ts +33 -0
- package/es/common/vscodeAdaptor/libroWorkspace.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/libroWorkspace.js +250 -0
- package/es/common/vscodeAdaptor/lspEnv.d.ts +8 -0
- package/es/common/vscodeAdaptor/lspEnv.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/lspEnv.js +31 -0
- package/es/common/vscodeAdaptor/monaco-converter.d.ts +229 -0
- package/es/common/vscodeAdaptor/monaco-converter.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/monaco-converter.js +1613 -0
- package/es/common/vscodeAdaptor/monacoLanguages.d.ts +48 -0
- package/es/common/vscodeAdaptor/monacoLanguages.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/monacoLanguages.js +484 -0
- package/es/common/vscodeAdaptor/services.d.ts +85 -0
- package/es/common/vscodeAdaptor/services.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/services.js +3 -0
- package/es/common/vscodeAdaptor/typings.d.ts +10 -0
- package/es/common/vscodeAdaptor/util.d.ts +3 -0
- package/es/common/vscodeAdaptor/util.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/util.js +6 -0
- package/es/common/vscodeAdaptor/vscodeAdaptor.d.ts +77 -0
- package/es/common/vscodeAdaptor/vscodeAdaptor.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/vscodeAdaptor.js +124 -0
- package/es/common/workspaceFolder.d.ts +32 -0
- package/es/common/workspaceFolder.d.ts.map +1 -0
- package/es/common/workspaceFolder.js +204 -0
- package/es/common/workspaceSymbol.d.ts +21 -0
- package/es/common/workspaceSymbol.d.ts.map +1 -0
- package/es/common/workspaceSymbol.js +101 -0
- package/es/constants.d.ts +2 -0
- package/es/constants.d.ts.map +1 -0
- package/es/constants.js +1 -0
- package/es/index.d.ts +6 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +5 -0
- package/es/libro-language-client-contribution.d.ts +10 -0
- package/es/libro-language-client-contribution.d.ts.map +1 -0
- package/es/libro-language-client-contribution.js +143 -0
- package/es/libro-language-client-manager.d.ts +34 -0
- package/es/libro-language-client-manager.d.ts.map +1 -0
- package/es/libro-language-client-manager.js +277 -0
- package/es/libro-language-client.d.ts +27 -0
- package/es/libro-language-client.d.ts.map +1 -0
- package/es/libro-language-client.js +141 -0
- package/es/module.d.ts +3 -0
- package/es/module.d.ts.map +1 -0
- package/es/module.js +13 -0
- package/package.json +69 -0
- package/src/common/api.ts +155 -0
- package/src/common/callHierarchy.ts +269 -0
- package/src/common/client.ts +3192 -0
- package/src/common/codeAction.ts +237 -0
- package/src/common/codeConverter.ts +1409 -0
- package/src/common/codeLens.ts +188 -0
- package/src/common/colorProvider.ts +192 -0
- package/src/common/completion.ts +281 -0
- package/src/common/configuration.ts +338 -0
- package/src/common/declaration.ts +140 -0
- package/src/common/definition.ts +138 -0
- package/src/common/diagnostic.ts +1408 -0
- package/src/common/documentHighlight.ts +140 -0
- package/src/common/documentLink.ts +180 -0
- package/src/common/documentSymbol.ts +186 -0
- package/src/common/executeCommand.ts +129 -0
- package/src/common/features.ts +1157 -0
- package/src/common/fileOperations.ts +635 -0
- package/src/common/fileSystemWatcher.ts +184 -0
- package/src/common/foldingRange.ts +160 -0
- package/src/common/formatting.ts +465 -0
- package/src/common/hover.ts +133 -0
- package/src/common/implementation.ts +142 -0
- package/src/common/inlayHint.ts +201 -0
- package/src/common/inlineCompletion.ts +160 -0
- package/src/common/inlineValue.ts +158 -0
- package/src/common/linkedEditingRange.ts +141 -0
- package/src/common/notebook.ts +1443 -0
- package/src/common/progress.ts +61 -0
- package/src/common/progressPart.ts +151 -0
- package/src/common/protocolCallHierarchyItem.ts +29 -0
- package/src/common/protocolCodeAction.ts +17 -0
- package/src/common/protocolCodeLens.ts +15 -0
- package/src/common/protocolCompletionItem.ts +22 -0
- package/src/common/protocolConverter.ts +2627 -0
- package/src/common/protocolDiagnostic.ts +47 -0
- package/src/common/protocolDocumentLink.ts +17 -0
- package/src/common/protocolInlayHint.ts +21 -0
- package/src/common/protocolTypeHierarchyItem.ts +29 -0
- package/src/common/protocolWorkspaceSymbol.ts +39 -0
- package/src/common/reference.ts +144 -0
- package/src/common/rename.ts +230 -0
- package/src/common/selectionRange.ts +136 -0
- package/src/common/semanticTokens.ts +383 -0
- package/src/common/signatureHelp.ts +170 -0
- package/src/common/textSynchronization.ts +819 -0
- package/src/common/typeDefinition.ts +146 -0
- package/src/common/typeHierarchy.ts +248 -0
- package/src/common/utils/async.ts +354 -0
- package/src/common/utils/is.ts +63 -0
- package/src/common/utils/uuid.ts +136 -0
- package/src/common/vscodeAdaptor/convertor.ts +73 -0
- package/src/common/vscodeAdaptor/diagnosticCollection.ts +238 -0
- package/src/common/vscodeAdaptor/extHostTypes.ts +4498 -0
- package/src/common/vscodeAdaptor/fileWatcher.ts +36 -0
- package/src/common/vscodeAdaptor/hostTypeUtil.ts +539 -0
- package/src/common/vscodeAdaptor/libro-fs.ts +51 -0
- package/src/common/vscodeAdaptor/libroWindow.ts +85 -0
- package/src/common/vscodeAdaptor/libroWorkspace.ts +261 -0
- package/src/common/vscodeAdaptor/lspEnv.ts +16 -0
- package/src/common/vscodeAdaptor/monaco-converter.ts +1800 -0
- package/src/common/vscodeAdaptor/monacoLanguages.ts +511 -0
- package/src/common/vscodeAdaptor/services.ts +278 -0
- package/src/common/vscodeAdaptor/typings.d.ts +10 -0
- package/src/common/vscodeAdaptor/util.ts +7 -0
- package/src/common/vscodeAdaptor/vscodeAdaptor.ts +122 -0
- package/src/common/workspaceFolder.ts +236 -0
- package/src/common/workspaceSymbol.ts +166 -0
- package/src/constants.ts +1 -0
- package/src/index.spec.ts +7 -0
- package/src/index.ts +5 -0
- package/src/libro-language-client-contribution.ts +49 -0
- package/src/libro-language-client-manager.ts +131 -0
- package/src/libro-language-client.ts +100 -0
- package/src/module.ts +19 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/* --------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
* ------------------------------------------------------------------------------------------ */
|
|
5
|
+
|
|
6
|
+
import type {
|
|
7
|
+
ClientCapabilities,
|
|
8
|
+
DocumentHighlightOptions,
|
|
9
|
+
DocumentHighlightRegistrationOptions,
|
|
10
|
+
DocumentSelector,
|
|
11
|
+
ServerCapabilities,
|
|
12
|
+
TextDocumentRegistrationOptions,
|
|
13
|
+
} from '@difizen/vscode-languageserver-protocol';
|
|
14
|
+
import { DocumentHighlightRequest } from '@difizen/vscode-languageserver-protocol';
|
|
15
|
+
import type {
|
|
16
|
+
TextDocument,
|
|
17
|
+
Disposable,
|
|
18
|
+
Position as VPosition,
|
|
19
|
+
CancellationToken,
|
|
20
|
+
ProviderResult,
|
|
21
|
+
DocumentHighlightProvider,
|
|
22
|
+
DocumentHighlight as VDocumentHighlight,
|
|
23
|
+
} from 'vscode';
|
|
24
|
+
|
|
25
|
+
import type { FeatureClient } from './features.js';
|
|
26
|
+
import { ensure, TextDocumentLanguageFeature } from './features.js';
|
|
27
|
+
import * as UUID from './utils/uuid.js';
|
|
28
|
+
import { languages as Languages } from './vscodeAdaptor/vscodeAdaptor.js';
|
|
29
|
+
|
|
30
|
+
export interface ProvideDocumentHighlightsSignature {
|
|
31
|
+
(
|
|
32
|
+
this: void,
|
|
33
|
+
document: TextDocument,
|
|
34
|
+
position: VPosition,
|
|
35
|
+
token: CancellationToken,
|
|
36
|
+
): ProviderResult<VDocumentHighlight[]>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface DocumentHighlightMiddleware {
|
|
40
|
+
provideDocumentHighlights?: (
|
|
41
|
+
this: void,
|
|
42
|
+
document: TextDocument,
|
|
43
|
+
position: VPosition,
|
|
44
|
+
token: CancellationToken,
|
|
45
|
+
next: ProvideDocumentHighlightsSignature,
|
|
46
|
+
) => ProviderResult<VDocumentHighlight[]>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export class DocumentHighlightFeature extends TextDocumentLanguageFeature<
|
|
50
|
+
boolean | DocumentHighlightOptions,
|
|
51
|
+
DocumentHighlightRegistrationOptions,
|
|
52
|
+
DocumentHighlightProvider,
|
|
53
|
+
DocumentHighlightMiddleware
|
|
54
|
+
> {
|
|
55
|
+
constructor(client: FeatureClient<DocumentHighlightMiddleware>) {
|
|
56
|
+
super(client, DocumentHighlightRequest.type);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public fillClientCapabilities(capabilities: ClientCapabilities): void {
|
|
60
|
+
ensure(
|
|
61
|
+
ensure(capabilities, 'textDocument')!,
|
|
62
|
+
'documentHighlight',
|
|
63
|
+
)!.dynamicRegistration = true;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public initialize(
|
|
67
|
+
capabilities: ServerCapabilities,
|
|
68
|
+
documentSelector: DocumentSelector,
|
|
69
|
+
): void {
|
|
70
|
+
const options = this.getRegistrationOptions(
|
|
71
|
+
documentSelector,
|
|
72
|
+
capabilities.documentHighlightProvider,
|
|
73
|
+
);
|
|
74
|
+
if (!options) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
this.register({ id: UUID.generateUuid(), registerOptions: options });
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
protected registerLanguageProvider(
|
|
81
|
+
options: TextDocumentRegistrationOptions,
|
|
82
|
+
): [Disposable, DocumentHighlightProvider] {
|
|
83
|
+
const selector = options.documentSelector!;
|
|
84
|
+
const provider: DocumentHighlightProvider = {
|
|
85
|
+
provideDocumentHighlights: (document, position, token) => {
|
|
86
|
+
const client = this._client;
|
|
87
|
+
const _provideDocumentHighlights: ProvideDocumentHighlightsSignature = (
|
|
88
|
+
document,
|
|
89
|
+
position,
|
|
90
|
+
token,
|
|
91
|
+
) => {
|
|
92
|
+
return client
|
|
93
|
+
.sendRequest(
|
|
94
|
+
DocumentHighlightRequest.type,
|
|
95
|
+
client.code2ProtocolConverter.asTextDocumentPositionParams(
|
|
96
|
+
document,
|
|
97
|
+
position,
|
|
98
|
+
),
|
|
99
|
+
token,
|
|
100
|
+
)
|
|
101
|
+
.then(
|
|
102
|
+
(result) => {
|
|
103
|
+
if (token.isCancellationRequested) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
return client.protocol2CodeConverter.asDocumentHighlights(
|
|
107
|
+
result,
|
|
108
|
+
token,
|
|
109
|
+
);
|
|
110
|
+
},
|
|
111
|
+
(error) => {
|
|
112
|
+
return client.handleFailedRequest(
|
|
113
|
+
DocumentHighlightRequest.type,
|
|
114
|
+
token,
|
|
115
|
+
error,
|
|
116
|
+
null,
|
|
117
|
+
);
|
|
118
|
+
},
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
const middleware = client.middleware;
|
|
122
|
+
return middleware.provideDocumentHighlights
|
|
123
|
+
? middleware.provideDocumentHighlights(
|
|
124
|
+
document,
|
|
125
|
+
position,
|
|
126
|
+
token,
|
|
127
|
+
_provideDocumentHighlights,
|
|
128
|
+
)
|
|
129
|
+
: _provideDocumentHighlights(document, position, token);
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
return [
|
|
133
|
+
Languages.registerDocumentHighlightProvider(
|
|
134
|
+
this._client.protocol2CodeConverter.asDocumentSelector(selector),
|
|
135
|
+
provider,
|
|
136
|
+
),
|
|
137
|
+
provider,
|
|
138
|
+
];
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/* --------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
* ------------------------------------------------------------------------------------------ */
|
|
5
|
+
|
|
6
|
+
import type {
|
|
7
|
+
ClientCapabilities,
|
|
8
|
+
DocumentLinkOptions,
|
|
9
|
+
DocumentLinkRegistrationOptions,
|
|
10
|
+
DocumentSelector,
|
|
11
|
+
ResponseError,
|
|
12
|
+
ServerCapabilities,
|
|
13
|
+
} from '@difizen/vscode-languageserver-protocol';
|
|
14
|
+
import {
|
|
15
|
+
DocumentLinkRequest,
|
|
16
|
+
DocumentLinkResolveRequest,
|
|
17
|
+
} from '@difizen/vscode-languageserver-protocol';
|
|
18
|
+
import type {
|
|
19
|
+
TextDocument,
|
|
20
|
+
Disposable,
|
|
21
|
+
CancellationToken,
|
|
22
|
+
ProviderResult,
|
|
23
|
+
DocumentLinkProvider,
|
|
24
|
+
DocumentLink as VDocumentLink,
|
|
25
|
+
} from 'vscode';
|
|
26
|
+
|
|
27
|
+
import type { FeatureClient } from './features.js';
|
|
28
|
+
import { ensure, TextDocumentLanguageFeature } from './features.js';
|
|
29
|
+
import * as UUID from './utils/uuid.js';
|
|
30
|
+
import { languages as Languages } from './vscodeAdaptor/vscodeAdaptor.js';
|
|
31
|
+
|
|
32
|
+
export interface ProvideDocumentLinksSignature {
|
|
33
|
+
(
|
|
34
|
+
this: void,
|
|
35
|
+
document: TextDocument,
|
|
36
|
+
token: CancellationToken,
|
|
37
|
+
): ProviderResult<VDocumentLink[]>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface ResolveDocumentLinkSignature {
|
|
41
|
+
(
|
|
42
|
+
this: void,
|
|
43
|
+
link: VDocumentLink,
|
|
44
|
+
token: CancellationToken,
|
|
45
|
+
): ProviderResult<VDocumentLink>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface DocumentLinkMiddleware {
|
|
49
|
+
provideDocumentLinks?: (
|
|
50
|
+
this: void,
|
|
51
|
+
document: TextDocument,
|
|
52
|
+
token: CancellationToken,
|
|
53
|
+
next: ProvideDocumentLinksSignature,
|
|
54
|
+
) => ProviderResult<VDocumentLink[]>;
|
|
55
|
+
resolveDocumentLink?: (
|
|
56
|
+
this: void,
|
|
57
|
+
link: VDocumentLink,
|
|
58
|
+
token: CancellationToken,
|
|
59
|
+
next: ResolveDocumentLinkSignature,
|
|
60
|
+
) => ProviderResult<VDocumentLink>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export class DocumentLinkFeature extends TextDocumentLanguageFeature<
|
|
64
|
+
DocumentLinkOptions,
|
|
65
|
+
DocumentLinkRegistrationOptions,
|
|
66
|
+
DocumentLinkProvider,
|
|
67
|
+
DocumentLinkMiddleware
|
|
68
|
+
> {
|
|
69
|
+
constructor(client: FeatureClient<DocumentLinkMiddleware>) {
|
|
70
|
+
super(client, DocumentLinkRequest.type);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
public fillClientCapabilities(capabilities: ClientCapabilities): void {
|
|
74
|
+
const documentLinkCapabilities = ensure(
|
|
75
|
+
ensure(capabilities, 'textDocument')!,
|
|
76
|
+
'documentLink',
|
|
77
|
+
)!;
|
|
78
|
+
documentLinkCapabilities.dynamicRegistration = true;
|
|
79
|
+
documentLinkCapabilities.tooltipSupport = true;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public initialize(
|
|
83
|
+
capabilities: ServerCapabilities,
|
|
84
|
+
documentSelector: DocumentSelector,
|
|
85
|
+
): void {
|
|
86
|
+
const options = this.getRegistrationOptions(
|
|
87
|
+
documentSelector,
|
|
88
|
+
capabilities.documentLinkProvider,
|
|
89
|
+
);
|
|
90
|
+
if (!options) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
this.register({ id: UUID.generateUuid(), registerOptions: options });
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
protected registerLanguageProvider(
|
|
97
|
+
options: DocumentLinkRegistrationOptions,
|
|
98
|
+
): [Disposable, DocumentLinkProvider] {
|
|
99
|
+
const selector = options.documentSelector!;
|
|
100
|
+
const provider: DocumentLinkProvider = {
|
|
101
|
+
provideDocumentLinks: (
|
|
102
|
+
document: TextDocument,
|
|
103
|
+
token: CancellationToken,
|
|
104
|
+
): ProviderResult<VDocumentLink[]> => {
|
|
105
|
+
const client = this._client;
|
|
106
|
+
const provideDocumentLinks: ProvideDocumentLinksSignature = (
|
|
107
|
+
document,
|
|
108
|
+
token,
|
|
109
|
+
) => {
|
|
110
|
+
return client
|
|
111
|
+
.sendRequest(
|
|
112
|
+
DocumentLinkRequest.type,
|
|
113
|
+
client.code2ProtocolConverter.asDocumentLinkParams(document),
|
|
114
|
+
token,
|
|
115
|
+
)
|
|
116
|
+
.then(
|
|
117
|
+
(result) => {
|
|
118
|
+
if (token.isCancellationRequested) {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
return client.protocol2CodeConverter.asDocumentLinks(result, token);
|
|
122
|
+
},
|
|
123
|
+
(error: ResponseError<void>) => {
|
|
124
|
+
return client.handleFailedRequest(
|
|
125
|
+
DocumentLinkRequest.type,
|
|
126
|
+
token,
|
|
127
|
+
error,
|
|
128
|
+
null,
|
|
129
|
+
);
|
|
130
|
+
},
|
|
131
|
+
);
|
|
132
|
+
};
|
|
133
|
+
const middleware = client.middleware;
|
|
134
|
+
return middleware.provideDocumentLinks
|
|
135
|
+
? middleware.provideDocumentLinks(document, token, provideDocumentLinks)
|
|
136
|
+
: provideDocumentLinks(document, token);
|
|
137
|
+
},
|
|
138
|
+
resolveDocumentLink: options.resolveProvider
|
|
139
|
+
? (link, token) => {
|
|
140
|
+
const client = this._client;
|
|
141
|
+
const resolveDocumentLink: ResolveDocumentLinkSignature = (link, token) => {
|
|
142
|
+
return client
|
|
143
|
+
.sendRequest(
|
|
144
|
+
DocumentLinkResolveRequest.type,
|
|
145
|
+
client.code2ProtocolConverter.asDocumentLink(link),
|
|
146
|
+
token,
|
|
147
|
+
)
|
|
148
|
+
.then(
|
|
149
|
+
(result) => {
|
|
150
|
+
if (token.isCancellationRequested) {
|
|
151
|
+
return link;
|
|
152
|
+
}
|
|
153
|
+
return client.protocol2CodeConverter.asDocumentLink(result);
|
|
154
|
+
},
|
|
155
|
+
(error: ResponseError<void>) => {
|
|
156
|
+
return client.handleFailedRequest(
|
|
157
|
+
DocumentLinkResolveRequest.type,
|
|
158
|
+
token,
|
|
159
|
+
error,
|
|
160
|
+
link,
|
|
161
|
+
);
|
|
162
|
+
},
|
|
163
|
+
);
|
|
164
|
+
};
|
|
165
|
+
const middleware = client.middleware;
|
|
166
|
+
return middleware.resolveDocumentLink
|
|
167
|
+
? middleware.resolveDocumentLink(link, token, resolveDocumentLink)
|
|
168
|
+
: resolveDocumentLink(link, token);
|
|
169
|
+
}
|
|
170
|
+
: undefined,
|
|
171
|
+
};
|
|
172
|
+
return [
|
|
173
|
+
Languages.registerDocumentLinkProvider(
|
|
174
|
+
this._client.protocol2CodeConverter.asDocumentSelector(selector),
|
|
175
|
+
provider,
|
|
176
|
+
),
|
|
177
|
+
provider,
|
|
178
|
+
];
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/* --------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
* ------------------------------------------------------------------------------------------ */
|
|
5
|
+
|
|
6
|
+
import type {
|
|
7
|
+
ClientCapabilities,
|
|
8
|
+
DocumentSelector,
|
|
9
|
+
DocumentSymbolOptions,
|
|
10
|
+
DocumentSymbolRegistrationOptions,
|
|
11
|
+
ServerCapabilities,
|
|
12
|
+
SymbolInformation,
|
|
13
|
+
} from '@difizen/vscode-languageserver-protocol';
|
|
14
|
+
import {
|
|
15
|
+
DocumentSymbol,
|
|
16
|
+
DocumentSymbolRequest,
|
|
17
|
+
SymbolKind,
|
|
18
|
+
SymbolTag,
|
|
19
|
+
} from '@difizen/vscode-languageserver-protocol';
|
|
20
|
+
import type {
|
|
21
|
+
TextDocument,
|
|
22
|
+
Disposable,
|
|
23
|
+
CancellationToken,
|
|
24
|
+
ProviderResult,
|
|
25
|
+
DocumentSymbolProvider,
|
|
26
|
+
DocumentSymbolProviderMetadata,
|
|
27
|
+
SymbolInformation as VSymbolInformation,
|
|
28
|
+
DocumentSymbol as VDocumentSymbol,
|
|
29
|
+
} from 'vscode';
|
|
30
|
+
|
|
31
|
+
import type { FeatureClient } from './features.js';
|
|
32
|
+
import { ensure, TextDocumentLanguageFeature } from './features.js';
|
|
33
|
+
import * as UUID from './utils/uuid.js';
|
|
34
|
+
import { languages as Languages } from './vscodeAdaptor/vscodeAdaptor.js';
|
|
35
|
+
|
|
36
|
+
export const SupportedSymbolKinds: SymbolKind[] = [
|
|
37
|
+
SymbolKind.File,
|
|
38
|
+
SymbolKind.Module,
|
|
39
|
+
SymbolKind.Namespace,
|
|
40
|
+
SymbolKind.Package,
|
|
41
|
+
SymbolKind.Class,
|
|
42
|
+
SymbolKind.Method,
|
|
43
|
+
SymbolKind.Property,
|
|
44
|
+
SymbolKind.Field,
|
|
45
|
+
SymbolKind.Constructor,
|
|
46
|
+
SymbolKind.Enum,
|
|
47
|
+
SymbolKind.Interface,
|
|
48
|
+
SymbolKind.Function,
|
|
49
|
+
SymbolKind.Variable,
|
|
50
|
+
SymbolKind.Constant,
|
|
51
|
+
SymbolKind.String,
|
|
52
|
+
SymbolKind.Number,
|
|
53
|
+
SymbolKind.Boolean,
|
|
54
|
+
SymbolKind.Array,
|
|
55
|
+
SymbolKind.Object,
|
|
56
|
+
SymbolKind.Key,
|
|
57
|
+
SymbolKind.Null,
|
|
58
|
+
SymbolKind.EnumMember,
|
|
59
|
+
SymbolKind.Struct,
|
|
60
|
+
SymbolKind.Event,
|
|
61
|
+
SymbolKind.Operator,
|
|
62
|
+
SymbolKind.TypeParameter,
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
export const SupportedSymbolTags: SymbolTag[] = [SymbolTag.Deprecated];
|
|
66
|
+
|
|
67
|
+
export interface ProvideDocumentSymbolsSignature {
|
|
68
|
+
(
|
|
69
|
+
this: void,
|
|
70
|
+
document: TextDocument,
|
|
71
|
+
token: CancellationToken,
|
|
72
|
+
): ProviderResult<VSymbolInformation[] | VDocumentSymbol[]>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface DocumentSymbolMiddleware {
|
|
76
|
+
provideDocumentSymbols?: (
|
|
77
|
+
this: void,
|
|
78
|
+
document: TextDocument,
|
|
79
|
+
token: CancellationToken,
|
|
80
|
+
next: ProvideDocumentSymbolsSignature,
|
|
81
|
+
) => ProviderResult<VSymbolInformation[] | VDocumentSymbol[]>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export class DocumentSymbolFeature extends TextDocumentLanguageFeature<
|
|
85
|
+
boolean | DocumentSymbolOptions,
|
|
86
|
+
DocumentSymbolRegistrationOptions,
|
|
87
|
+
DocumentSymbolProvider,
|
|
88
|
+
DocumentSymbolMiddleware
|
|
89
|
+
> {
|
|
90
|
+
constructor(client: FeatureClient<DocumentSymbolMiddleware>) {
|
|
91
|
+
super(client, DocumentSymbolRequest.type);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
public fillClientCapabilities(capabilities: ClientCapabilities): void {
|
|
95
|
+
const symbolCapabilities = ensure(
|
|
96
|
+
ensure(capabilities, 'textDocument')!,
|
|
97
|
+
'documentSymbol',
|
|
98
|
+
)!;
|
|
99
|
+
symbolCapabilities.dynamicRegistration = true;
|
|
100
|
+
symbolCapabilities.symbolKind = {
|
|
101
|
+
valueSet: SupportedSymbolKinds,
|
|
102
|
+
};
|
|
103
|
+
symbolCapabilities.hierarchicalDocumentSymbolSupport = true;
|
|
104
|
+
symbolCapabilities.tagSupport = {
|
|
105
|
+
valueSet: SupportedSymbolTags,
|
|
106
|
+
};
|
|
107
|
+
symbolCapabilities.labelSupport = true;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
public initialize(
|
|
111
|
+
capabilities: ServerCapabilities,
|
|
112
|
+
documentSelector: DocumentSelector,
|
|
113
|
+
): void {
|
|
114
|
+
const options = this.getRegistrationOptions(
|
|
115
|
+
documentSelector,
|
|
116
|
+
capabilities.documentSymbolProvider,
|
|
117
|
+
);
|
|
118
|
+
if (!options) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
this.register({ id: UUID.generateUuid(), registerOptions: options });
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
protected registerLanguageProvider(
|
|
125
|
+
options: DocumentSymbolRegistrationOptions,
|
|
126
|
+
): [Disposable, DocumentSymbolProvider] {
|
|
127
|
+
const selector = options.documentSelector!;
|
|
128
|
+
const provider: DocumentSymbolProvider = {
|
|
129
|
+
provideDocumentSymbols: (document, token) => {
|
|
130
|
+
const client = this._client;
|
|
131
|
+
const _provideDocumentSymbols: ProvideDocumentSymbolsSignature = async (
|
|
132
|
+
document,
|
|
133
|
+
token,
|
|
134
|
+
) => {
|
|
135
|
+
try {
|
|
136
|
+
const data = await client.sendRequest(
|
|
137
|
+
DocumentSymbolRequest.type,
|
|
138
|
+
client.code2ProtocolConverter.asDocumentSymbolParams(document),
|
|
139
|
+
token,
|
|
140
|
+
);
|
|
141
|
+
if (token.isCancellationRequested || data === undefined || data === null) {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
if (data.length === 0) {
|
|
145
|
+
return [];
|
|
146
|
+
} else {
|
|
147
|
+
const first = data[0];
|
|
148
|
+
if (DocumentSymbol.is(first)) {
|
|
149
|
+
return await client.protocol2CodeConverter.asDocumentSymbols(
|
|
150
|
+
data as DocumentSymbol[],
|
|
151
|
+
token,
|
|
152
|
+
);
|
|
153
|
+
} else {
|
|
154
|
+
return await client.protocol2CodeConverter.asSymbolInformations(
|
|
155
|
+
data as SymbolInformation[],
|
|
156
|
+
token,
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
} catch (error) {
|
|
161
|
+
return client.handleFailedRequest(
|
|
162
|
+
DocumentSymbolRequest.type,
|
|
163
|
+
token,
|
|
164
|
+
error,
|
|
165
|
+
null,
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
const middleware = client.middleware;
|
|
170
|
+
return middleware.provideDocumentSymbols
|
|
171
|
+
? middleware.provideDocumentSymbols(document, token, _provideDocumentSymbols)
|
|
172
|
+
: _provideDocumentSymbols(document, token);
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
const metaData: DocumentSymbolProviderMetadata | undefined =
|
|
176
|
+
options.label !== undefined ? { label: options.label } : undefined;
|
|
177
|
+
return [
|
|
178
|
+
Languages.registerDocumentSymbolProvider(
|
|
179
|
+
this._client.protocol2CodeConverter.asDocumentSelector(selector),
|
|
180
|
+
provider,
|
|
181
|
+
metaData,
|
|
182
|
+
),
|
|
183
|
+
provider,
|
|
184
|
+
];
|
|
185
|
+
}
|
|
186
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/* --------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
* ------------------------------------------------------------------------------------------ */
|
|
5
|
+
|
|
6
|
+
import type { Disposable, ProviderResult } from 'vscode';
|
|
7
|
+
import type {
|
|
8
|
+
ClientCapabilities,
|
|
9
|
+
ServerCapabilities,
|
|
10
|
+
ExecuteCommandRegistrationOptions,
|
|
11
|
+
RegistrationType,
|
|
12
|
+
ExecuteCommandParams,
|
|
13
|
+
} from '@difizen/vscode-languageserver-protocol';
|
|
14
|
+
import { ExecuteCommandRequest } from '@difizen/vscode-languageserver-protocol';
|
|
15
|
+
|
|
16
|
+
import type {
|
|
17
|
+
FeatureClient,
|
|
18
|
+
DynamicFeature,
|
|
19
|
+
FeatureState,
|
|
20
|
+
RegistrationData,
|
|
21
|
+
} from './features.js';
|
|
22
|
+
import { ensure } from './features.js';
|
|
23
|
+
import * as UUID from './utils/uuid.js';
|
|
24
|
+
import { commands as Commands } from './vscodeAdaptor/vscodeAdaptor.js';
|
|
25
|
+
|
|
26
|
+
export interface ExecuteCommandSignature {
|
|
27
|
+
(this: void, command: string, args: any[]): ProviderResult<any>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface ExecuteCommandMiddleware {
|
|
31
|
+
executeCommand?: (
|
|
32
|
+
this: void,
|
|
33
|
+
command: string,
|
|
34
|
+
args: any[],
|
|
35
|
+
next: ExecuteCommandSignature,
|
|
36
|
+
) => ProviderResult<any>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export class ExecuteCommandFeature
|
|
40
|
+
implements DynamicFeature<ExecuteCommandRegistrationOptions>
|
|
41
|
+
{
|
|
42
|
+
private readonly _client: FeatureClient<ExecuteCommandMiddleware>;
|
|
43
|
+
private readonly _commands: Map<string, Disposable[]>;
|
|
44
|
+
|
|
45
|
+
constructor(client: FeatureClient<ExecuteCommandMiddleware>) {
|
|
46
|
+
this._client = client;
|
|
47
|
+
this._commands = new Map();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public getState(): FeatureState {
|
|
51
|
+
return {
|
|
52
|
+
kind: 'workspace',
|
|
53
|
+
id: this.registrationType.method,
|
|
54
|
+
registrations: this._commands.size > 0,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public get registrationType(): RegistrationType<ExecuteCommandRegistrationOptions> {
|
|
59
|
+
return ExecuteCommandRequest.type;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public fillClientCapabilities(capabilities: ClientCapabilities): void {
|
|
63
|
+
ensure(ensure(capabilities, 'workspace')!, 'executeCommand')!.dynamicRegistration =
|
|
64
|
+
true;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public initialize(capabilities: ServerCapabilities): void {
|
|
68
|
+
if (!capabilities.executeCommandProvider) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
this.register({
|
|
72
|
+
id: UUID.generateUuid(),
|
|
73
|
+
registerOptions: Object.assign({}, capabilities.executeCommandProvider),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public register(data: RegistrationData<ExecuteCommandRegistrationOptions>): void {
|
|
78
|
+
const client = this._client;
|
|
79
|
+
const middleware = client.middleware;
|
|
80
|
+
const executeCommand: ExecuteCommandSignature = (
|
|
81
|
+
command: string,
|
|
82
|
+
args: any[],
|
|
83
|
+
): any => {
|
|
84
|
+
const params: ExecuteCommandParams = {
|
|
85
|
+
command,
|
|
86
|
+
arguments: args,
|
|
87
|
+
};
|
|
88
|
+
return client
|
|
89
|
+
.sendRequest(ExecuteCommandRequest.type, params)
|
|
90
|
+
.then(undefined, (error) => {
|
|
91
|
+
return client.handleFailedRequest(
|
|
92
|
+
ExecuteCommandRequest.type,
|
|
93
|
+
undefined,
|
|
94
|
+
error,
|
|
95
|
+
undefined,
|
|
96
|
+
);
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
if (data.registerOptions.commands) {
|
|
101
|
+
const disposables: Disposable[] = [];
|
|
102
|
+
for (const command of data.registerOptions.commands) {
|
|
103
|
+
disposables.push(
|
|
104
|
+
Commands.registerCommand(command, (...args: any[]) => {
|
|
105
|
+
return middleware.executeCommand
|
|
106
|
+
? middleware.executeCommand(command, args, executeCommand)
|
|
107
|
+
: executeCommand(command, args);
|
|
108
|
+
}),
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
this._commands.set(data.id, disposables);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
public unregister(id: string): void {
|
|
116
|
+
const disposables = this._commands.get(id);
|
|
117
|
+
if (disposables) {
|
|
118
|
+
this._commands.delete(id);
|
|
119
|
+
disposables.forEach((disposable) => disposable.dispose());
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
public clear(): void {
|
|
124
|
+
this._commands.forEach((value) => {
|
|
125
|
+
value.forEach((disposable) => disposable.dispose());
|
|
126
|
+
});
|
|
127
|
+
this._commands.clear();
|
|
128
|
+
}
|
|
129
|
+
}
|