@volar/language-service 2.4.0-alpha.9 → 2.4.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/lib/features/provideAutoInsertSnippet.d.ts +2 -2
- package/lib/features/provideAutoInsertSnippet.js +1 -3
- package/lib/features/provideCallHierarchyItems.d.ts +5 -2
- package/lib/features/provideCallHierarchyItems.js +83 -8
- package/lib/features/provideCodeActions.d.ts +2 -2
- package/lib/features/provideCodeActions.js +15 -12
- package/lib/features/provideCodeLenses.d.ts +2 -2
- package/lib/features/provideCodeLenses.js +14 -11
- package/lib/features/provideColorPresentations.d.ts +2 -2
- package/lib/features/provideColorPresentations.js +1 -3
- package/lib/features/provideCompletionItems.d.ts +2 -2
- package/lib/features/provideCompletionItems.js +46 -32
- package/lib/features/provideDefinition.d.ts +2 -2
- package/lib/features/provideDefinition.js +1 -2
- package/lib/features/provideDiagnostics.d.ts +7 -8
- package/lib/features/provideDiagnostics.js +88 -85
- package/lib/features/provideDocumentColors.d.ts +2 -2
- package/lib/features/provideDocumentColors.js +1 -3
- package/lib/features/provideDocumentDropEdits.d.ts +2 -2
- package/lib/features/provideDocumentDropEdits.js +1 -3
- package/lib/features/provideDocumentFormattingEdits.d.ts +2 -2
- package/lib/features/provideDocumentFormattingEdits.js +1 -2
- package/lib/features/provideDocumentHighlights.d.ts +2 -2
- package/lib/features/provideDocumentHighlights.js +1 -2
- package/lib/features/provideDocumentLinks.d.ts +2 -2
- package/lib/features/provideDocumentLinks.js +13 -10
- package/lib/features/provideDocumentSemanticTokens.d.ts +2 -2
- package/lib/features/provideDocumentSemanticTokens.js +2 -4
- package/lib/features/provideDocumentSymbols.d.ts +2 -2
- package/lib/features/provideDocumentSymbols.js +1 -3
- package/lib/features/provideFileReferences.d.ts +2 -2
- package/lib/features/provideFileReferences.js +1 -2
- package/lib/features/provideFileRenameEdits.d.ts +2 -2
- package/lib/features/provideFileRenameEdits.js +1 -4
- package/lib/features/provideFoldingRanges.d.ts +2 -2
- package/lib/features/provideFoldingRanges.js +1 -3
- package/lib/features/provideHover.d.ts +2 -2
- package/lib/features/provideHover.js +1 -3
- package/lib/features/provideInlayHints.d.ts +2 -2
- package/lib/features/provideInlayHints.js +13 -10
- package/lib/features/provideInlineValue.d.ts +4 -0
- package/lib/features/provideInlineValue.js +30 -0
- package/lib/features/provideLinkedEditingRanges.d.ts +2 -2
- package/lib/features/provideLinkedEditingRanges.js +1 -3
- package/lib/features/provideMoniker.d.ts +4 -0
- package/lib/features/provideMoniker.js +17 -0
- package/lib/features/provideReferences.d.ts +2 -2
- package/lib/features/provideReferences.js +1 -2
- package/lib/features/provideRenameEdits.d.ts +2 -2
- package/lib/features/provideRenameEdits.js +1 -2
- package/lib/features/provideRenameRange.d.ts +2 -2
- package/lib/features/provideRenameRange.js +1 -3
- package/lib/features/provideSelectionRanges.d.ts +2 -2
- package/lib/features/provideSelectionRanges.js +1 -3
- package/lib/features/provideSignatureHelp.d.ts +2 -2
- package/lib/features/provideSignatureHelp.js +1 -3
- package/lib/features/provideWorkspaceDiagnostics.js +2 -3
- package/lib/features/provideWorkspaceSymbols.js +11 -6
- package/lib/features/resolveCodeAction.js +2 -0
- package/lib/features/resolveCodeLens.js +3 -1
- package/lib/features/resolveCompletionItem.js +2 -0
- package/lib/features/resolveDocumentLink.js +2 -0
- package/lib/features/resolveInlayHint.js +2 -0
- package/lib/features/resolveWorkspaceSymbol.d.ts +1 -1
- package/lib/features/resolveWorkspaceSymbol.js +8 -6
- package/lib/languageService.d.ts +82 -70
- package/lib/languageService.js +17 -14
- package/lib/types.d.ts +14 -10
- package/package.json +3 -3
package/lib/languageService.js
CHANGED
|
@@ -8,7 +8,7 @@ const language_core_1 = require("@volar/language-core");
|
|
|
8
8
|
const vscode_languageserver_textdocument_1 = require("vscode-languageserver-textdocument");
|
|
9
9
|
const vscode_uri_1 = require("vscode-uri");
|
|
10
10
|
const autoInsert = require("./features/provideAutoInsertSnippet");
|
|
11
|
-
const
|
|
11
|
+
const hierarchy = require("./features/provideCallHierarchyItems");
|
|
12
12
|
const codeActions = require("./features/provideCodeActions");
|
|
13
13
|
const codeLens = require("./features/provideCodeLenses");
|
|
14
14
|
const colorPresentations = require("./features/provideColorPresentations");
|
|
@@ -27,6 +27,8 @@ const fileRename = require("./features/provideFileRenameEdits");
|
|
|
27
27
|
const foldingRanges = require("./features/provideFoldingRanges");
|
|
28
28
|
const hover = require("./features/provideHover");
|
|
29
29
|
const inlayHints = require("./features/provideInlayHints");
|
|
30
|
+
const moniker = require("./features/provideMoniker");
|
|
31
|
+
const inlineValue = require("./features/provideInlineValue");
|
|
30
32
|
const linkedEditing = require("./features/provideLinkedEditingRanges");
|
|
31
33
|
const references = require("./features/provideReferences");
|
|
32
34
|
const rename = require("./features/provideRenameEdits");
|
|
@@ -162,20 +164,18 @@ function encodeEmbeddedDocumentUri(documentUri, embeddedContentId) {
|
|
|
162
164
|
});
|
|
163
165
|
}
|
|
164
166
|
function createLanguageServiceBase(plugins, context) {
|
|
167
|
+
const tokenModifiers = plugins.map(plugin => plugin.capabilities.semanticTokensProvider?.legend?.tokenModifiers ?? []).flat();
|
|
168
|
+
const tokenTypes = plugins.map(plugin => plugin.capabilities.semanticTokensProvider?.legend?.tokenTypes ?? []).flat();
|
|
165
169
|
return {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
return {
|
|
170
|
-
tokenModifiers: [...new Set(tokenModifiers)],
|
|
171
|
-
tokenTypes: [...new Set(tokenTypes)],
|
|
172
|
-
};
|
|
170
|
+
semanticTokenLegend: {
|
|
171
|
+
tokenModifiers: [...new Set(tokenModifiers)],
|
|
172
|
+
tokenTypes: [...new Set(tokenTypes)],
|
|
173
173
|
},
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
commands: plugins.map(plugin => plugin.capabilities.executeCommandProvider?.commands ?? []).flat(),
|
|
175
|
+
triggerCharacters: plugins.map(plugin => plugin.capabilities.completionProvider?.triggerCharacters ?? []).flat(),
|
|
176
|
+
autoFormatTriggerCharacters: plugins.map(plugin => plugin.capabilities.documentOnTypeFormattingProvider?.triggerCharacters ?? []).flat(),
|
|
177
|
+
signatureHelpTriggerCharacters: plugins.map(plugin => plugin.capabilities.signatureHelpProvider?.triggerCharacters ?? []).flat(),
|
|
178
|
+
signatureHelpRetriggerCharacters: plugins.map(plugin => plugin.capabilities.signatureHelpProvider?.retriggerCharacters ?? []).flat(),
|
|
179
179
|
executeCommand(command, args, token = cancellation_1.NoneCancellationToken) {
|
|
180
180
|
for (const plugin of context.plugins) {
|
|
181
181
|
if (context.disabledServicePlugins.has(plugin[1])) {
|
|
@@ -198,6 +198,7 @@ function createLanguageServiceBase(plugins, context) {
|
|
|
198
198
|
getWorkspaceDiagnostics: workspaceDiagnostics.register(context),
|
|
199
199
|
getReferences: references.register(context),
|
|
200
200
|
getFileReferences: fileReferences.register(context),
|
|
201
|
+
getDeclaration: definition.register(context, 'provideDeclaration', language_core_1.isDefinitionEnabled),
|
|
201
202
|
getDefinition: definition.register(context, 'provideDefinition', language_core_1.isDefinitionEnabled),
|
|
202
203
|
getTypeDefinition: definition.register(context, 'provideTypeDefinition', language_core_1.isTypeDefinitionEnabled),
|
|
203
204
|
getImplementations: definition.register(context, 'provideImplementation', language_core_1.isImplementationEnabled),
|
|
@@ -216,13 +217,15 @@ function createLanguageServiceBase(plugins, context) {
|
|
|
216
217
|
getAutoInsertSnippet: autoInsert.register(context),
|
|
217
218
|
getDocumentDropEdits: documentDrop.register(context),
|
|
218
219
|
getInlayHints: inlayHints.register(context),
|
|
220
|
+
getMoniker: moniker.register(context),
|
|
221
|
+
getInlineValue: inlineValue.register(context),
|
|
219
222
|
resolveCodeAction: codeActionResolve.register(context),
|
|
220
223
|
resolveCompletionItem: completionResolve.register(context),
|
|
221
224
|
resolveCodeLens: codeLensResolve.register(context),
|
|
222
225
|
resolveDocumentLink: documentLinkResolve.register(context),
|
|
223
226
|
resolveInlayHint: inlayHintResolve.register(context),
|
|
224
227
|
resolveWorkspaceSymbol: workspaceSymbolResolve.register(context),
|
|
225
|
-
...
|
|
228
|
+
...hierarchy.register(context),
|
|
226
229
|
dispose: () => context.plugins.forEach(plugin => plugin[1].dispose?.()),
|
|
227
230
|
context,
|
|
228
231
|
};
|
package/lib/types.d.ts
CHANGED
|
@@ -6,13 +6,6 @@ import type { LanguageService } from './languageService';
|
|
|
6
6
|
import type { URI } from 'vscode-uri';
|
|
7
7
|
import type { UriMap } from './utils/uriMap';
|
|
8
8
|
export type * from 'vscode-languageserver-protocol';
|
|
9
|
-
export interface UriComponents {
|
|
10
|
-
scheme: string;
|
|
11
|
-
authority: string;
|
|
12
|
-
path: string;
|
|
13
|
-
query: string;
|
|
14
|
-
fragment: string;
|
|
15
|
-
}
|
|
16
9
|
export interface LanguageServiceEnvironment {
|
|
17
10
|
workspaceFolders: URI[];
|
|
18
11
|
locale?: string;
|
|
@@ -92,11 +85,15 @@ export interface LanguageServicePlugin<P = any> {
|
|
|
92
85
|
documentFormattingProvider?: boolean;
|
|
93
86
|
referencesProvider?: boolean;
|
|
94
87
|
implementationProvider?: boolean;
|
|
88
|
+
declarationProvider?: boolean;
|
|
95
89
|
definitionProvider?: boolean;
|
|
96
90
|
typeDefinitionProvider?: boolean;
|
|
97
91
|
callHierarchyProvider?: boolean;
|
|
92
|
+
typeHierarchyProvider?: boolean;
|
|
98
93
|
hoverProvider?: boolean;
|
|
99
94
|
documentHighlightProvider?: boolean;
|
|
95
|
+
monikerProvider?: boolean;
|
|
96
|
+
inlineValueProvider?: boolean;
|
|
100
97
|
workspaceSymbolProvider?: {
|
|
101
98
|
resolveProvider?: boolean;
|
|
102
99
|
};
|
|
@@ -135,10 +132,12 @@ export interface LanguageServicePlugin<P = any> {
|
|
|
135
132
|
resolveProvider?: boolean;
|
|
136
133
|
};
|
|
137
134
|
diagnosticProvider?: {
|
|
138
|
-
|
|
135
|
+
interFileDependencies: boolean;
|
|
136
|
+
workspaceDiagnostics: boolean;
|
|
139
137
|
};
|
|
140
138
|
fileReferencesProvider?: boolean;
|
|
141
|
-
|
|
139
|
+
fileRenameEditsProvider?: boolean;
|
|
140
|
+
documentDropEditsProvider?: boolean;
|
|
142
141
|
};
|
|
143
142
|
create(context: LanguageServiceContext): LanguageServicePluginInstance<P>;
|
|
144
143
|
}
|
|
@@ -154,6 +153,7 @@ export interface LanguageServicePluginInstance<P = any> {
|
|
|
154
153
|
provideDocumentSymbols?(document: TextDocument, token: vscode.CancellationToken): NullableProviderResult<vscode.DocumentSymbol[]>;
|
|
155
154
|
provideDocumentHighlights?(document: TextDocument, position: vscode.Position, token: vscode.CancellationToken): NullableProviderResult<vscode.DocumentHighlight[]>;
|
|
156
155
|
provideLinkedEditingRanges?(document: TextDocument, position: vscode.Position, token: vscode.CancellationToken): NullableProviderResult<vscode.LinkedEditingRanges>;
|
|
156
|
+
provideDeclaration?(document: TextDocument, position: vscode.Position, token: vscode.CancellationToken): NullableProviderResult<vscode.DeclarationLink[]>;
|
|
157
157
|
provideDefinition?(document: TextDocument, position: vscode.Position, token: vscode.CancellationToken): NullableProviderResult<vscode.LocationLink[]>;
|
|
158
158
|
provideTypeDefinition?(document: TextDocument, position: vscode.Position, token: vscode.CancellationToken): NullableProviderResult<vscode.LocationLink[]>;
|
|
159
159
|
provideImplementation?(document: TextDocument, position: vscode.Position, token: vscode.CancellationToken): NullableProviderResult<vscode.LocationLink[]>;
|
|
@@ -177,14 +177,18 @@ export interface LanguageServicePluginInstance<P = any> {
|
|
|
177
177
|
provideReferences?(document: TextDocument, position: vscode.Position, context: vscode.ReferenceContext, token: vscode.CancellationToken): NullableProviderResult<vscode.Location[]>;
|
|
178
178
|
provideSelectionRanges?(document: TextDocument, positions: vscode.Position[], token: vscode.CancellationToken): NullableProviderResult<vscode.SelectionRange[]>;
|
|
179
179
|
provideInlayHints?(document: TextDocument, range: vscode.Range, token: vscode.CancellationToken): NullableProviderResult<vscode.InlayHint[]>;
|
|
180
|
+
provideInlineValues?(document: TextDocument, range: vscode.Range, context: vscode.InlineValueContext, token: vscode.CancellationToken): NullableProviderResult<vscode.InlineValue[]>;
|
|
180
181
|
provideCallHierarchyItems?(document: TextDocument, position: vscode.Position, token: vscode.CancellationToken): NullableProviderResult<vscode.CallHierarchyItem[]>;
|
|
181
182
|
provideCallHierarchyIncomingCalls?(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): ProviderResult<vscode.CallHierarchyIncomingCall[]>;
|
|
182
183
|
provideCallHierarchyOutgoingCalls?(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): ProviderResult<vscode.CallHierarchyOutgoingCall[]>;
|
|
184
|
+
provideTypeHierarchyItems?(document: TextDocument, position: vscode.Position, token: vscode.CancellationToken): NullableProviderResult<vscode.TypeHierarchyItem[]>;
|
|
185
|
+
provideTypeHierarchySupertypes?(item: vscode.TypeHierarchyItem, token: vscode.CancellationToken): ProviderResult<vscode.TypeHierarchyItem[]>;
|
|
186
|
+
provideTypeHierarchySubtypes?(item: vscode.TypeHierarchyItem, token: vscode.CancellationToken): ProviderResult<vscode.TypeHierarchyItem[]>;
|
|
183
187
|
provideDocumentSemanticTokens?(document: TextDocument, range: vscode.Range, legend: vscode.SemanticTokensLegend, token: vscode.CancellationToken): NullableProviderResult<SemanticToken[]>;
|
|
184
188
|
provideWorkspaceSymbols?(query: string, token: vscode.CancellationToken): NullableProviderResult<vscode.WorkspaceSymbol[]>;
|
|
185
189
|
provideDiagnostics?(document: TextDocument, token: vscode.CancellationToken): NullableProviderResult<vscode.Diagnostic[]>;
|
|
186
|
-
provideSemanticDiagnostics?(document: TextDocument, token: vscode.CancellationToken): NullableProviderResult<vscode.Diagnostic[]>;
|
|
187
190
|
provideWorkspaceDiagnostics?(token: vscode.CancellationToken): NullableProviderResult<vscode.WorkspaceDocumentDiagnosticReport[]>;
|
|
191
|
+
provideMoniker?(document: TextDocument, position: vscode.Position, token: vscode.CancellationToken): NullableProviderResult<vscode.Moniker[]>;
|
|
188
192
|
provideFileReferences?(document: TextDocument, token: vscode.CancellationToken): NullableProviderResult<vscode.Location[]>;
|
|
189
193
|
provideReferencesCodeLensRanges?(document: TextDocument, token: vscode.CancellationToken): NullableProviderResult<vscode.Range[]>;
|
|
190
194
|
provideAutoInsertSnippet?(document: TextDocument, position: vscode.Position, lastChange: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/language-service",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"directory": "packages/language-service"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@volar/language-core": "2.4.
|
|
15
|
+
"@volar/language-core": "2.4.1",
|
|
16
16
|
"vscode-languageserver-protocol": "^3.17.5",
|
|
17
17
|
"vscode-languageserver-textdocument": "^1.0.11",
|
|
18
18
|
"vscode-uri": "^3.0.8"
|
|
19
19
|
},
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "b920b6c4a3e4b2d8f46c676ea414e94c437cb5b7"
|
|
21
21
|
}
|