@volar/language-server 1.4.0-alpha.1 → 1.4.0-alpha.11
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 +1 -5
- package/out/browser/index.js +1 -0
- package/out/browser/typescript/core.js +1 -0
- package/out/browser/typescript/corePublic.js +1 -0
- 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 +1 -0
- package/out/common/configurationHost.js +1 -0
- package/out/common/documents.js +1 -0
- package/out/common/features/customFeatures.js +1 -0
- package/out/common/features/languageFeatures.js +12 -15
- package/out/common/project.d.ts +67 -63
- package/out/common/project.js +7 -17
- package/out/common/schemaRequestHandlers/file.js +1 -0
- package/out/common/schemaRequestHandlers/http.js +1 -0
- package/out/common/server.js +13 -4
- package/out/common/utils/inferredCompilerOptions.js +1 -0
- package/out/common/utils/isFileInDir.js +1 -0
- package/out/common/utils/registerFeatures.js +8 -7
- package/out/common/utils/serverConfig.js +1 -0
- package/out/common/utils/uriMap.js +1 -0
- package/out/common/workspace.d.ts +605 -568
- package/out/common/workspace.js +20 -3
- package/out/common/workspaces.d.ts +737 -693
- package/out/common/workspaces.js +2 -1
- package/out/index.js +1 -0
- package/out/node/fileSystem.js +9 -2
- package/out/node/index.js +10 -2
- 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/workspace.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
3
|
exports.sortTsConfigs = exports.createWorkspace = exports.rootTsConfigNames = void 0;
|
|
3
|
-
const path = require("typesafe-path");
|
|
4
|
+
const path = require("typesafe-path/posix");
|
|
4
5
|
const vscode = require("vscode-languageserver");
|
|
5
6
|
const vscode_uri_1 = require("vscode-uri");
|
|
6
7
|
const project_1 = require("./project");
|
|
@@ -15,7 +16,8 @@ async function createWorkspace(context) {
|
|
|
15
16
|
const sys = context.workspaces.fileSystemHost?.getWorkspaceFileSystem(context.rootUri);
|
|
16
17
|
const documentRegistry = sys ? context.workspaces.ts?.createDocumentRegistry(sys.useCaseSensitiveFileNames, uriToFileName(context.rootUri.toString())) : undefined;
|
|
17
18
|
const projects = (0, uriMap_1.createUriMap)(fileNameToUri);
|
|
18
|
-
const rootTsConfigs = new Set(
|
|
19
|
+
const rootTsConfigs = new Set();
|
|
20
|
+
const searchedDirs = new Set();
|
|
19
21
|
const disposeTsConfigWatch = context.workspaces.fileSystemHost?.onDidChangeWatchedFiles(({ changes }) => {
|
|
20
22
|
for (const change of changes) {
|
|
21
23
|
if (exports.rootTsConfigNames.includes(change.uri.substring(change.uri.lastIndexOf('/') + 1))) {
|
|
@@ -83,6 +85,21 @@ async function createWorkspace(context) {
|
|
|
83
85
|
return inferredProject;
|
|
84
86
|
}
|
|
85
87
|
async function findMatchConfigs(uri) {
|
|
88
|
+
const filePath = uriToFileName(uri.toString());
|
|
89
|
+
let dir = path.dirname(filePath);
|
|
90
|
+
while (true) {
|
|
91
|
+
if (searchedDirs.has(dir)) {
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
searchedDirs.add(dir);
|
|
95
|
+
for (const tsConfigName of exports.rootTsConfigNames) {
|
|
96
|
+
const tsconfigPath = path.join(dir, tsConfigName);
|
|
97
|
+
if (sys?.fileExists(tsconfigPath)) {
|
|
98
|
+
rootTsConfigs.add(tsconfigPath);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
dir = path.dirname(dir);
|
|
102
|
+
}
|
|
86
103
|
await prepareClosestootParsedCommandLine();
|
|
87
104
|
return await findDirectIncludeTsconfig() ?? await findIndirectReferenceTsconfig();
|
|
88
105
|
async function prepareClosestootParsedCommandLine() {
|
|
@@ -142,7 +159,7 @@ async function createWorkspace(context) {
|
|
|
142
159
|
if (parsedCommandLine.projectReferences?.length) {
|
|
143
160
|
const newChains = [];
|
|
144
161
|
for (const projectReference of parsedCommandLine.projectReferences) {
|
|
145
|
-
let tsConfigPath = projectReference.path;
|
|
162
|
+
let tsConfigPath = projectReference.path.replace(/\\/g, '/');
|
|
146
163
|
// fix https://github.com/johnsoncodehk/volar/issues/712
|
|
147
164
|
if (sys && !sys.fileExists(tsConfigPath)) {
|
|
148
165
|
const newTsConfigPath = path.join(tsConfigPath, 'tsconfig.json');
|