@volar/language-server 1.6.9-patch.1 → 1.7.0
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/browser/index.js +57 -62
- package/out/common/cancellationPipe.js +2 -6
- package/out/common/configurationHost.js +7 -2
- package/out/common/documents.d.ts +2 -2
- package/out/common/documents.js +10 -2
- package/out/common/features/customFeatures.js +6 -5
- package/out/common/features/languageFeatures.js +5 -5
- package/out/common/project.d.ts +112 -112
- package/out/common/project.js +147 -260
- package/out/common/server.d.ts +5 -1
- package/out/common/server.js +83 -12
- package/out/common/workspace.d.ts +288 -289
- package/out/common/workspace.js +16 -16
- package/out/common/workspaces.d.ts +354 -357
- package/out/common/workspaces.js +3 -6
- package/out/node/index.js +82 -83
- package/out/protocol.d.ts +5 -2
- package/out/protocol.js +16 -12
- package/out/types.d.ts +12 -44
- package/out/types.js +2 -2
- package/package.json +7 -6
package/out/browser/index.js
CHANGED
|
@@ -15,12 +15,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.startLanguageServer = exports.createConnection = void 0;
|
|
18
|
-
const request_light_1 = require("request-light");
|
|
19
18
|
const vscode = require("vscode-languageserver/browser");
|
|
20
19
|
const server_1 = require("../common/server");
|
|
21
20
|
const http_1 = require("../common/schemaRequestHandlers/http");
|
|
22
|
-
const fileSystems_1 = require("./fileSystems");
|
|
23
21
|
const vscode_uri_1 = require("vscode-uri");
|
|
22
|
+
const protocol_1 = require("../protocol");
|
|
24
23
|
__exportStar(require("../index"), exports);
|
|
25
24
|
function createConnection() {
|
|
26
25
|
const messageReader = new vscode.BrowserMessageReader(self);
|
|
@@ -30,68 +29,64 @@ function createConnection() {
|
|
|
30
29
|
}
|
|
31
30
|
exports.createConnection = createConnection;
|
|
32
31
|
function startLanguageServer(connection, ...plugins) {
|
|
33
|
-
(0, server_1.startCommonLanguageServer)(connection, (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
timer: {
|
|
41
|
-
setImmediate(callback, ...args) {
|
|
42
|
-
const handle = setTimeout(callback, 0, ...args);
|
|
43
|
-
return { dispose: () => clearTimeout(handle) };
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
loadTypescript() {
|
|
47
|
-
return require('typescript'); // force bundle because not support load by user config in web
|
|
48
|
-
},
|
|
49
|
-
async loadTypescriptLocalized(tsdk, locale) {
|
|
50
|
-
try {
|
|
51
|
-
const uri = fileNameToUri(`${tsdk}/${locale}/diagnosticMessages.generated.json`);
|
|
52
|
-
const json = await (0, http_1.default)(uri);
|
|
53
|
-
if (json) {
|
|
54
|
-
return JSON.parse(json);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
catch { }
|
|
58
|
-
},
|
|
59
|
-
schemaRequestHandlers: {
|
|
60
|
-
http: http_1.default,
|
|
61
|
-
https: http_1.default,
|
|
62
|
-
},
|
|
63
|
-
onDidChangeConfiguration(settings) {
|
|
64
|
-
(0, request_light_1.configure)(settings.http && settings.http.proxy, settings.http && settings.http.proxyStrictSSL);
|
|
65
|
-
},
|
|
66
|
-
fileSystemProvide: undefined,
|
|
67
|
-
createFileSystemHost: fileSystems_1.createWebFileSystemHost,
|
|
32
|
+
(0, server_1.startCommonLanguageServer)(connection, plugins, () => ({
|
|
33
|
+
uriToFileName,
|
|
34
|
+
fileNameToUri,
|
|
35
|
+
timer: {
|
|
36
|
+
setImmediate(callback, ...args) {
|
|
37
|
+
const handle = setTimeout(callback, 0, ...args);
|
|
38
|
+
return { dispose: () => clearTimeout(handle) };
|
|
68
39
|
},
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
40
|
+
},
|
|
41
|
+
loadTypescript() {
|
|
42
|
+
return require('typescript'); // force bundle because not support load by user config in web
|
|
43
|
+
},
|
|
44
|
+
async loadTypescriptLocalized(tsdk, locale) {
|
|
45
|
+
try {
|
|
46
|
+
const uri = fileNameToUri(`${tsdk}/${locale}/diagnosticMessages.generated.json`);
|
|
47
|
+
const json = await (0, http_1.default)(uri);
|
|
48
|
+
if (json) {
|
|
49
|
+
return JSON.parse(json);
|
|
50
|
+
}
|
|
74
51
|
}
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
});
|
|
52
|
+
catch { }
|
|
53
|
+
},
|
|
54
|
+
fs: {
|
|
55
|
+
stat(uri) {
|
|
56
|
+
return connection.sendRequest(protocol_1.FsStatRequest.type, uri);
|
|
57
|
+
},
|
|
58
|
+
async readFile(uri, encoding) {
|
|
59
|
+
if (uri.startsWith('http://') || uri.startsWith('https://')) {
|
|
60
|
+
return await (0, http_1.default)(uri);
|
|
61
|
+
}
|
|
62
|
+
const data = await connection.sendRequest(protocol_1.FsReadFileRequest.type, uri);
|
|
63
|
+
if (data) {
|
|
64
|
+
return new TextDecoder(encoding ?? 'utf8').decode(data);
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
async readDirectory(uri) {
|
|
68
|
+
return connection.sendRequest(protocol_1.FsReadDirectoryRequest.type, uri);
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
}));
|
|
95
72
|
}
|
|
96
73
|
exports.startLanguageServer = startLanguageServer;
|
|
74
|
+
function uriToFileName(uri) {
|
|
75
|
+
const parsed = vscode_uri_1.URI.parse(uri);
|
|
76
|
+
return `/${parsed.scheme}${parsed.authority ? '@' + parsed.authority : ''}${parsed.path}`;
|
|
77
|
+
}
|
|
78
|
+
;
|
|
79
|
+
function fileNameToUri(fileName) {
|
|
80
|
+
const parts = fileName.split('/');
|
|
81
|
+
if (parts.length <= 1) {
|
|
82
|
+
return vscode_uri_1.URI.from({ scheme: '', path: '' }).toString();
|
|
83
|
+
}
|
|
84
|
+
const firstParts = parts[1].split('@');
|
|
85
|
+
return vscode_uri_1.URI.from({
|
|
86
|
+
scheme: firstParts[0],
|
|
87
|
+
authority: firstParts.length > 1 ? firstParts[1] : undefined,
|
|
88
|
+
path: '/' + parts.slice(2).join('/'),
|
|
89
|
+
}).toString();
|
|
90
|
+
}
|
|
91
|
+
;
|
|
97
92
|
//# sourceMappingURL=index.js.map
|
|
@@ -33,12 +33,8 @@ function createCancellationTokenHost(_cancellationPipeName) {
|
|
|
33
33
|
return token;
|
|
34
34
|
}
|
|
35
35
|
function getMtime() {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
catch {
|
|
40
|
-
return -1;
|
|
41
|
-
}
|
|
36
|
+
const stat = fs.statSync(cancellationPipeName, { throwIfNoEntry: false });
|
|
37
|
+
return stat?.mtime.valueOf() ?? -1;
|
|
42
38
|
}
|
|
43
39
|
}
|
|
44
40
|
exports.createCancellationTokenHost = createCancellationTokenHost;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createConfigurationHost = void 0;
|
|
4
4
|
const vscode = require("vscode-languageserver");
|
|
5
5
|
function createConfigurationHost(params, connection) {
|
|
6
|
-
const callbacks =
|
|
6
|
+
const callbacks = new Set();
|
|
7
7
|
const cache = new Map();
|
|
8
8
|
connection.onDidChangeConfiguration(async () => {
|
|
9
9
|
cache.clear();
|
|
@@ -27,7 +27,12 @@ function createConfigurationHost(params, connection) {
|
|
|
27
27
|
return await getConfigurationWorker(section, scopeUri);
|
|
28
28
|
},
|
|
29
29
|
onDidChangeConfiguration(cb) {
|
|
30
|
-
callbacks.
|
|
30
|
+
callbacks.add(cb);
|
|
31
|
+
return {
|
|
32
|
+
dispose() {
|
|
33
|
+
callbacks.delete(cb);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
31
36
|
},
|
|
32
37
|
};
|
|
33
38
|
async function getConfigurationWorker(section, scopeUri) {
|
|
@@ -39,7 +39,7 @@ export declare function createDocuments(env: RuntimeEnvironment, connection: vsc
|
|
|
39
39
|
pathHas: (path: string) => IncrementalScriptSnapshot | undefined;
|
|
40
40
|
pathSet: (path: string, item: IncrementalScriptSnapshot) => void;
|
|
41
41
|
};
|
|
42
|
-
onDidChangeContent: (cb: (params: vscode.DidChangeTextDocumentParams) => void) =>
|
|
43
|
-
onDidClose: (cb: (params: vscode.DidCloseTextDocumentParams) => void) =>
|
|
42
|
+
onDidChangeContent: (cb: (params: vscode.DidChangeTextDocumentParams) => void) => vscode.Disposable;
|
|
43
|
+
onDidClose: (cb: (params: vscode.DidCloseTextDocumentParams) => void) => vscode.Disposable;
|
|
44
44
|
};
|
|
45
45
|
export {};
|
package/out/common/documents.js
CHANGED
|
@@ -196,11 +196,19 @@ function createDocuments(env, connection) {
|
|
|
196
196
|
data: snapshots,
|
|
197
197
|
onDidChangeContent: (cb) => {
|
|
198
198
|
onDidChangeContents.add(cb);
|
|
199
|
-
return
|
|
199
|
+
return {
|
|
200
|
+
dispose() {
|
|
201
|
+
onDidChangeContents.delete(cb);
|
|
202
|
+
},
|
|
203
|
+
};
|
|
200
204
|
},
|
|
201
205
|
onDidClose: (cb) => {
|
|
202
206
|
onDidCloses.add(cb);
|
|
203
|
-
return
|
|
207
|
+
return {
|
|
208
|
+
dispose() {
|
|
209
|
+
onDidCloses.delete(cb);
|
|
210
|
+
},
|
|
211
|
+
};
|
|
204
212
|
},
|
|
205
213
|
};
|
|
206
214
|
}
|
|
@@ -45,12 +45,12 @@ function register(connection, workspaces, env) {
|
|
|
45
45
|
const project = await workspace.getInferredProject();
|
|
46
46
|
if (!project)
|
|
47
47
|
return [];
|
|
48
|
-
return project.
|
|
48
|
+
return project.languageHost.getScriptFileNames();
|
|
49
49
|
}
|
|
50
50
|
for (const _project of workspace.projects.values()) {
|
|
51
51
|
const project = await _project;
|
|
52
52
|
if (project.tsConfig === params.tsconfig) {
|
|
53
|
-
return project.
|
|
53
|
+
return project.languageHost.getScriptFileNames();
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
return [];
|
|
@@ -58,7 +58,7 @@ function register(connection, workspaces, env) {
|
|
|
58
58
|
connection.onRequest(protocol_1.GetVirtualFilesRequest.type, async (document) => {
|
|
59
59
|
const project = await workspaces.getProject(document.uri);
|
|
60
60
|
if (project) {
|
|
61
|
-
const file = project.project?.getLanguageService()
|
|
61
|
+
const file = project.project?.getLanguageService()?.context.virtualFiles.getSource(env.uriToFileName(document.uri))?.root;
|
|
62
62
|
return file ? prune(file) : undefined;
|
|
63
63
|
function prune(file) {
|
|
64
64
|
let version = scriptVersions.get(file.fileName) ?? 0;
|
|
@@ -80,7 +80,7 @@ function register(connection, workspaces, env) {
|
|
|
80
80
|
connection.onRequest(protocol_1.GetVirtualFileRequest.type, async (params) => {
|
|
81
81
|
const project = await workspaces.getProject(params.sourceFileUri);
|
|
82
82
|
if (project) {
|
|
83
|
-
const [virtualFile, source] = project.project?.getLanguageService()
|
|
83
|
+
const [virtualFile, source] = project.project?.getLanguageService()?.context.virtualFiles.getVirtualFile(params.virtualFileName) ?? [];
|
|
84
84
|
if (virtualFile && source) {
|
|
85
85
|
const mappings = {};
|
|
86
86
|
for (const mapping of virtualFile.mappings) {
|
|
@@ -105,10 +105,11 @@ function register(connection, workspaces, env) {
|
|
|
105
105
|
if (project) {
|
|
106
106
|
const ls = (await project.project)?.getLanguageServiceDontCreate();
|
|
107
107
|
if (ls) {
|
|
108
|
+
const rootPath = ls.context.env.uriToFileName(ls.context.env.rootUri.toString());
|
|
108
109
|
for (const { root } of ls.context.virtualFiles.allSources()) {
|
|
109
110
|
(0, language_core_1.forEachEmbeddedFile)(root, virtualFile => {
|
|
110
111
|
if (virtualFile.kind === language_core_1.FileKind.TypeScriptHostFile) {
|
|
111
|
-
if (virtualFile.fileName.startsWith(
|
|
112
|
+
if (virtualFile.fileName.startsWith(rootPath)) {
|
|
112
113
|
const snapshot = virtualFile.snapshot;
|
|
113
114
|
fs.writeFile(virtualFile.fileName, snapshot.getText(0, snapshot.getLength()), () => { });
|
|
114
115
|
}
|
|
@@ -289,8 +289,9 @@ function register(connection, projects, initParams, initOptions, cancelHost, sem
|
|
|
289
289
|
resolve(undefined);
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
const
|
|
293
|
-
if (
|
|
292
|
+
const project = await getProject(uri);
|
|
293
|
+
if (project) {
|
|
294
|
+
const service = project.getLanguageService();
|
|
294
295
|
try { // handle TS cancel throw
|
|
295
296
|
const result = await cb(service);
|
|
296
297
|
if (token.isCancellationRequested) {
|
|
@@ -310,9 +311,8 @@ function register(connection, projects, initParams, initOptions, cancelHost, sem
|
|
|
310
311
|
});
|
|
311
312
|
});
|
|
312
313
|
}
|
|
313
|
-
async function
|
|
314
|
-
|
|
315
|
-
return project?.getLanguageService();
|
|
314
|
+
async function getProject(uri) {
|
|
315
|
+
return (await projects.getProject(uri))?.project;
|
|
316
316
|
}
|
|
317
317
|
function fixTextEdit(item) {
|
|
318
318
|
const insertReplaceSupport = initParams.capabilities.textDocument?.completion?.completionItem?.insertReplaceSupport ?? false;
|
package/out/common/project.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
3
|
-
import * as path from 'typesafe-path';
|
|
1
|
+
import { TypeScriptLanguageHost } from '@volar/language-service';
|
|
2
|
+
import * as path from 'typesafe-path/posix';
|
|
4
3
|
import type * as ts from 'typescript/lib/tsserverlibrary';
|
|
4
|
+
import * as vscode from 'vscode-languageserver';
|
|
5
5
|
import { URI } from 'vscode-uri';
|
|
6
6
|
import { WorkspaceContext } from './workspace';
|
|
7
7
|
export interface ProjectContext extends WorkspaceContext {
|
|
@@ -12,158 +12,158 @@ export interface ProjectContext extends WorkspaceContext {
|
|
|
12
12
|
}
|
|
13
13
|
export type Project = ReturnType<typeof createProject>;
|
|
14
14
|
export declare function createProject(context: ProjectContext): Promise<{
|
|
15
|
-
|
|
15
|
+
context: ProjectContext;
|
|
16
16
|
tsConfig: path.PosixPath | ts.CompilerOptions;
|
|
17
17
|
scripts: {
|
|
18
18
|
clear: () => void;
|
|
19
19
|
values: () => IterableIterator<{
|
|
20
|
+
snapshot: ts.IScriptSnapshot;
|
|
20
21
|
version: number;
|
|
21
|
-
|
|
22
|
-
snapshot: ts.IScriptSnapshot | undefined;
|
|
23
|
-
snapshotVersion: number | undefined;
|
|
24
|
-
}>;
|
|
22
|
+
} | undefined>;
|
|
25
23
|
uriDelete: (_uri: string) => boolean;
|
|
26
24
|
uriGet: (_uri: string) => {
|
|
25
|
+
snapshot: ts.IScriptSnapshot;
|
|
27
26
|
version: number;
|
|
28
|
-
fileName: string;
|
|
29
|
-
snapshot: ts.IScriptSnapshot | undefined;
|
|
30
|
-
snapshotVersion: number | undefined;
|
|
31
27
|
} | undefined;
|
|
32
28
|
uriHas: (_uri: string) => boolean;
|
|
33
29
|
uriSet: (_uri: string, item: {
|
|
30
|
+
snapshot: ts.IScriptSnapshot;
|
|
34
31
|
version: number;
|
|
35
|
-
|
|
36
|
-
snapshot: ts.IScriptSnapshot | undefined;
|
|
37
|
-
snapshotVersion: number | undefined;
|
|
38
|
-
}) => void;
|
|
32
|
+
} | undefined) => void;
|
|
39
33
|
pathDelete: (path: string) => boolean;
|
|
40
34
|
pathGet: (path: string) => {
|
|
35
|
+
snapshot: ts.IScriptSnapshot;
|
|
41
36
|
version: number;
|
|
42
|
-
fileName: string;
|
|
43
|
-
snapshot: ts.IScriptSnapshot | undefined;
|
|
44
|
-
snapshotVersion: number | undefined;
|
|
45
37
|
} | undefined;
|
|
46
38
|
pathHas: (path: string) => {
|
|
39
|
+
snapshot: ts.IScriptSnapshot;
|
|
47
40
|
version: number;
|
|
48
|
-
fileName: string;
|
|
49
|
-
snapshot: ts.IScriptSnapshot | undefined;
|
|
50
|
-
snapshotVersion: number | undefined;
|
|
51
41
|
} | undefined;
|
|
52
42
|
pathSet: (path: string, item: {
|
|
43
|
+
snapshot: ts.IScriptSnapshot;
|
|
53
44
|
version: number;
|
|
54
|
-
|
|
55
|
-
snapshot: ts.IScriptSnapshot | undefined;
|
|
56
|
-
snapshotVersion: number | undefined;
|
|
57
|
-
}) => void;
|
|
45
|
+
} | undefined) => void;
|
|
58
46
|
};
|
|
59
|
-
|
|
47
|
+
languageHost: TypeScriptLanguageHost;
|
|
60
48
|
getLanguageService: () => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
format: (uri: string, options:
|
|
49
|
+
getTriggerCharacters: () => string[];
|
|
50
|
+
getAutoFormatTriggerCharacters: () => string[];
|
|
51
|
+
getSignatureHelpTriggerCharacters: () => string[];
|
|
52
|
+
getSignatureHelpRetriggerCharacters: () => string[];
|
|
53
|
+
format: (uri: string, options: vscode.FormattingOptions, range: vscode.Range | undefined, onTypeParams: {
|
|
66
54
|
ch: string;
|
|
67
|
-
position:
|
|
68
|
-
} | undefined, token?:
|
|
69
|
-
getFoldingRanges: (uri: string, token?:
|
|
70
|
-
getSelectionRanges: (uri: string, positions:
|
|
71
|
-
findLinkedEditingRanges: (uri: string, position:
|
|
72
|
-
findDocumentSymbols: (uri: string, token?:
|
|
73
|
-
findDocumentColors: (uri: string, token?:
|
|
74
|
-
getColorPresentations: (uri: string, color:
|
|
75
|
-
doValidation: (uri: string, mode: "all" | "semantic" | "syntactic", token?:
|
|
76
|
-
findReferences: (uri: string, position:
|
|
77
|
-
findFileReferences: (uri: string, token?:
|
|
78
|
-
findDefinition: (uri: string, position:
|
|
79
|
-
findTypeDefinition: (uri: string, position:
|
|
80
|
-
findImplementations: (uri: string, position:
|
|
81
|
-
prepareRename: (uri: string, position:
|
|
82
|
-
range:
|
|
55
|
+
position: vscode.Position;
|
|
56
|
+
} | undefined, token?: vscode.CancellationToken | undefined) => Promise<vscode.TextEdit[] | undefined>;
|
|
57
|
+
getFoldingRanges: (uri: string, token?: vscode.CancellationToken | undefined) => Promise<vscode.FoldingRange[] | undefined>;
|
|
58
|
+
getSelectionRanges: (uri: string, positions: vscode.Position[], token?: vscode.CancellationToken | undefined) => Promise<vscode.SelectionRange[] | undefined>;
|
|
59
|
+
findLinkedEditingRanges: (uri: string, position: vscode.Position, token?: vscode.CancellationToken | undefined) => Promise<vscode.LinkedEditingRanges | undefined>;
|
|
60
|
+
findDocumentSymbols: (uri: string, token?: vscode.CancellationToken | undefined) => Promise<vscode.DocumentSymbol[] | undefined>;
|
|
61
|
+
findDocumentColors: (uri: string, token?: vscode.CancellationToken | undefined) => Promise<vscode.ColorInformation[] | undefined>;
|
|
62
|
+
getColorPresentations: (uri: string, color: vscode.Color, range: vscode.Range, token?: vscode.CancellationToken | undefined) => Promise<vscode.ColorPresentation[] | undefined>;
|
|
63
|
+
doValidation: (uri: string, mode: "all" | "semantic" | "syntactic", token?: vscode.CancellationToken | undefined, response?: ((result: vscode.Diagnostic[]) => void) | undefined) => Promise<vscode.Diagnostic[]>;
|
|
64
|
+
findReferences: (uri: string, position: vscode.Position, token?: vscode.CancellationToken | undefined) => Promise<vscode.Location[] | undefined>;
|
|
65
|
+
findFileReferences: (uri: string, token?: vscode.CancellationToken | undefined) => import("@volar/language-service").NullableResult<vscode.Location[]>;
|
|
66
|
+
findDefinition: (uri: string, position: vscode.Position, token?: vscode.CancellationToken | undefined) => Promise<vscode.LocationLink[] | undefined>;
|
|
67
|
+
findTypeDefinition: (uri: string, position: vscode.Position, token?: vscode.CancellationToken | undefined) => Promise<vscode.LocationLink[] | undefined>;
|
|
68
|
+
findImplementations: (uri: string, position: vscode.Position, token?: vscode.CancellationToken | undefined) => Promise<vscode.LocationLink[] | undefined>;
|
|
69
|
+
prepareRename: (uri: string, position: vscode.Position, token?: vscode.CancellationToken | undefined) => Promise<NonNullable<vscode.Range | {
|
|
70
|
+
range: vscode.Range;
|
|
83
71
|
placeholder: string;
|
|
84
72
|
} | {
|
|
85
73
|
message: string;
|
|
86
74
|
} | null | undefined> | undefined>;
|
|
87
|
-
doRename: (uri: string, position:
|
|
88
|
-
getEditsForFileRename: (oldUri: string, newUri: string, token?:
|
|
89
|
-
getSemanticTokens: (uri: string, range:
|
|
90
|
-
doHover: (uri: string, position:
|
|
91
|
-
doComplete: (uri: string, position:
|
|
92
|
-
doCodeActions: (uri: string, range:
|
|
93
|
-
doCodeActionResolve: (item:
|
|
94
|
-
doCompletionResolve: (item:
|
|
95
|
-
getSignatureHelp: (uri: string, position:
|
|
96
|
-
doCodeLens: (uri: string, token?:
|
|
97
|
-
doCodeLensResolve: (item:
|
|
98
|
-
findDocumentHighlights: (uri: string, position:
|
|
99
|
-
findDocumentLinks: (uri: string, token?:
|
|
100
|
-
doDocumentLinkResolve: (item:
|
|
101
|
-
findWorkspaceSymbols: (query: string, token?:
|
|
102
|
-
doAutoInsert: (uri: string, position:
|
|
103
|
-
getInlayHints: (uri: string, range:
|
|
104
|
-
doInlayHintResolve: (item:
|
|
75
|
+
doRename: (uri: string, position: vscode.Position, newName: string, token?: vscode.CancellationToken | undefined) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
76
|
+
getEditsForFileRename: (oldUri: string, newUri: string, token?: vscode.CancellationToken | undefined) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
77
|
+
getSemanticTokens: (uri: string, range: vscode.Range | undefined, legend: vscode.SemanticTokensLegend, token?: vscode.CancellationToken | undefined, reportProgress?: ((tokens: vscode.SemanticTokens) => void) | undefined) => Promise<vscode.SemanticTokens | undefined>;
|
|
78
|
+
doHover: (uri: string, position: vscode.Position, token?: vscode.CancellationToken | undefined) => Promise<vscode.Hover | undefined>;
|
|
79
|
+
doComplete: (uri: string, position: vscode.Position, completionContext?: vscode.CompletionContext | undefined, token?: vscode.CancellationToken | undefined) => Promise<vscode.CompletionList>;
|
|
80
|
+
doCodeActions: (uri: string, range: vscode.Range, codeActionContext: vscode.CodeActionContext, token?: vscode.CancellationToken | undefined) => Promise<vscode.CodeAction[] | undefined>;
|
|
81
|
+
doCodeActionResolve: (item: vscode.CodeAction, token?: vscode.CancellationToken | undefined) => Promise<vscode.CodeAction>;
|
|
82
|
+
doCompletionResolve: (item: vscode.CompletionItem, token?: vscode.CancellationToken | undefined) => Promise<vscode.CompletionItem>;
|
|
83
|
+
getSignatureHelp: (uri: string, position: vscode.Position, signatureHelpContext?: vscode.SignatureHelpContext | undefined, token?: vscode.CancellationToken | undefined) => Promise<vscode.SignatureHelp | undefined>;
|
|
84
|
+
doCodeLens: (uri: string, token?: vscode.CancellationToken | undefined) => Promise<vscode.CodeLens[]>;
|
|
85
|
+
doCodeLensResolve: (item: vscode.CodeLens, token?: vscode.CancellationToken | undefined) => Promise<vscode.CodeLens>;
|
|
86
|
+
findDocumentHighlights: (uri: string, position: vscode.Position, token?: vscode.CancellationToken | undefined) => Promise<vscode.DocumentHighlight[] | undefined>;
|
|
87
|
+
findDocumentLinks: (uri: string, token?: vscode.CancellationToken | undefined) => Promise<vscode.DocumentLink[]>;
|
|
88
|
+
doDocumentLinkResolve: (item: vscode.CodeLens, token?: vscode.CancellationToken | undefined) => Promise<vscode.CodeLens>;
|
|
89
|
+
findWorkspaceSymbols: (query: string, token?: vscode.CancellationToken | undefined) => Promise<vscode.WorkspaceSymbol[]>;
|
|
90
|
+
doAutoInsert: (uri: string, position: vscode.Position, autoInsertContext: import("@volar/language-service").AutoInsertionContext, token?: vscode.CancellationToken | undefined) => Promise<NonNullable<string | vscode.TextEdit | null | undefined> | undefined>;
|
|
91
|
+
getInlayHints: (uri: string, range: vscode.Range, token?: vscode.CancellationToken | undefined) => Promise<vscode.InlayHint[] | undefined>;
|
|
92
|
+
doInlayHintResolve: (item: vscode.InlayHint, token?: vscode.CancellationToken | undefined) => Promise<vscode.InlayHint>;
|
|
105
93
|
callHierarchy: {
|
|
106
|
-
doPrepare(uri: string, position:
|
|
107
|
-
getIncomingCalls(item:
|
|
108
|
-
getOutgoingCalls(item:
|
|
94
|
+
doPrepare(uri: string, position: vscode.Position, token?: vscode.CancellationToken | undefined): Promise<vscode.CallHierarchyItem[] | undefined>;
|
|
95
|
+
getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
|
|
96
|
+
getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
|
|
109
97
|
};
|
|
110
98
|
dispose: () => void;
|
|
111
|
-
context:
|
|
99
|
+
context: import("@volar/language-service").ServiceContext<any>;
|
|
112
100
|
};
|
|
113
101
|
getLanguageServiceDontCreate: () => {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
format: (uri: string, options:
|
|
102
|
+
getTriggerCharacters: () => string[];
|
|
103
|
+
getAutoFormatTriggerCharacters: () => string[];
|
|
104
|
+
getSignatureHelpTriggerCharacters: () => string[];
|
|
105
|
+
getSignatureHelpRetriggerCharacters: () => string[];
|
|
106
|
+
format: (uri: string, options: vscode.FormattingOptions, range: vscode.Range | undefined, onTypeParams: {
|
|
119
107
|
ch: string;
|
|
120
|
-
position:
|
|
121
|
-
} | undefined, token?:
|
|
122
|
-
getFoldingRanges: (uri: string, token?:
|
|
123
|
-
getSelectionRanges: (uri: string, positions:
|
|
124
|
-
findLinkedEditingRanges: (uri: string, position:
|
|
125
|
-
findDocumentSymbols: (uri: string, token?:
|
|
126
|
-
findDocumentColors: (uri: string, token?:
|
|
127
|
-
getColorPresentations: (uri: string, color:
|
|
128
|
-
doValidation: (uri: string, mode: "all" | "semantic" | "syntactic", token?:
|
|
129
|
-
findReferences: (uri: string, position:
|
|
130
|
-
findFileReferences: (uri: string, token?:
|
|
131
|
-
findDefinition: (uri: string, position:
|
|
132
|
-
findTypeDefinition: (uri: string, position:
|
|
133
|
-
findImplementations: (uri: string, position:
|
|
134
|
-
prepareRename: (uri: string, position:
|
|
135
|
-
range:
|
|
108
|
+
position: vscode.Position;
|
|
109
|
+
} | undefined, token?: vscode.CancellationToken | undefined) => Promise<vscode.TextEdit[] | undefined>;
|
|
110
|
+
getFoldingRanges: (uri: string, token?: vscode.CancellationToken | undefined) => Promise<vscode.FoldingRange[] | undefined>;
|
|
111
|
+
getSelectionRanges: (uri: string, positions: vscode.Position[], token?: vscode.CancellationToken | undefined) => Promise<vscode.SelectionRange[] | undefined>;
|
|
112
|
+
findLinkedEditingRanges: (uri: string, position: vscode.Position, token?: vscode.CancellationToken | undefined) => Promise<vscode.LinkedEditingRanges | undefined>;
|
|
113
|
+
findDocumentSymbols: (uri: string, token?: vscode.CancellationToken | undefined) => Promise<vscode.DocumentSymbol[] | undefined>;
|
|
114
|
+
findDocumentColors: (uri: string, token?: vscode.CancellationToken | undefined) => Promise<vscode.ColorInformation[] | undefined>;
|
|
115
|
+
getColorPresentations: (uri: string, color: vscode.Color, range: vscode.Range, token?: vscode.CancellationToken | undefined) => Promise<vscode.ColorPresentation[] | undefined>;
|
|
116
|
+
doValidation: (uri: string, mode: "all" | "semantic" | "syntactic", token?: vscode.CancellationToken | undefined, response?: ((result: vscode.Diagnostic[]) => void) | undefined) => Promise<vscode.Diagnostic[]>;
|
|
117
|
+
findReferences: (uri: string, position: vscode.Position, token?: vscode.CancellationToken | undefined) => Promise<vscode.Location[] | undefined>;
|
|
118
|
+
findFileReferences: (uri: string, token?: vscode.CancellationToken | undefined) => import("@volar/language-service").NullableResult<vscode.Location[]>;
|
|
119
|
+
findDefinition: (uri: string, position: vscode.Position, token?: vscode.CancellationToken | undefined) => Promise<vscode.LocationLink[] | undefined>;
|
|
120
|
+
findTypeDefinition: (uri: string, position: vscode.Position, token?: vscode.CancellationToken | undefined) => Promise<vscode.LocationLink[] | undefined>;
|
|
121
|
+
findImplementations: (uri: string, position: vscode.Position, token?: vscode.CancellationToken | undefined) => Promise<vscode.LocationLink[] | undefined>;
|
|
122
|
+
prepareRename: (uri: string, position: vscode.Position, token?: vscode.CancellationToken | undefined) => Promise<NonNullable<vscode.Range | {
|
|
123
|
+
range: vscode.Range;
|
|
136
124
|
placeholder: string;
|
|
137
125
|
} | {
|
|
138
126
|
message: string;
|
|
139
127
|
} | null | undefined> | undefined>;
|
|
140
|
-
doRename: (uri: string, position:
|
|
141
|
-
getEditsForFileRename: (oldUri: string, newUri: string, token?:
|
|
142
|
-
getSemanticTokens: (uri: string, range:
|
|
143
|
-
doHover: (uri: string, position:
|
|
144
|
-
doComplete: (uri: string, position:
|
|
145
|
-
doCodeActions: (uri: string, range:
|
|
146
|
-
doCodeActionResolve: (item:
|
|
147
|
-
doCompletionResolve: (item:
|
|
148
|
-
getSignatureHelp: (uri: string, position:
|
|
149
|
-
doCodeLens: (uri: string, token?:
|
|
150
|
-
doCodeLensResolve: (item:
|
|
151
|
-
findDocumentHighlights: (uri: string, position:
|
|
152
|
-
findDocumentLinks: (uri: string, token?:
|
|
153
|
-
doDocumentLinkResolve: (item:
|
|
154
|
-
findWorkspaceSymbols: (query: string, token?:
|
|
155
|
-
doAutoInsert: (uri: string, position:
|
|
156
|
-
getInlayHints: (uri: string, range:
|
|
157
|
-
doInlayHintResolve: (item:
|
|
128
|
+
doRename: (uri: string, position: vscode.Position, newName: string, token?: vscode.CancellationToken | undefined) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
129
|
+
getEditsForFileRename: (oldUri: string, newUri: string, token?: vscode.CancellationToken | undefined) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
130
|
+
getSemanticTokens: (uri: string, range: vscode.Range | undefined, legend: vscode.SemanticTokensLegend, token?: vscode.CancellationToken | undefined, reportProgress?: ((tokens: vscode.SemanticTokens) => void) | undefined) => Promise<vscode.SemanticTokens | undefined>;
|
|
131
|
+
doHover: (uri: string, position: vscode.Position, token?: vscode.CancellationToken | undefined) => Promise<vscode.Hover | undefined>;
|
|
132
|
+
doComplete: (uri: string, position: vscode.Position, completionContext?: vscode.CompletionContext | undefined, token?: vscode.CancellationToken | undefined) => Promise<vscode.CompletionList>;
|
|
133
|
+
doCodeActions: (uri: string, range: vscode.Range, codeActionContext: vscode.CodeActionContext, token?: vscode.CancellationToken | undefined) => Promise<vscode.CodeAction[] | undefined>;
|
|
134
|
+
doCodeActionResolve: (item: vscode.CodeAction, token?: vscode.CancellationToken | undefined) => Promise<vscode.CodeAction>;
|
|
135
|
+
doCompletionResolve: (item: vscode.CompletionItem, token?: vscode.CancellationToken | undefined) => Promise<vscode.CompletionItem>;
|
|
136
|
+
getSignatureHelp: (uri: string, position: vscode.Position, signatureHelpContext?: vscode.SignatureHelpContext | undefined, token?: vscode.CancellationToken | undefined) => Promise<vscode.SignatureHelp | undefined>;
|
|
137
|
+
doCodeLens: (uri: string, token?: vscode.CancellationToken | undefined) => Promise<vscode.CodeLens[]>;
|
|
138
|
+
doCodeLensResolve: (item: vscode.CodeLens, token?: vscode.CancellationToken | undefined) => Promise<vscode.CodeLens>;
|
|
139
|
+
findDocumentHighlights: (uri: string, position: vscode.Position, token?: vscode.CancellationToken | undefined) => Promise<vscode.DocumentHighlight[] | undefined>;
|
|
140
|
+
findDocumentLinks: (uri: string, token?: vscode.CancellationToken | undefined) => Promise<vscode.DocumentLink[]>;
|
|
141
|
+
doDocumentLinkResolve: (item: vscode.CodeLens, token?: vscode.CancellationToken | undefined) => Promise<vscode.CodeLens>;
|
|
142
|
+
findWorkspaceSymbols: (query: string, token?: vscode.CancellationToken | undefined) => Promise<vscode.WorkspaceSymbol[]>;
|
|
143
|
+
doAutoInsert: (uri: string, position: vscode.Position, autoInsertContext: import("@volar/language-service").AutoInsertionContext, token?: vscode.CancellationToken | undefined) => Promise<NonNullable<string | vscode.TextEdit | null | undefined> | undefined>;
|
|
144
|
+
getInlayHints: (uri: string, range: vscode.Range, token?: vscode.CancellationToken | undefined) => Promise<vscode.InlayHint[] | undefined>;
|
|
145
|
+
doInlayHintResolve: (item: vscode.InlayHint, token?: vscode.CancellationToken | undefined) => Promise<vscode.InlayHint>;
|
|
158
146
|
callHierarchy: {
|
|
159
|
-
doPrepare(uri: string, position:
|
|
160
|
-
getIncomingCalls(item:
|
|
161
|
-
getOutgoingCalls(item:
|
|
147
|
+
doPrepare(uri: string, position: vscode.Position, token?: vscode.CancellationToken | undefined): Promise<vscode.CallHierarchyItem[] | undefined>;
|
|
148
|
+
getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
|
|
149
|
+
getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
|
|
162
150
|
};
|
|
163
151
|
dispose: () => void;
|
|
164
|
-
context:
|
|
152
|
+
context: import("@volar/language-service").ServiceContext<any>;
|
|
165
153
|
} | undefined;
|
|
166
154
|
getParsedCommandLine: () => ts.ParsedCommandLine;
|
|
167
155
|
tryAddFile: (fileName: string) => void;
|
|
156
|
+
askedFiles: {
|
|
157
|
+
clear: () => void;
|
|
158
|
+
values: () => IterableIterator<boolean>;
|
|
159
|
+
uriDelete: (_uri: string) => boolean;
|
|
160
|
+
uriGet: (_uri: string) => boolean | undefined;
|
|
161
|
+
uriHas: (_uri: string) => boolean;
|
|
162
|
+
uriSet: (_uri: string, item: boolean) => void;
|
|
163
|
+
pathDelete: (path: string) => boolean;
|
|
164
|
+
pathGet: (path: string) => boolean | undefined;
|
|
165
|
+
pathHas: (path: string) => boolean | undefined;
|
|
166
|
+
pathSet: (path: string, item: boolean) => void;
|
|
167
|
+
};
|
|
168
168
|
dispose: () => void;
|
|
169
169
|
}>;
|