@volar/language-server 1.0.14 → 1.0.17
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/{utils/webFileSystemHost.d.ts → browser/fileSystems.d.ts} +0 -0
- package/out/{utils/webFileSystemHost.js → browser/fileSystems.js} +4 -4
- package/out/{browser.d.ts → browser/index.d.ts} +2 -2
- package/out/{browser.js → browser/index.js} +32 -28
- package/out/{utils/ts → browser/typescript}/core.d.ts +0 -0
- package/out/{utils/ts → browser/typescript}/core.js +0 -0
- package/out/{utils/ts → browser/typescript}/corePublic.d.ts +0 -0
- package/out/{utils/ts → browser/typescript}/corePublic.js +0 -0
- package/out/{utils/ts → browser/typescript}/path.d.ts +0 -0
- package/out/{utils/ts → browser/typescript}/path.js +0 -0
- package/out/{utils/ts → browser/typescript}/types.d.ts +0 -0
- package/out/{utils/ts → browser/typescript}/types.js +0 -0
- package/out/{utils/ts → browser/typescript}/utilities.d.ts +0 -0
- package/out/{utils/ts → browser/typescript}/utilities.js +0 -0
- package/out/{utils → common}/cancellationPipe.d.ts +0 -0
- package/out/{utils → common}/cancellationPipe.js +0 -0
- package/out/{utils → common}/configurationHost.d.ts +1 -1
- package/out/{utils → common}/configurationHost.js +7 -5
- package/out/{utils/snapshots.d.ts → common/documents.d.ts} +1 -1
- package/out/{utils/snapshots.js → common/documents.js} +5 -5
- package/out/{features → common/features}/customFeatures.d.ts +1 -1
- package/out/{features → common/features}/customFeatures.js +20 -42
- package/out/common/features/documentFeatures.d.ts +4 -0
- package/out/{features → common/features}/documentFeatures.js +1 -1
- package/out/common/features/languageFeatures.d.ts +4 -0
- package/out/{features → common/features}/languageFeatures.js +4 -5
- package/out/{utils → common}/project.d.ts +13 -8
- package/out/{utils → common}/project.js +19 -16
- package/out/{schemaRequestHandlers → common/schemaRequestHandlers}/file.d.ts +0 -0
- package/out/{schemaRequestHandlers → common/schemaRequestHandlers}/file.js +0 -0
- package/out/{schemaRequestHandlers → common/schemaRequestHandlers}/http.d.ts +0 -0
- package/out/{schemaRequestHandlers → common/schemaRequestHandlers}/http.js +0 -0
- package/out/common/server.d.ts +8 -0
- package/out/{server.js → common/server.js} +94 -33
- package/out/{utils/documentServiceHost.d.ts → common/syntaxServicesHost.d.ts} +2 -2
- package/out/{utils/documentServiceHost.js → common/syntaxServicesHost.js} +10 -10
- package/out/{utils → common/utils}/inferredCompilerOptions.d.ts +0 -0
- package/out/{utils → common/utils}/inferredCompilerOptions.js +0 -0
- package/out/{registerFeatures.d.ts → common/utils/registerFeatures.d.ts} +2 -3
- package/out/{registerFeatures.js → common/utils/registerFeatures.js} +6 -53
- package/out/{utils/config.d.ts → common/utils/serverConfig.d.ts} +0 -0
- package/out/{utils/config.js → common/utils/serverConfig.js} +1 -1
- package/out/{utils → common/utils}/uriMap.d.ts +0 -0
- package/out/{utils → common/utils}/uriMap.js +0 -0
- package/out/common/workspace.d.ts +1186 -0
- package/out/{utils/workspaceProjects.js → common/workspace.js} +29 -13
- package/out/common/workspaces.d.ts +1465 -0
- package/out/{utils → common}/workspaces.js +15 -10
- package/out/{utils/nodeFileSystemHost.d.ts → node/fileSystem.d.ts} +0 -0
- package/out/{utils/nodeFileSystemHost.js → node/fileSystem.js} +17 -19
- package/out/{node.d.ts → node/index.d.ts} +2 -2
- package/out/node/index.js +107 -0
- package/out/protocol.d.ts +4 -6
- package/out/protocol.js +1 -5
- package/out/types.d.ts +5 -3
- package/package.json +7 -7
- package/out/features/documentFeatures.d.ts +0 -4
- package/out/features/languageFeatures.d.ts +0 -4
- package/out/node.js +0 -103
- package/out/server.d.ts +0 -3
- package/out/utils/iterableWeakSet.d.ts +0 -7
- package/out/utils/iterableWeakSet.js +0 -40
- package/out/utils/workspaceProjects.d.ts +0 -162
- package/out/utils/workspaces.d.ts +0 -429
|
@@ -8,23 +8,27 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.sortTsConfigs = exports.
|
|
11
|
+
exports.sortTsConfigs = exports.createWorkspace = exports.rootTsConfigNames = void 0;
|
|
12
12
|
const shared = require("@volar/shared");
|
|
13
13
|
const path = require("typesafe-path");
|
|
14
14
|
const vscode = require("vscode-languageserver");
|
|
15
|
-
const project_1 = require("./project");
|
|
16
|
-
const inferredCompilerOptions_1 = require("./inferredCompilerOptions");
|
|
17
15
|
const vscode_uri_1 = require("vscode-uri");
|
|
18
|
-
const
|
|
16
|
+
const project_1 = require("./project");
|
|
17
|
+
const inferredCompilerOptions_1 = require("./utils/inferredCompilerOptions");
|
|
18
|
+
const serverConfig_1 = require("./utils/serverConfig");
|
|
19
|
+
const uriMap_1 = require("./utils/uriMap");
|
|
19
20
|
exports.rootTsConfigNames = ['tsconfig.json', 'jsconfig.json'];
|
|
20
|
-
function
|
|
21
|
+
function createWorkspace(params) {
|
|
21
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const { rootUri } = params;
|
|
24
|
+
const { ts, fileSystemHost, initOptions, configurationHost } = params.workspaces;
|
|
22
25
|
let inferredProject;
|
|
23
|
-
const
|
|
26
|
+
const workspacePlugins = (0, serverConfig_1.loadCustomPlugins)(shared.getPathOfUri(rootUri.toString()), initOptions.configFilePath);
|
|
27
|
+
const sys = fileSystemHost.getWorkspaceFileSystem(rootUri);
|
|
24
28
|
const documentRegistry = ts.createDocumentRegistry(sys.useCaseSensitiveFileNames, shared.getPathOfUri(rootUri.toString()));
|
|
25
29
|
const projects = (0, uriMap_1.createUriMap)();
|
|
26
30
|
const rootTsConfigs = new Set(sys.readDirectory(shared.getPathOfUri(rootUri.toString()), exports.rootTsConfigNames, undefined, ['**/*']).map(fileName => shared.normalizeFileName(fileName)));
|
|
27
|
-
const disposeWatch =
|
|
31
|
+
const disposeWatch = fileSystemHost.onDidChangeWatchedFiles((params) => __awaiter(this, void 0, void 0, function* () {
|
|
28
32
|
const disposes = [];
|
|
29
33
|
for (const change of params.changes) {
|
|
30
34
|
if (exports.rootTsConfigNames.includes(change.uri.substring(change.uri.lastIndexOf('/') + 1))) {
|
|
@@ -87,8 +91,14 @@ function createWorkspaceProjects(runtimeEnv, plugins, fsHost, rootUri, ts, tsLoc
|
|
|
87
91
|
function getInferredProject() {
|
|
88
92
|
if (!inferredProject) {
|
|
89
93
|
inferredProject = (() => __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
const inferOptions = yield (0, inferredCompilerOptions_1.getInferredCompilerOptions)(ts,
|
|
91
|
-
return (0, project_1.createProject)(
|
|
94
|
+
const inferOptions = yield (0, inferredCompilerOptions_1.getInferredCompilerOptions)(ts, configurationHost);
|
|
95
|
+
return (0, project_1.createProject)({
|
|
96
|
+
workspace: params,
|
|
97
|
+
workspacePlugins,
|
|
98
|
+
rootUri,
|
|
99
|
+
tsConfig: inferOptions,
|
|
100
|
+
documentRegistry,
|
|
101
|
+
});
|
|
92
102
|
}))();
|
|
93
103
|
}
|
|
94
104
|
return inferredProject;
|
|
@@ -138,7 +148,7 @@ function createWorkspaceProjects(runtimeEnv, plugins, fsHost, rootUri, ts, tsLoc
|
|
|
138
148
|
const project = yield projects.pathGet(rootTsConfig);
|
|
139
149
|
if (project) {
|
|
140
150
|
let chains = yield getReferencesChains(project.getParsedCommandLine(), rootTsConfig, []);
|
|
141
|
-
if (
|
|
151
|
+
if (initOptions.reverseConfigFilePriority) {
|
|
142
152
|
chains = chains.reverse();
|
|
143
153
|
}
|
|
144
154
|
for (const chain of chains) {
|
|
@@ -204,14 +214,20 @@ function createWorkspaceProjects(runtimeEnv, plugins, fsHost, rootUri, ts, tsLoc
|
|
|
204
214
|
const tsConfig = shared.normalizeFileName(_tsConfig);
|
|
205
215
|
let project = projects.pathGet(tsConfig);
|
|
206
216
|
if (!project) {
|
|
207
|
-
project = (0, project_1.createProject)(
|
|
217
|
+
project = (0, project_1.createProject)({
|
|
218
|
+
workspace: params,
|
|
219
|
+
workspacePlugins,
|
|
220
|
+
rootUri: vscode_uri_1.URI.parse(shared.getUriByPath(path.dirname(tsConfig))),
|
|
221
|
+
tsConfig,
|
|
222
|
+
documentRegistry,
|
|
223
|
+
});
|
|
208
224
|
projects.pathSet(tsConfig, project);
|
|
209
225
|
}
|
|
210
226
|
return project;
|
|
211
227
|
}
|
|
212
228
|
});
|
|
213
229
|
}
|
|
214
|
-
exports.
|
|
230
|
+
exports.createWorkspace = createWorkspace;
|
|
215
231
|
function sortTsConfigs(file, a, b) {
|
|
216
232
|
const inA = shared.isFileInDir(file, path.dirname(a));
|
|
217
233
|
const inB = shared.isFileInDir(file, path.dirname(b));
|
|
@@ -230,4 +246,4 @@ function sortTsConfigs(file, a, b) {
|
|
|
230
246
|
return bLength - aLength;
|
|
231
247
|
}
|
|
232
248
|
exports.sortTsConfigs = sortTsConfigs;
|
|
233
|
-
//# sourceMappingURL=
|
|
249
|
+
//# sourceMappingURL=workspace.js.map
|