@volar/language-server 1.0.16 → 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.
Files changed (64) hide show
  1. package/out/{utils/webFileSystemHost.d.ts → browser/fileSystems.d.ts} +0 -0
  2. package/out/{utils/webFileSystemHost.js → browser/fileSystems.js} +4 -4
  3. package/out/{browser.d.ts → browser/index.d.ts} +2 -2
  4. package/out/{browser.js → browser/index.js} +32 -28
  5. package/out/{utils/ts → browser/typescript}/core.d.ts +0 -0
  6. package/out/{utils/ts → browser/typescript}/core.js +0 -0
  7. package/out/{utils/ts → browser/typescript}/corePublic.d.ts +0 -0
  8. package/out/{utils/ts → browser/typescript}/corePublic.js +0 -0
  9. package/out/{utils/ts → browser/typescript}/path.d.ts +0 -0
  10. package/out/{utils/ts → browser/typescript}/path.js +0 -0
  11. package/out/{utils/ts → browser/typescript}/types.d.ts +0 -0
  12. package/out/{utils/ts → browser/typescript}/types.js +0 -0
  13. package/out/{utils/ts → browser/typescript}/utilities.d.ts +0 -0
  14. package/out/{utils/ts → browser/typescript}/utilities.js +0 -0
  15. package/out/{utils → common}/cancellationPipe.d.ts +0 -0
  16. package/out/{utils → common}/cancellationPipe.js +0 -0
  17. package/out/{utils → common}/configurationHost.d.ts +1 -1
  18. package/out/{utils → common}/configurationHost.js +7 -5
  19. package/out/{utils/snapshots.d.ts → common/documents.d.ts} +1 -1
  20. package/out/{utils/snapshots.js → common/documents.js} +5 -5
  21. package/out/{features → common/features}/customFeatures.d.ts +1 -1
  22. package/out/{features → common/features}/customFeatures.js +20 -42
  23. package/out/common/features/documentFeatures.d.ts +4 -0
  24. package/out/{features → common/features}/documentFeatures.js +1 -1
  25. package/out/common/features/languageFeatures.d.ts +4 -0
  26. package/out/{features → common/features}/languageFeatures.js +4 -5
  27. package/out/{utils → common}/project.d.ts +13 -8
  28. package/out/{utils → common}/project.js +19 -16
  29. package/out/{schemaRequestHandlers → common/schemaRequestHandlers}/file.d.ts +0 -0
  30. package/out/{schemaRequestHandlers → common/schemaRequestHandlers}/file.js +0 -0
  31. package/out/{schemaRequestHandlers → common/schemaRequestHandlers}/http.d.ts +0 -0
  32. package/out/{schemaRequestHandlers → common/schemaRequestHandlers}/http.js +0 -0
  33. package/out/common/server.d.ts +8 -0
  34. package/out/{server.js → common/server.js} +94 -33
  35. package/out/{utils/documentServiceHost.d.ts → common/syntaxServicesHost.d.ts} +2 -2
  36. package/out/{utils/documentServiceHost.js → common/syntaxServicesHost.js} +10 -10
  37. package/out/{utils → common/utils}/inferredCompilerOptions.d.ts +0 -0
  38. package/out/{utils → common/utils}/inferredCompilerOptions.js +0 -0
  39. package/out/{registerFeatures.d.ts → common/utils/registerFeatures.d.ts} +2 -3
  40. package/out/{registerFeatures.js → common/utils/registerFeatures.js} +5 -48
  41. package/out/{utils/config.d.ts → common/utils/serverConfig.d.ts} +0 -0
  42. package/out/{utils/config.js → common/utils/serverConfig.js} +1 -1
  43. package/out/{utils → common/utils}/uriMap.d.ts +0 -0
  44. package/out/{utils → common/utils}/uriMap.js +0 -0
  45. package/out/common/workspace.d.ts +1186 -0
  46. package/out/{utils/workspaceProjects.js → common/workspace.js} +29 -13
  47. package/out/common/workspaces.d.ts +1465 -0
  48. package/out/{utils → common}/workspaces.js +15 -10
  49. package/out/{utils/nodeFileSystemHost.d.ts → node/fileSystem.d.ts} +0 -0
  50. package/out/{utils/nodeFileSystemHost.js → node/fileSystem.js} +17 -19
  51. package/out/{node.d.ts → node/index.d.ts} +2 -2
  52. package/out/node/index.js +107 -0
  53. package/out/protocol.d.ts +4 -6
  54. package/out/protocol.js +1 -5
  55. package/out/types.d.ts +5 -3
  56. package/package.json +5 -5
  57. package/out/features/documentFeatures.d.ts +0 -4
  58. package/out/features/languageFeatures.d.ts +0 -4
  59. package/out/node.js +0 -103
  60. package/out/server.d.ts +0 -3
  61. package/out/utils/iterableWeakSet.d.ts +0 -7
  62. package/out/utils/iterableWeakSet.js +0 -40
  63. package/out/utils/workspaceProjects.d.ts +0 -162
  64. 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.createWorkspaceProjects = exports.rootTsConfigNames = void 0;
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 uriMap_1 = require("./uriMap");
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 createWorkspaceProjects(runtimeEnv, plugins, fsHost, rootUri, ts, tsLocalized, documents, configHost, cancelTokenHost, serverOptions) {
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 sys = fsHost.getWorkspaceFileSystem(rootUri);
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 = fsHost.onDidChangeWatchedFiles((params) => __awaiter(this, void 0, void 0, function* () {
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, configHost);
91
- return (0, project_1.createProject)(runtimeEnv, plugins, fsHost, ts, rootUri, inferOptions, tsLocalized, documents, configHost, documentRegistry, cancelTokenHost, serverOptions);
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 (serverOptions.reverseConfigFilePriority) {
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)(runtimeEnv, plugins, fsHost, ts, vscode_uri_1.URI.parse(shared.getUriByPath(path.dirname(tsConfig))), tsConfig, tsLocalized, documents, configHost, documentRegistry, cancelTokenHost, serverOptions);
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.createWorkspaceProjects = createWorkspaceProjects;
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=workspaceProjects.js.map
249
+ //# sourceMappingURL=workspace.js.map