@volar/language-server 1.0.8 → 1.0.10
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/out/features/customFeatures.js +59 -8
- package/out/features/languageFeatures.d.ts +2 -2
- package/out/features/languageFeatures.js +4 -3
- package/out/protocol.d.ts +3 -0
- package/out/protocol.js +5 -1
- package/out/registerFeatures.d.ts +3 -2
- package/out/registerFeatures.js +77 -42
- package/out/server.js +28 -5
- package/out/types.d.ts +7 -2
- package/out/utils/cancellationPipe.d.ts +3 -3
- package/out/utils/cancellationPipe.js +6 -6
- package/out/utils/config.js +11 -6
- package/out/utils/configurationHost.js +14 -2
- package/out/utils/nodeFileSystemHost.js +2 -2
- package/out/utils/project.d.ts +52 -12
- package/out/utils/project.js +13 -2
- package/out/utils/snapshots.d.ts +1 -1
- package/out/utils/snapshots.js +8 -7
- package/out/utils/uriMap.d.ts +22 -0
- package/out/utils/uriMap.js +77 -0
- package/out/utils/webFileSystemHost.js +2 -2
- package/out/utils/workspaceProjects.d.ts +53 -12
- package/out/utils/workspaceProjects.js +8 -2
- package/out/utils/workspaces.d.ts +152 -32
- package/out/utils/workspaces.js +12 -3
- package/package.json +7 -7
|
@@ -5,10 +5,11 @@ import * as vscode from 'vscode-languageserver';
|
|
|
5
5
|
import { URI } from 'vscode-uri';
|
|
6
6
|
import { FileSystemHost, LanguageServerPlugin, RuntimeEnvironment, LanguageServerInitializationOptions } from '../types';
|
|
7
7
|
import { createSnapshots } from './snapshots';
|
|
8
|
-
import
|
|
8
|
+
import * as path from 'typesafe-path';
|
|
9
|
+
import { CancellationTokenHost } from './cancellationPipe';
|
|
9
10
|
export interface Workspaces extends ReturnType<typeof createWorkspaces> {
|
|
10
11
|
}
|
|
11
|
-
export declare function createWorkspaces(runtimeEnv: RuntimeEnvironment, plugins: ReturnType<LanguageServerPlugin>[], fsHost: FileSystemHost, configurationHost: ConfigurationHost | undefined, ts: typeof import('typescript/lib/tsserverlibrary'), tsLocalized: ts.MapLike<string> | undefined, client: vscode.ClientCapabilities, options: LanguageServerInitializationOptions, documents: ReturnType<typeof createSnapshots>, connection: vscode.Connection, cancelTokenHost:
|
|
12
|
+
export declare function createWorkspaces(runtimeEnv: RuntimeEnvironment, plugins: ReturnType<LanguageServerPlugin>[], fsHost: FileSystemHost, configurationHost: ConfigurationHost | undefined, ts: typeof import('typescript/lib/tsserverlibrary'), tsLocalized: ts.MapLike<string> | undefined, client: vscode.ClientCapabilities, options: LanguageServerInitializationOptions, documents: ReturnType<typeof createSnapshots>, connection: vscode.Connection, cancelTokenHost: CancellationTokenHost): {
|
|
12
13
|
workspaces: Map<string, Promise<{
|
|
13
14
|
projects: {
|
|
14
15
|
clear: () => void;
|
|
@@ -22,9 +23,54 @@ export declare function createWorkspaces(runtimeEnv: RuntimeEnvironment, plugins
|
|
|
22
23
|
pathHas: (rootUri: shared._2.URI, path: string) => import("./project").Project | undefined;
|
|
23
24
|
pathSet: (rootUri: shared._2.URI, path: string, item: import("./project").Project) => void;
|
|
24
25
|
};
|
|
26
|
+
documentRegistry: ts.DocumentRegistry;
|
|
25
27
|
getProjectAndTsConfig: (uri: string) => Promise<{
|
|
26
28
|
tsconfig: string;
|
|
27
29
|
project: {
|
|
30
|
+
tsConfig: ts.CompilerOptions | path.PosixPath;
|
|
31
|
+
scripts: {
|
|
32
|
+
clear: () => void;
|
|
33
|
+
values: () => IterableIterator<{
|
|
34
|
+
version: number;
|
|
35
|
+
fileName: string;
|
|
36
|
+
snapshot: ts.IScriptSnapshot | undefined;
|
|
37
|
+
snapshotVersion: number | undefined;
|
|
38
|
+
}>;
|
|
39
|
+
uriDelete: (_uri: string) => boolean;
|
|
40
|
+
uriGet: (_uri: string) => {
|
|
41
|
+
version: number;
|
|
42
|
+
fileName: string;
|
|
43
|
+
snapshot: ts.IScriptSnapshot | undefined;
|
|
44
|
+
snapshotVersion: number | undefined;
|
|
45
|
+
} | undefined;
|
|
46
|
+
uriHas: (_uri: string) => boolean;
|
|
47
|
+
uriSet: (_uri: string, item: {
|
|
48
|
+
version: number;
|
|
49
|
+
fileName: string;
|
|
50
|
+
snapshot: ts.IScriptSnapshot | undefined;
|
|
51
|
+
snapshotVersion: number | undefined;
|
|
52
|
+
}) => void;
|
|
53
|
+
pathDelete: (rootUri: shared._2.URI, path: string) => boolean;
|
|
54
|
+
pathGet: (rootUri: shared._2.URI, path: string) => {
|
|
55
|
+
version: number;
|
|
56
|
+
fileName: string;
|
|
57
|
+
snapshot: ts.IScriptSnapshot | undefined;
|
|
58
|
+
snapshotVersion: number | undefined;
|
|
59
|
+
} | undefined;
|
|
60
|
+
pathHas: (rootUri: shared._2.URI, path: string) => {
|
|
61
|
+
version: number;
|
|
62
|
+
fileName: string;
|
|
63
|
+
snapshot: ts.IScriptSnapshot | undefined;
|
|
64
|
+
snapshotVersion: number | undefined;
|
|
65
|
+
} | undefined;
|
|
66
|
+
pathSet: (rootUri: shared._2.URI, path: string, item: {
|
|
67
|
+
version: number;
|
|
68
|
+
fileName: string;
|
|
69
|
+
snapshot: ts.IScriptSnapshot | undefined;
|
|
70
|
+
snapshotVersion: number | undefined;
|
|
71
|
+
}) => void;
|
|
72
|
+
};
|
|
73
|
+
languageServiceHost: import("@volar/language-service").LanguageServiceHost;
|
|
28
74
|
getLanguageService: () => {
|
|
29
75
|
doValidation: (uri: string, token?: vscode.CancellationToken | undefined, response?: ((result: vscode.Diagnostic[]) => void) | undefined) => Promise<vscode.Diagnostic[]>;
|
|
30
76
|
findReferences: (uri: string, position: vscode.Position) => Promise<vscode.Location[] | undefined>;
|
|
@@ -35,12 +81,9 @@ export declare function createWorkspaces(runtimeEnv: RuntimeEnvironment, plugins
|
|
|
35
81
|
prepareRename: (uri: string, position: vscode.Position) => Promise<NonNullable<vscode.Range | vscode.ResponseError<void> | null | undefined> | undefined>;
|
|
36
82
|
doRename: (uri: string, position: vscode.Position, newName: string) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
37
83
|
getEditsForFileRename: (oldUri: string, newUri: string) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
38
|
-
getSemanticTokens: (uri: string, range: vscode.Range | undefined,
|
|
84
|
+
getSemanticTokens: (uri: string, range: vscode.Range | undefined, legend: vscode.SemanticTokensLegend, cancelToken: vscode.CancellationToken, reportProgress?: ((tokens: import("@volar/language-service").SemanticToken[]) => void) | undefined) => Promise<import("@volar/language-service").SemanticToken[] | undefined> | undefined;
|
|
39
85
|
doHover: (uri: string, position: vscode.Position) => Promise<vscode.Hover | undefined>;
|
|
40
|
-
doComplete: (uri: string, position: vscode.Position, completionContext?: vscode.CompletionContext | undefined) => Promise<
|
|
41
|
-
isIncomplete: boolean;
|
|
42
|
-
items: vscode.CompletionItem[];
|
|
43
|
-
}>;
|
|
86
|
+
doComplete: (uri: string, position: vscode.Position, completionContext?: vscode.CompletionContext | undefined) => Promise<vscode.CompletionList>;
|
|
44
87
|
doCodeActions: (uri: string, range: vscode.Range, codeActionContext: vscode.CodeActionContext) => Promise<vscode.CodeAction[] | undefined>;
|
|
45
88
|
doCodeActionResolve: (item: vscode.CodeAction) => Promise<vscode.CodeAction>;
|
|
46
89
|
doCompletionResolve: (item: vscode.CompletionItem) => Promise<vscode.CompletionItem>;
|
|
@@ -78,12 +121,9 @@ export declare function createWorkspaces(runtimeEnv: RuntimeEnvironment, plugins
|
|
|
78
121
|
prepareRename: (uri: string, position: vscode.Position) => Promise<NonNullable<vscode.Range | vscode.ResponseError<void> | null | undefined> | undefined>;
|
|
79
122
|
doRename: (uri: string, position: vscode.Position, newName: string) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
80
123
|
getEditsForFileRename: (oldUri: string, newUri: string) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
81
|
-
getSemanticTokens: (uri: string, range: vscode.Range | undefined,
|
|
124
|
+
getSemanticTokens: (uri: string, range: vscode.Range | undefined, legend: vscode.SemanticTokensLegend, cancelToken: vscode.CancellationToken, reportProgress?: ((tokens: import("@volar/language-service").SemanticToken[]) => void) | undefined) => Promise<import("@volar/language-service").SemanticToken[] | undefined> | undefined;
|
|
82
125
|
doHover: (uri: string, position: vscode.Position) => Promise<vscode.Hover | undefined>;
|
|
83
|
-
doComplete: (uri: string, position: vscode.Position, completionContext?: vscode.CompletionContext | undefined) => Promise<
|
|
84
|
-
isIncomplete: boolean;
|
|
85
|
-
items: vscode.CompletionItem[];
|
|
86
|
-
}>;
|
|
126
|
+
doComplete: (uri: string, position: vscode.Position, completionContext?: vscode.CompletionContext | undefined) => Promise<vscode.CompletionList>;
|
|
87
127
|
doCodeActions: (uri: string, range: vscode.Range, codeActionContext: vscode.CodeActionContext) => Promise<vscode.CodeAction[] | undefined>;
|
|
88
128
|
doCodeActionResolve: (item: vscode.CodeAction) => Promise<vscode.CodeAction>;
|
|
89
129
|
doCompletionResolve: (item: vscode.CompletionItem) => Promise<vscode.CompletionItem>;
|
|
@@ -112,16 +152,62 @@ export declare function createWorkspaces(runtimeEnv: RuntimeEnvironment, plugins
|
|
|
112
152
|
context: import("@volar/language-service").LanguageServiceRuntimeContext;
|
|
113
153
|
} | undefined;
|
|
114
154
|
getParsedCommandLine: () => ts.ParsedCommandLine;
|
|
155
|
+
tryAddFile: (fileName: string) => void;
|
|
115
156
|
dispose: () => void;
|
|
116
157
|
};
|
|
117
158
|
} | undefined>;
|
|
118
159
|
getInferredProject: () => import("./project").Project;
|
|
160
|
+
getInferredProjectDontCreate: () => import("./project").Project | undefined;
|
|
119
161
|
reload: () => void;
|
|
120
162
|
dispose(): void;
|
|
121
163
|
}>>;
|
|
122
164
|
getProject: (uri: string) => Promise<{
|
|
123
165
|
tsconfig: string;
|
|
124
166
|
project: {
|
|
167
|
+
tsConfig: ts.CompilerOptions | path.PosixPath;
|
|
168
|
+
scripts: {
|
|
169
|
+
clear: () => void;
|
|
170
|
+
values: () => IterableIterator<{
|
|
171
|
+
version: number;
|
|
172
|
+
fileName: string;
|
|
173
|
+
snapshot: ts.IScriptSnapshot | undefined;
|
|
174
|
+
snapshotVersion: number | undefined;
|
|
175
|
+
}>;
|
|
176
|
+
uriDelete: (_uri: string) => boolean;
|
|
177
|
+
uriGet: (_uri: string) => {
|
|
178
|
+
version: number;
|
|
179
|
+
fileName: string;
|
|
180
|
+
snapshot: ts.IScriptSnapshot | undefined;
|
|
181
|
+
snapshotVersion: number | undefined;
|
|
182
|
+
} | undefined;
|
|
183
|
+
uriHas: (_uri: string) => boolean;
|
|
184
|
+
uriSet: (_uri: string, item: {
|
|
185
|
+
version: number;
|
|
186
|
+
fileName: string;
|
|
187
|
+
snapshot: ts.IScriptSnapshot | undefined;
|
|
188
|
+
snapshotVersion: number | undefined;
|
|
189
|
+
}) => void;
|
|
190
|
+
pathDelete: (rootUri: shared._2.URI, path: string) => boolean;
|
|
191
|
+
pathGet: (rootUri: shared._2.URI, path: string) => {
|
|
192
|
+
version: number;
|
|
193
|
+
fileName: string;
|
|
194
|
+
snapshot: ts.IScriptSnapshot | undefined;
|
|
195
|
+
snapshotVersion: number | undefined;
|
|
196
|
+
} | undefined;
|
|
197
|
+
pathHas: (rootUri: shared._2.URI, path: string) => {
|
|
198
|
+
version: number;
|
|
199
|
+
fileName: string;
|
|
200
|
+
snapshot: ts.IScriptSnapshot | undefined;
|
|
201
|
+
snapshotVersion: number | undefined;
|
|
202
|
+
} | undefined;
|
|
203
|
+
pathSet: (rootUri: shared._2.URI, path: string, item: {
|
|
204
|
+
version: number;
|
|
205
|
+
fileName: string;
|
|
206
|
+
snapshot: ts.IScriptSnapshot | undefined;
|
|
207
|
+
snapshotVersion: number | undefined;
|
|
208
|
+
}) => void;
|
|
209
|
+
};
|
|
210
|
+
languageServiceHost: import("@volar/language-service").LanguageServiceHost;
|
|
125
211
|
getLanguageService: () => {
|
|
126
212
|
doValidation: (uri: string, token?: vscode.CancellationToken | undefined, response?: ((result: vscode.Diagnostic[]) => void) | undefined) => Promise<vscode.Diagnostic[]>;
|
|
127
213
|
findReferences: (uri: string, position: vscode.Position) => Promise<vscode.Location[] | undefined>;
|
|
@@ -132,12 +218,9 @@ export declare function createWorkspaces(runtimeEnv: RuntimeEnvironment, plugins
|
|
|
132
218
|
prepareRename: (uri: string, position: vscode.Position) => Promise<NonNullable<vscode.Range | vscode.ResponseError<void> | null | undefined> | undefined>;
|
|
133
219
|
doRename: (uri: string, position: vscode.Position, newName: string) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
134
220
|
getEditsForFileRename: (oldUri: string, newUri: string) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
135
|
-
getSemanticTokens: (uri: string, range: vscode.Range | undefined,
|
|
221
|
+
getSemanticTokens: (uri: string, range: vscode.Range | undefined, legend: vscode.SemanticTokensLegend, cancelToken: vscode.CancellationToken, reportProgress?: ((tokens: import("@volar/language-service").SemanticToken[]) => void) | undefined) => Promise<import("@volar/language-service").SemanticToken[] | undefined> | undefined;
|
|
136
222
|
doHover: (uri: string, position: vscode.Position) => Promise<vscode.Hover | undefined>;
|
|
137
|
-
doComplete: (uri: string, position: vscode.Position, completionContext?: vscode.CompletionContext | undefined) => Promise<
|
|
138
|
-
isIncomplete: boolean;
|
|
139
|
-
items: vscode.CompletionItem[];
|
|
140
|
-
}>;
|
|
223
|
+
doComplete: (uri: string, position: vscode.Position, completionContext?: vscode.CompletionContext | undefined) => Promise<vscode.CompletionList>;
|
|
141
224
|
doCodeActions: (uri: string, range: vscode.Range, codeActionContext: vscode.CodeActionContext) => Promise<vscode.CodeAction[] | undefined>;
|
|
142
225
|
doCodeActionResolve: (item: vscode.CodeAction) => Promise<vscode.CodeAction>;
|
|
143
226
|
doCompletionResolve: (item: vscode.CompletionItem) => Promise<vscode.CompletionItem>;
|
|
@@ -175,12 +258,9 @@ export declare function createWorkspaces(runtimeEnv: RuntimeEnvironment, plugins
|
|
|
175
258
|
prepareRename: (uri: string, position: vscode.Position) => Promise<NonNullable<vscode.Range | vscode.ResponseError<void> | null | undefined> | undefined>;
|
|
176
259
|
doRename: (uri: string, position: vscode.Position, newName: string) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
177
260
|
getEditsForFileRename: (oldUri: string, newUri: string) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
178
|
-
getSemanticTokens: (uri: string, range: vscode.Range | undefined,
|
|
261
|
+
getSemanticTokens: (uri: string, range: vscode.Range | undefined, legend: vscode.SemanticTokensLegend, cancelToken: vscode.CancellationToken, reportProgress?: ((tokens: import("@volar/language-service").SemanticToken[]) => void) | undefined) => Promise<import("@volar/language-service").SemanticToken[] | undefined> | undefined;
|
|
179
262
|
doHover: (uri: string, position: vscode.Position) => Promise<vscode.Hover | undefined>;
|
|
180
|
-
doComplete: (uri: string, position: vscode.Position, completionContext?: vscode.CompletionContext | undefined) => Promise<
|
|
181
|
-
isIncomplete: boolean;
|
|
182
|
-
items: vscode.CompletionItem[];
|
|
183
|
-
}>;
|
|
263
|
+
doComplete: (uri: string, position: vscode.Position, completionContext?: vscode.CompletionContext | undefined) => Promise<vscode.CompletionList>;
|
|
184
264
|
doCodeActions: (uri: string, range: vscode.Range, codeActionContext: vscode.CodeActionContext) => Promise<vscode.CodeAction[] | undefined>;
|
|
185
265
|
doCodeActionResolve: (item: vscode.CodeAction) => Promise<vscode.CodeAction>;
|
|
186
266
|
doCompletionResolve: (item: vscode.CompletionItem) => Promise<vscode.CompletionItem>;
|
|
@@ -209,11 +289,56 @@ export declare function createWorkspaces(runtimeEnv: RuntimeEnvironment, plugins
|
|
|
209
289
|
context: import("@volar/language-service").LanguageServiceRuntimeContext;
|
|
210
290
|
} | undefined;
|
|
211
291
|
getParsedCommandLine: () => ts.ParsedCommandLine;
|
|
292
|
+
tryAddFile: (fileName: string) => void;
|
|
212
293
|
dispose: () => void;
|
|
213
294
|
};
|
|
214
295
|
} | {
|
|
215
296
|
tsconfig: undefined;
|
|
216
297
|
project: {
|
|
298
|
+
tsConfig: ts.CompilerOptions | path.PosixPath;
|
|
299
|
+
scripts: {
|
|
300
|
+
clear: () => void;
|
|
301
|
+
values: () => IterableIterator<{
|
|
302
|
+
version: number;
|
|
303
|
+
fileName: string;
|
|
304
|
+
snapshot: ts.IScriptSnapshot | undefined;
|
|
305
|
+
snapshotVersion: number | undefined;
|
|
306
|
+
}>;
|
|
307
|
+
uriDelete: (_uri: string) => boolean;
|
|
308
|
+
uriGet: (_uri: string) => {
|
|
309
|
+
version: number;
|
|
310
|
+
fileName: string;
|
|
311
|
+
snapshot: ts.IScriptSnapshot | undefined;
|
|
312
|
+
snapshotVersion: number | undefined;
|
|
313
|
+
} | undefined;
|
|
314
|
+
uriHas: (_uri: string) => boolean;
|
|
315
|
+
uriSet: (_uri: string, item: {
|
|
316
|
+
version: number;
|
|
317
|
+
fileName: string;
|
|
318
|
+
snapshot: ts.IScriptSnapshot | undefined;
|
|
319
|
+
snapshotVersion: number | undefined;
|
|
320
|
+
}) => void;
|
|
321
|
+
pathDelete: (rootUri: shared._2.URI, path: string) => boolean;
|
|
322
|
+
pathGet: (rootUri: shared._2.URI, path: string) => {
|
|
323
|
+
version: number;
|
|
324
|
+
fileName: string;
|
|
325
|
+
snapshot: ts.IScriptSnapshot | undefined;
|
|
326
|
+
snapshotVersion: number | undefined;
|
|
327
|
+
} | undefined;
|
|
328
|
+
pathHas: (rootUri: shared._2.URI, path: string) => {
|
|
329
|
+
version: number;
|
|
330
|
+
fileName: string;
|
|
331
|
+
snapshot: ts.IScriptSnapshot | undefined;
|
|
332
|
+
snapshotVersion: number | undefined;
|
|
333
|
+
} | undefined;
|
|
334
|
+
pathSet: (rootUri: shared._2.URI, path: string, item: {
|
|
335
|
+
version: number;
|
|
336
|
+
fileName: string;
|
|
337
|
+
snapshot: ts.IScriptSnapshot | undefined;
|
|
338
|
+
snapshotVersion: number | undefined;
|
|
339
|
+
}) => void;
|
|
340
|
+
};
|
|
341
|
+
languageServiceHost: import("@volar/language-service").LanguageServiceHost;
|
|
217
342
|
getLanguageService: () => {
|
|
218
343
|
doValidation: (uri: string, token?: vscode.CancellationToken | undefined, response?: ((result: vscode.Diagnostic[]) => void) | undefined) => Promise<vscode.Diagnostic[]>;
|
|
219
344
|
findReferences: (uri: string, position: vscode.Position) => Promise<vscode.Location[] | undefined>;
|
|
@@ -224,12 +349,9 @@ export declare function createWorkspaces(runtimeEnv: RuntimeEnvironment, plugins
|
|
|
224
349
|
prepareRename: (uri: string, position: vscode.Position) => Promise<NonNullable<vscode.Range | vscode.ResponseError<void> | null | undefined> | undefined>;
|
|
225
350
|
doRename: (uri: string, position: vscode.Position, newName: string) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
226
351
|
getEditsForFileRename: (oldUri: string, newUri: string) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
227
|
-
getSemanticTokens: (uri: string, range: vscode.Range | undefined,
|
|
352
|
+
getSemanticTokens: (uri: string, range: vscode.Range | undefined, legend: vscode.SemanticTokensLegend, cancelToken: vscode.CancellationToken, reportProgress?: ((tokens: import("@volar/language-service").SemanticToken[]) => void) | undefined) => Promise<import("@volar/language-service").SemanticToken[] | undefined> | undefined;
|
|
228
353
|
doHover: (uri: string, position: vscode.Position) => Promise<vscode.Hover | undefined>;
|
|
229
|
-
doComplete: (uri: string, position: vscode.Position, completionContext?: vscode.CompletionContext | undefined) => Promise<
|
|
230
|
-
isIncomplete: boolean;
|
|
231
|
-
items: vscode.CompletionItem[];
|
|
232
|
-
}>;
|
|
354
|
+
doComplete: (uri: string, position: vscode.Position, completionContext?: vscode.CompletionContext | undefined) => Promise<vscode.CompletionList>;
|
|
233
355
|
doCodeActions: (uri: string, range: vscode.Range, codeActionContext: vscode.CodeActionContext) => Promise<vscode.CodeAction[] | undefined>;
|
|
234
356
|
doCodeActionResolve: (item: vscode.CodeAction) => Promise<vscode.CodeAction>;
|
|
235
357
|
doCompletionResolve: (item: vscode.CompletionItem) => Promise<vscode.CompletionItem>;
|
|
@@ -267,12 +389,9 @@ export declare function createWorkspaces(runtimeEnv: RuntimeEnvironment, plugins
|
|
|
267
389
|
prepareRename: (uri: string, position: vscode.Position) => Promise<NonNullable<vscode.Range | vscode.ResponseError<void> | null | undefined> | undefined>;
|
|
268
390
|
doRename: (uri: string, position: vscode.Position, newName: string) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
269
391
|
getEditsForFileRename: (oldUri: string, newUri: string) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
270
|
-
getSemanticTokens: (uri: string, range: vscode.Range | undefined,
|
|
392
|
+
getSemanticTokens: (uri: string, range: vscode.Range | undefined, legend: vscode.SemanticTokensLegend, cancelToken: vscode.CancellationToken, reportProgress?: ((tokens: import("@volar/language-service").SemanticToken[]) => void) | undefined) => Promise<import("@volar/language-service").SemanticToken[] | undefined> | undefined;
|
|
271
393
|
doHover: (uri: string, position: vscode.Position) => Promise<vscode.Hover | undefined>;
|
|
272
|
-
doComplete: (uri: string, position: vscode.Position, completionContext?: vscode.CompletionContext | undefined) => Promise<
|
|
273
|
-
isIncomplete: boolean;
|
|
274
|
-
items: vscode.CompletionItem[];
|
|
275
|
-
}>;
|
|
394
|
+
doComplete: (uri: string, position: vscode.Position, completionContext?: vscode.CompletionContext | undefined) => Promise<vscode.CompletionList>;
|
|
276
395
|
doCodeActions: (uri: string, range: vscode.Range, codeActionContext: vscode.CodeActionContext) => Promise<vscode.CodeAction[] | undefined>;
|
|
277
396
|
doCodeActionResolve: (item: vscode.CodeAction) => Promise<vscode.CodeAction>;
|
|
278
397
|
doCompletionResolve: (item: vscode.CompletionItem) => Promise<vscode.CompletionItem>;
|
|
@@ -301,6 +420,7 @@ export declare function createWorkspaces(runtimeEnv: RuntimeEnvironment, plugins
|
|
|
301
420
|
context: import("@volar/language-service").LanguageServiceRuntimeContext;
|
|
302
421
|
} | undefined;
|
|
303
422
|
getParsedCommandLine: () => ts.ParsedCommandLine;
|
|
423
|
+
tryAddFile: (fileName: string) => void;
|
|
304
424
|
dispose: () => void;
|
|
305
425
|
} | undefined;
|
|
306
426
|
} | undefined>;
|
package/out/utils/workspaces.js
CHANGED
|
@@ -30,6 +30,9 @@ function createWorkspaces(runtimeEnv, plugins, fsHost, configurationHost, ts, ts
|
|
|
30
30
|
if (tsConfigChanges.length) {
|
|
31
31
|
reloadDiagnostics();
|
|
32
32
|
}
|
|
33
|
+
else {
|
|
34
|
+
onDriveFileUpdated();
|
|
35
|
+
}
|
|
33
36
|
});
|
|
34
37
|
(_a = runtimeEnv.onDidChangeConfiguration) === null || _a === void 0 ? void 0 : _a.call(runtimeEnv, () => __awaiter(this, void 0, void 0, function* () {
|
|
35
38
|
onDriveFileUpdated();
|
|
@@ -39,7 +42,9 @@ function createWorkspaces(runtimeEnv, plugins, fsHost, configurationHost, ts, ts
|
|
|
39
42
|
getProject,
|
|
40
43
|
reloadProject,
|
|
41
44
|
add: (rootUri) => {
|
|
42
|
-
workspaces.
|
|
45
|
+
if (!workspaces.has(rootUri.toString())) {
|
|
46
|
+
workspaces.set(rootUri.toString(), (0, workspaceProjects_1.createWorkspaceProjects)(runtimeEnv, plugins, fsHost, rootUri, ts, tsLocalized, documents, configurationHost, cancelTokenHost, options));
|
|
47
|
+
}
|
|
43
48
|
},
|
|
44
49
|
remove: (rootUri) => {
|
|
45
50
|
const _workspace = workspaces.get(rootUri.toString());
|
|
@@ -87,7 +92,7 @@ function createWorkspaces(runtimeEnv, plugins, fsHost, configurationHost, ts, ts
|
|
|
87
92
|
return;
|
|
88
93
|
const req = ++documentUpdatedReq;
|
|
89
94
|
const delay = (_b = yield (configurationHost === null || configurationHost === void 0 ? void 0 : configurationHost.getConfiguration('volar.diagnostics.delay'))) !== null && _b !== void 0 ? _b : 200;
|
|
90
|
-
const cancel = cancelTokenHost.
|
|
95
|
+
const cancel = cancelTokenHost.createCancellationToken({
|
|
91
96
|
get isCancellationRequested() {
|
|
92
97
|
return req !== documentUpdatedReq;
|
|
93
98
|
},
|
|
@@ -109,6 +114,8 @@ function createWorkspaces(runtimeEnv, plugins, fsHost, configurationHost, ts, ts
|
|
|
109
114
|
function sendDocumentDiagnostics(uri, version, cancel) {
|
|
110
115
|
var _a;
|
|
111
116
|
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
+
if (cancel.isCancellationRequested)
|
|
118
|
+
return;
|
|
112
119
|
const project = (_a = (yield getProject(uri))) === null || _a === void 0 ? void 0 : _a.project;
|
|
113
120
|
if (!project)
|
|
114
121
|
return;
|
|
@@ -145,9 +152,11 @@ function createWorkspaces(runtimeEnv, plugins, fsHost, configurationHost, ts, ts
|
|
|
145
152
|
}
|
|
146
153
|
}
|
|
147
154
|
if (rootUris.length) {
|
|
155
|
+
const project = yield ((_a = (yield workspaces.get(rootUris[0]))) === null || _a === void 0 ? void 0 : _a.getInferredProject());
|
|
156
|
+
project === null || project === void 0 ? void 0 : project.tryAddFile(shared.getPathOfUri(uri));
|
|
148
157
|
return {
|
|
149
158
|
tsconfig: undefined,
|
|
150
|
-
project
|
|
159
|
+
project,
|
|
151
160
|
};
|
|
152
161
|
}
|
|
153
162
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/language-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"main": "out/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
"directory": "packages/language-server"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@volar/language-core": "1.0.
|
|
21
|
-
"@volar/language-service": "1.0.
|
|
22
|
-
"@volar/shared": "1.0.
|
|
23
|
-
"request-light": "^0.
|
|
20
|
+
"@volar/language-core": "1.0.10",
|
|
21
|
+
"@volar/language-service": "1.0.10",
|
|
22
|
+
"@volar/shared": "1.0.10",
|
|
23
|
+
"request-light": "^0.6.0",
|
|
24
24
|
"typesafe-path": "^0.2.2",
|
|
25
|
-
"vscode-html-languageservice": "^5.0.
|
|
25
|
+
"vscode-html-languageservice": "^5.0.3",
|
|
26
26
|
"vscode-languageserver": "^8.0.2",
|
|
27
27
|
"vscode-languageserver-protocol": "^3.17.2",
|
|
28
28
|
"vscode-languageserver-textdocument": "^1.0.7",
|
|
29
29
|
"vscode-uri": "^3.0.6"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "89b82f92fdc30674b03941c5f17c60df8c46211c"
|
|
32
32
|
}
|