@volar/language-server 1.4.0-alpha.0 → 1.4.0-alpha.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/browser/fileSystems.js +83 -107
- package/out/browser/index.js +11 -23
- package/out/browser/typescript/core.js +2 -1
- package/out/browser/typescript/corePublic.js +3 -2
- package/out/browser/typescript/path.js +1 -0
- package/out/browser/typescript/types.js +1 -0
- package/out/browser/typescript/utilities.js +1 -0
- package/out/common/cancellationPipe.js +2 -1
- package/out/common/configurationHost.js +13 -28
- package/out/common/documents.js +3 -3
- package/out/common/features/customFeatures.js +35 -47
- package/out/common/features/languageFeatures.js +135 -163
- package/out/common/project.d.ts +66 -62
- package/out/common/project.js +205 -228
- package/out/common/schemaRequestHandlers/file.js +1 -0
- package/out/common/schemaRequestHandlers/http.js +1 -0
- package/out/common/server.js +63 -68
- package/out/common/utils/inferredCompilerOptions.js +58 -61
- package/out/common/utils/isFileInDir.js +1 -0
- package/out/common/utils/registerFeatures.js +11 -12
- package/out/common/utils/serverConfig.js +3 -2
- package/out/common/utils/uriMap.js +2 -1
- package/out/common/workspace.d.ts +605 -568
- package/out/common/workspace.js +182 -194
- package/out/common/workspaces.d.ts +726 -682
- package/out/common/workspaces.js +82 -107
- package/out/index.js +1 -0
- package/out/node/fileSystem.js +13 -16
- package/out/node/index.js +16 -19
- package/out/protocol.d.ts +0 -6
- package/out/protocol.js +2 -5
- package/out/types.d.ts +4 -6
- package/out/types.js +1 -0
- package/package.json +4 -4
package/out/common/workspaces.js
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
1
|
+
"use strict";
|
|
10
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
3
|
exports.sleep = exports.createWorkspaces = void 0;
|
|
12
4
|
const vscode = require("vscode-languageserver");
|
|
@@ -14,7 +6,6 @@ const types_1 = require("../types");
|
|
|
14
6
|
const workspace_1 = require("./workspace");
|
|
15
7
|
const isFileInDir_1 = require("./utils/isFileInDir");
|
|
16
8
|
function createWorkspaces(context) {
|
|
17
|
-
var _a, _b, _c;
|
|
18
9
|
const uriToFileName = context.server.runtimeEnv.uriToFileName;
|
|
19
10
|
const workspaces = new Map();
|
|
20
11
|
let semanticTokensReq = 0;
|
|
@@ -25,7 +16,7 @@ function createWorkspaces(context) {
|
|
|
25
16
|
context.documents.onDidClose(({ textDocument }) => {
|
|
26
17
|
context.server.connection.sendDiagnostics({ uri: textDocument.uri, diagnostics: [] });
|
|
27
18
|
});
|
|
28
|
-
|
|
19
|
+
context.fileSystemHost?.onDidChangeWatchedFiles(({ changes }) => {
|
|
29
20
|
const tsConfigChanges = changes.filter(change => workspace_1.rootTsConfigNames.includes(change.uri.substring(change.uri.lastIndexOf('/') + 1)));
|
|
30
21
|
if (tsConfigChanges.length) {
|
|
31
22
|
reloadDiagnostics();
|
|
@@ -34,9 +25,9 @@ function createWorkspaces(context) {
|
|
|
34
25
|
updateDiagnosticsAndSemanticTokens();
|
|
35
26
|
}
|
|
36
27
|
});
|
|
37
|
-
|
|
28
|
+
context.server.runtimeEnv.onDidChangeConfiguration?.(async () => {
|
|
38
29
|
updateDiagnosticsAndSemanticTokens();
|
|
39
|
-
})
|
|
30
|
+
});
|
|
40
31
|
return {
|
|
41
32
|
workspaces,
|
|
42
33
|
getProject: getProjectAndTsConfig,
|
|
@@ -52,21 +43,17 @@ function createWorkspaces(context) {
|
|
|
52
43
|
remove: (rootUri) => {
|
|
53
44
|
const _workspace = workspaces.get(rootUri.toString());
|
|
54
45
|
workspaces.delete(rootUri.toString());
|
|
55
|
-
(() =>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}))();
|
|
46
|
+
(async () => {
|
|
47
|
+
(await _workspace)?.dispose();
|
|
48
|
+
})();
|
|
59
49
|
},
|
|
60
50
|
};
|
|
61
|
-
function reloadProject() {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
reloadDiagnostics();
|
|
69
|
-
});
|
|
51
|
+
async function reloadProject() {
|
|
52
|
+
context.fileSystemHost?.reload();
|
|
53
|
+
for (const [_, workspace] of workspaces) {
|
|
54
|
+
(await workspace).reload();
|
|
55
|
+
}
|
|
56
|
+
reloadDiagnostics();
|
|
70
57
|
}
|
|
71
58
|
function reloadDiagnostics() {
|
|
72
59
|
for (const doc of context.documents.data.values()) {
|
|
@@ -74,97 +61,85 @@ function createWorkspaces(context) {
|
|
|
74
61
|
}
|
|
75
62
|
updateDiagnosticsAndSemanticTokens();
|
|
76
63
|
}
|
|
77
|
-
function updateDiagnosticsAndSemanticTokens() {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if ((_c = context.initParams.capabilities.textDocument) === null || _c === void 0 ? void 0 : _c.semanticTokens) {
|
|
86
|
-
context.server.connection.languages.semanticTokens.refresh();
|
|
87
|
-
}
|
|
88
|
-
if ((_d = context.initParams.capabilities.textDocument) === null || _d === void 0 ? void 0 : _d.inlayHint) {
|
|
89
|
-
context.server.connection.languages.inlayHint.refresh();
|
|
90
|
-
}
|
|
64
|
+
async function updateDiagnosticsAndSemanticTokens() {
|
|
65
|
+
const req = ++semanticTokensReq;
|
|
66
|
+
await updateDiagnostics();
|
|
67
|
+
const delay = await context.configurationHost?.getConfiguration('volar.diagnostics.delay') ?? 200;
|
|
68
|
+
await sleep(delay);
|
|
69
|
+
if (req === semanticTokensReq) {
|
|
70
|
+
if (context.initParams.capabilities.textDocument?.semanticTokens) {
|
|
71
|
+
context.server.connection.languages.semanticTokens.refresh();
|
|
91
72
|
}
|
|
92
|
-
|
|
73
|
+
if (context.initParams.capabilities.textDocument?.inlayHint) {
|
|
74
|
+
context.server.connection.languages.inlayHint.refresh();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
93
77
|
}
|
|
94
|
-
function updateDiagnostics(docUri) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
78
|
+
async function updateDiagnostics(docUri) {
|
|
79
|
+
if ((context.initOptions.diagnosticModel ?? types_1.DiagnosticModel.Push) !== types_1.DiagnosticModel.Push)
|
|
80
|
+
return;
|
|
81
|
+
const req = ++documentUpdatedReq;
|
|
82
|
+
const delay = await context.configurationHost?.getConfiguration('volar.diagnostics.delay') ?? 200;
|
|
83
|
+
const cancel = context.cancelTokenHost.createCancellationToken({
|
|
84
|
+
get isCancellationRequested() {
|
|
85
|
+
return req !== documentUpdatedReq;
|
|
86
|
+
},
|
|
87
|
+
onCancellationRequested: vscode.Event.None,
|
|
88
|
+
});
|
|
89
|
+
const changeDoc = docUri ? context.documents.data.uriGet(docUri) : undefined;
|
|
90
|
+
const otherDocs = [...context.documents.data.values()].filter(doc => doc !== changeDoc);
|
|
91
|
+
if (changeDoc) {
|
|
92
|
+
await sleep(delay);
|
|
93
|
+
if (cancel.isCancellationRequested) {
|
|
98
94
|
return;
|
|
99
|
-
const req = ++documentUpdatedReq;
|
|
100
|
-
const delay = (_c = yield ((_b = context.configurationHost) === null || _b === void 0 ? void 0 : _b.getConfiguration('volar.diagnostics.delay'))) !== null && _c !== void 0 ? _c : 200;
|
|
101
|
-
const cancel = context.cancelTokenHost.createCancellationToken({
|
|
102
|
-
get isCancellationRequested() {
|
|
103
|
-
return req !== documentUpdatedReq;
|
|
104
|
-
},
|
|
105
|
-
onCancellationRequested: vscode.Event.None,
|
|
106
|
-
});
|
|
107
|
-
const changeDoc = docUri ? context.documents.data.uriGet(docUri) : undefined;
|
|
108
|
-
const otherDocs = [...context.documents.data.values()].filter(doc => doc !== changeDoc);
|
|
109
|
-
if (changeDoc) {
|
|
110
|
-
yield sleep(delay);
|
|
111
|
-
if (cancel.isCancellationRequested) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
yield sendDocumentDiagnostics(changeDoc.uri, changeDoc.version, cancel);
|
|
115
95
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
96
|
+
await sendDocumentDiagnostics(changeDoc.uri, changeDoc.version, cancel);
|
|
97
|
+
}
|
|
98
|
+
for (const doc of otherDocs) {
|
|
99
|
+
await sleep(delay);
|
|
100
|
+
if (cancel.isCancellationRequested) {
|
|
101
|
+
break;
|
|
122
102
|
}
|
|
123
|
-
|
|
103
|
+
await sendDocumentDiagnostics(doc.uri, doc.version, cancel);
|
|
104
|
+
}
|
|
124
105
|
}
|
|
125
|
-
function sendDocumentDiagnostics(uri, version, cancel) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const errors = yield languageService.doValidation(uri, cancel, mode, result => {
|
|
136
|
-
context.server.connection.sendDiagnostics({ uri: uri, diagnostics: result, version });
|
|
137
|
-
});
|
|
138
|
-
context.server.connection.sendDiagnostics({ uri: uri, diagnostics: errors, version });
|
|
106
|
+
async function sendDocumentDiagnostics(uri, version, cancel) {
|
|
107
|
+
const project = (await getProjectAndTsConfig(uri))?.project;
|
|
108
|
+
if (!project)
|
|
109
|
+
return;
|
|
110
|
+
const languageService = project.getLanguageService();
|
|
111
|
+
const mode = context.initOptions.serverMode === types_1.ServerMode.PartialSemantic ? 'semantic'
|
|
112
|
+
: context.initOptions.serverMode === types_1.ServerMode.Syntactic ? 'syntactic'
|
|
113
|
+
: 'all';
|
|
114
|
+
const errors = await languageService.doValidation(uri, mode, cancel, result => {
|
|
115
|
+
context.server.connection.sendDiagnostics({ uri: uri, diagnostics: result, version });
|
|
139
116
|
});
|
|
117
|
+
context.server.connection.sendDiagnostics({ uri: uri, diagnostics: errors, version });
|
|
140
118
|
}
|
|
141
|
-
function getProjectAndTsConfig(uri) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
if (projectAndTsConfig) {
|
|
152
|
-
return projectAndTsConfig;
|
|
153
|
-
}
|
|
119
|
+
async function getProjectAndTsConfig(uri) {
|
|
120
|
+
let rootUris = [...workspaces.keys()]
|
|
121
|
+
.filter(rootUri => (0, isFileInDir_1.isFileInDir)(uriToFileName(uri), uriToFileName(rootUri)))
|
|
122
|
+
.sort((a, b) => (0, workspace_1.sortTsConfigs)(uriToFileName(uri), uriToFileName(a), uriToFileName(b)));
|
|
123
|
+
if (context.initOptions.serverMode !== types_1.ServerMode.Syntactic) {
|
|
124
|
+
for (const rootUri of rootUris) {
|
|
125
|
+
const workspace = await workspaces.get(rootUri);
|
|
126
|
+
const projectAndTsConfig = await workspace?.getProjectAndTsConfig(uri);
|
|
127
|
+
if (projectAndTsConfig) {
|
|
128
|
+
return projectAndTsConfig;
|
|
154
129
|
}
|
|
155
130
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
}
|
|
131
|
+
}
|
|
132
|
+
if (!rootUris.length) {
|
|
133
|
+
rootUris = [...workspaces.keys()];
|
|
134
|
+
}
|
|
135
|
+
if (rootUris.length) {
|
|
136
|
+
const project = await (await workspaces.get(rootUris[0]))?.getInferredProject();
|
|
137
|
+
project?.tryAddFile(uriToFileName(uri));
|
|
138
|
+
return {
|
|
139
|
+
tsconfig: undefined,
|
|
140
|
+
project,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
168
143
|
}
|
|
169
144
|
}
|
|
170
145
|
exports.createWorkspaces = createWorkspaces;
|
package/out/index.js
CHANGED
package/out/node/fileSystem.js
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
1
|
+
"use strict";
|
|
10
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
3
|
exports.createNodeFileSystemHost = void 0;
|
|
12
4
|
const vscode = require("vscode-languageserver");
|
|
@@ -17,7 +9,7 @@ function createNodeFileSystemHost(ts, capabilities, env, _initOptions) {
|
|
|
17
9
|
const onDidChangeWatchedFilesCb = new Set();
|
|
18
10
|
return {
|
|
19
11
|
ready(connection) {
|
|
20
|
-
connection.onDidChangeWatchedFiles((params) =>
|
|
12
|
+
connection.onDidChangeWatchedFiles(async (params) => {
|
|
21
13
|
if (params.changes.some(change => change.type === vscode.FileChangeType.Created || change.type === vscode.FileChangeType.Deleted)) {
|
|
22
14
|
for (const sys of instances.values()) {
|
|
23
15
|
sys[1].forEach(cache => cache.clear());
|
|
@@ -25,10 +17,10 @@ function createNodeFileSystemHost(ts, capabilities, env, _initOptions) {
|
|
|
25
17
|
}
|
|
26
18
|
for (const cb of [...onDidChangeWatchedFilesCb]) {
|
|
27
19
|
if (onDidChangeWatchedFilesCb.has(cb)) {
|
|
28
|
-
|
|
20
|
+
await cb(params);
|
|
29
21
|
}
|
|
30
22
|
}
|
|
31
|
-
})
|
|
23
|
+
});
|
|
32
24
|
},
|
|
33
25
|
reload() {
|
|
34
26
|
for (const sys of instances.values()) {
|
|
@@ -49,7 +41,6 @@ function createNodeFileSystemHost(ts, capabilities, env, _initOptions) {
|
|
|
49
41
|
},
|
|
50
42
|
};
|
|
51
43
|
function createWorkspaceFileSystem(ts, capabilities, rootUri) {
|
|
52
|
-
var _a;
|
|
53
44
|
const rootPath = env.uriToFileName(rootUri.toString());
|
|
54
45
|
const workspaceSys = new Proxy(ts.sys, {
|
|
55
46
|
get(target, prop) {
|
|
@@ -58,8 +49,14 @@ function createNodeFileSystemHost(ts, capabilities, env, _initOptions) {
|
|
|
58
49
|
return new Proxy(fn, {
|
|
59
50
|
apply(target, thisArg, args) {
|
|
60
51
|
if (currentCwd !== rootPath) {
|
|
61
|
-
|
|
62
|
-
|
|
52
|
+
// https://github.com/vuejs/language-tools/issues/2039
|
|
53
|
+
// https://github.com/vuejs/language-tools/issues/2234
|
|
54
|
+
if (ts.sys.directoryExists(rootPath)) {
|
|
55
|
+
// https://github.com/vuejs/language-tools/issues/2480
|
|
56
|
+
try {
|
|
57
|
+
process.chdir(rootPath);
|
|
58
|
+
}
|
|
59
|
+
catch { }
|
|
63
60
|
}
|
|
64
61
|
currentCwd = rootPath;
|
|
65
62
|
}
|
|
@@ -73,7 +70,7 @@ function createNodeFileSystemHost(ts, capabilities, env, _initOptions) {
|
|
|
73
70
|
const fileExistsCache = new Map();
|
|
74
71
|
const directoryExistsCache = new Map();
|
|
75
72
|
// don't cache fs result if client did not supports file watcher
|
|
76
|
-
const sys =
|
|
73
|
+
const sys = capabilities.workspace?.didChangeWatchedFiles
|
|
77
74
|
? new Proxy({
|
|
78
75
|
fileExists(path) {
|
|
79
76
|
if (!fileExistsCache.has(path)) {
|
package/out/node/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2
3
|
if (k2 === undefined) k2 = k;
|
|
3
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -12,15 +13,6 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
12
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
13
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
14
15
|
};
|
|
15
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
17
|
exports.startLanguageServer = exports.createConnection = void 0;
|
|
26
18
|
const fs = require("fs");
|
|
@@ -56,20 +48,25 @@ function startLanguageServer(connection, ...plugins) {
|
|
|
56
48
|
loadTypescript(tsdk) {
|
|
57
49
|
for (const name of ['./typescript.js', './tsserverlibrary.js']) {
|
|
58
50
|
try {
|
|
59
|
-
|
|
60
|
-
return require(path);
|
|
51
|
+
return require(require.resolve(name, { paths: [tsdk] }));
|
|
61
52
|
}
|
|
62
|
-
catch
|
|
53
|
+
catch { }
|
|
63
54
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
// for bun
|
|
56
|
+
for (const name of ['typescript.js', 'tsserverlibrary.js']) {
|
|
67
57
|
try {
|
|
68
|
-
|
|
69
|
-
return require(path);
|
|
58
|
+
return require(tsdk + '/' + name);
|
|
70
59
|
}
|
|
71
|
-
catch
|
|
72
|
-
}
|
|
60
|
+
catch { }
|
|
61
|
+
}
|
|
62
|
+
throw new Error(`Can't find typescript.js or tsserverlibrary.js in ${tsdk}`);
|
|
63
|
+
},
|
|
64
|
+
async loadTypescriptLocalized(tsdk, locale) {
|
|
65
|
+
try {
|
|
66
|
+
const path = require.resolve(`./${locale}/diagnosticMessages.generated.json`, { paths: [tsdk] });
|
|
67
|
+
return require(path);
|
|
68
|
+
}
|
|
69
|
+
catch { }
|
|
73
70
|
},
|
|
74
71
|
schemaRequestHandlers: {
|
|
75
72
|
file: file_1.default,
|
package/out/protocol.d.ts
CHANGED
|
@@ -4,12 +4,6 @@ import type { FileKind, FileRangeCapabilities } from '@volar/language-core';
|
|
|
4
4
|
/**
|
|
5
5
|
* Server request client
|
|
6
6
|
*/
|
|
7
|
-
export declare namespace ShowReferencesNotification {
|
|
8
|
-
type ResponseType = vscode.TextDocumentPositionParams & {
|
|
9
|
-
references: vscode.Location[];
|
|
10
|
-
};
|
|
11
|
-
const type: vscode.NotificationType<ResponseType>;
|
|
12
|
-
}
|
|
13
7
|
export declare namespace FsReadFileRequest {
|
|
14
8
|
const type: vscode.RequestType<string, Uint8Array | null | undefined, unknown>;
|
|
15
9
|
}
|
package/out/protocol.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.ReportStats = exports.GetVirtualFileRequest = exports.GetVirtualFileNamesRequest = exports.ReloadProjectNotification = exports.WriteVirtualFilesNotification = exports.AutoInsertRequest = exports.GetMatchTsConfigRequest = exports.FindFileReferenceRequest = exports.FsReadDirectoryRequest = exports.FsReadFileRequest =
|
|
3
|
+
exports.ReportStats = exports.GetVirtualFileRequest = exports.GetVirtualFileNamesRequest = exports.ReloadProjectNotification = exports.WriteVirtualFilesNotification = exports.AutoInsertRequest = exports.GetMatchTsConfigRequest = exports.FindFileReferenceRequest = exports.FsReadDirectoryRequest = exports.FsReadFileRequest = void 0;
|
|
3
4
|
const vscode = require("vscode-languageserver-protocol");
|
|
4
5
|
/**
|
|
5
6
|
* Server request client
|
|
6
7
|
*/
|
|
7
|
-
var ShowReferencesNotification;
|
|
8
|
-
(function (ShowReferencesNotification) {
|
|
9
|
-
ShowReferencesNotification.type = new vscode.NotificationType('volar/server/showReferences');
|
|
10
|
-
})(ShowReferencesNotification = exports.ShowReferencesNotification || (exports.ShowReferencesNotification = {}));
|
|
11
8
|
var FsReadFileRequest;
|
|
12
9
|
(function (FsReadFileRequest) {
|
|
13
10
|
FsReadFileRequest.type = new vscode.RequestType('volar/server/fs/readFile');
|
package/out/types.d.ts
CHANGED
|
@@ -36,12 +36,12 @@ export interface LanguageServiceContext {
|
|
|
36
36
|
sys: FileSystem;
|
|
37
37
|
}
|
|
38
38
|
export interface LanguageServerPlugin {
|
|
39
|
-
(initOptions: LanguageServerInitializationOptions
|
|
39
|
+
(initOptions: LanguageServerInitializationOptions, modules: {
|
|
40
|
+
typescript?: typeof import('typescript/lib/tsserverlibrary');
|
|
41
|
+
}): {
|
|
40
42
|
extraFileExtensions?: ts.FileExtensionInfo[];
|
|
41
43
|
watchFileExtensions?: string[];
|
|
42
|
-
resolveConfig?(config: Config,
|
|
43
|
-
typescript?: typeof import('typescript/lib/tsserverlibrary');
|
|
44
|
-
}, ctx?: LanguageServiceContext): Config;
|
|
44
|
+
resolveConfig?(config: Config, ctx: LanguageServiceContext | undefined): Config;
|
|
45
45
|
onInitialized?(getLanguageService: (uri: string) => Promise<LanguageService | undefined>, env: RuntimeEnvironment): void;
|
|
46
46
|
};
|
|
47
47
|
}
|
|
@@ -80,7 +80,6 @@ export interface LanguageServerInitializationOptions {
|
|
|
80
80
|
};
|
|
81
81
|
serverMode?: ServerMode;
|
|
82
82
|
diagnosticModel?: DiagnosticModel;
|
|
83
|
-
textDocumentSync?: vscode.TextDocumentSyncKind | number;
|
|
84
83
|
/**
|
|
85
84
|
* For better JSON parsing performance language server will filter CompletionList.
|
|
86
85
|
*
|
|
@@ -92,7 +91,6 @@ export interface LanguageServerInitializationOptions {
|
|
|
92
91
|
* https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29#cancellation
|
|
93
92
|
*/
|
|
94
93
|
cancellationPipeName?: string;
|
|
95
|
-
noProjectReferences?: boolean;
|
|
96
94
|
reverseConfigFilePriority?: boolean;
|
|
97
95
|
disableFileWatcher?: boolean;
|
|
98
96
|
maxFileSize?: number;
|
package/out/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/language-server",
|
|
3
|
-
"version": "1.4.0-alpha.
|
|
3
|
+
"version": "1.4.0-alpha.10",
|
|
4
4
|
"main": "out/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"directory": "packages/language-server"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@volar/language-core": "1.4.0-alpha.
|
|
21
|
-
"@volar/language-service": "1.4.0-alpha.
|
|
20
|
+
"@volar/language-core": "1.4.0-alpha.10",
|
|
21
|
+
"@volar/language-service": "1.4.0-alpha.10",
|
|
22
22
|
"@vscode/l10n": "^0.0.11",
|
|
23
23
|
"request-light": "^0.7.0",
|
|
24
24
|
"typesafe-path": "^0.2.2",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"vscode-languageserver-textdocument": "^1.0.8",
|
|
29
29
|
"vscode-uri": "^3.0.7"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "715bc5f17a0d1cadd4190712dcaff732989eb330"
|
|
32
32
|
}
|