@volar/language-server 1.0.0-alpha.3 → 1.0.0-alpha.5

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.
@@ -25,8 +25,9 @@ function createConfigurationHost(params, connection) {
25
25
  }
26
26
  },
27
27
  getConfiguration(section, scopeUri) {
28
+ var _a;
28
29
  return __awaiter(this, void 0, void 0, function* () {
29
- return yield connection.workspace.getConfiguration({ scopeUri, section });
30
+ return (_a = (yield connection.workspace.getConfiguration({ scopeUri, section }))) !== null && _a !== void 0 ? _a : undefined /* replace null to undefined */;
30
31
  });
31
32
  },
32
33
  onDidChangeConfiguration(cb) {
@@ -7,7 +7,7 @@ import { createSnapshots } from './snapshots';
7
7
  import { ConfigurationHost } from '@volar/vue-language-service';
8
8
  export interface Project extends ReturnType<typeof createProject> {
9
9
  }
10
- export declare function createProject(runtimeEnv: RuntimeEnvironment, plugins: ReturnType<LanguageServerPlugin>[], fsHost: FileSystemHost, sys: FileSystem, ts: typeof import('typescript/lib/tsserverlibrary'), options: ServerInitializationOptions, rootUri: URI, rootPath: string, tsConfig: string | ts.CompilerOptions, tsLocalized: ts.MapLike<string> | undefined, documents: ReturnType<typeof createSnapshots>, connection: vscode.Connection, configHost: ConfigurationHost | undefined): Promise<{
10
+ export declare function createProject(runtimeEnv: RuntimeEnvironment, plugins: ReturnType<LanguageServerPlugin>[], fsHost: FileSystemHost, sys: FileSystem, ts: typeof import('typescript/lib/tsserverlibrary'), options: ServerInitializationOptions, rootUri: URI, rootPath: string, tsConfig: string | ts.CompilerOptions, tsLocalized: ts.MapLike<string> | undefined, documents: ReturnType<typeof createSnapshots>, connection: vscode.Connection, configHost: ConfigurationHost | undefined, documentRegistry: ts.DocumentRegistry | undefined): Promise<{
11
11
  getLanguageService: () => {
12
12
  doValidation: (uri: string, response?: ((result: vscode.Diagnostic[]) => void) | undefined, cancellationToken?: vscode.CancellationToken | undefined) => Promise<vscode.Diagnostic[]>;
13
13
  findReferences: (uri: string, position: vscode.Position) => Promise<vscode.Location[] | undefined>;
@@ -18,7 +18,7 @@ const config_1 = require("./config");
18
18
  const requests_1 = require("../requests");
19
19
  const upath = require("upath");
20
20
  const path_1 = require("path");
21
- function createProject(runtimeEnv, plugins, fsHost, sys, ts, options, rootUri, rootPath, tsConfig, tsLocalized, documents, connection, configHost) {
21
+ function createProject(runtimeEnv, plugins, fsHost, sys, ts, options, rootUri, rootPath, tsConfig, tsLocalized, documents, connection, configHost, documentRegistry) {
22
22
  return __awaiter(this, void 0, void 0, function* () {
23
23
  let typeRootVersion = 0;
24
24
  let projectVersion = 0;
@@ -75,6 +75,7 @@ function createProject(runtimeEnv, plugins, fsHost, sys, ts, options, rootUri, r
75
75
  }
76
76
  },
77
77
  },
78
+ documentRegistry,
78
79
  });
79
80
  vueLs = embeddedLS.createLanguageService(languageServiceContext);
80
81
  }
@@ -20,6 +20,7 @@ function createWorkspaceProjects(runtimeEnv, plugins, fsHost, rootUri, ts, tsLoc
20
20
  return __awaiter(this, void 0, void 0, function* () {
21
21
  let inferredProject;
22
22
  const sys = fsHost.getWorkspaceFileSystem(rootUri);
23
+ const documentRegistry = ts.createDocumentRegistry(sys.useCaseSensitiveFileNames, shared.normalizeFileName(rootUri.fsPath));
23
24
  const projects = shared.createUriMap();
24
25
  const rootTsConfigs = new Set(sys.readDirectory(rootUri.fsPath, exports.rootTsConfigNames, undefined, ['**/*']));
25
26
  const disposeWatch = fsHost.onDidChangeWatchedFiles((params, reason) => __awaiter(this, void 0, void 0, function* () {
@@ -87,7 +88,7 @@ function createWorkspaceProjects(runtimeEnv, plugins, fsHost, rootUri, ts, tsLoc
87
88
  if (!inferredProject) {
88
89
  inferredProject = (() => __awaiter(this, void 0, void 0, function* () {
89
90
  const inferOptions = yield (0, inferredCompilerOptions_1.getInferredCompilerOptions)(ts, configHost);
90
- return (0, project_1.createProject)(runtimeEnv, plugins, fsHost, sys, ts, options, rootUri, rootUri.fsPath, inferOptions, tsLocalized, documents, connection, configHost);
91
+ return (0, project_1.createProject)(runtimeEnv, plugins, fsHost, sys, ts, options, rootUri, rootUri.fsPath, inferOptions, tsLocalized, documents, connection, configHost, documentRegistry);
91
92
  }))();
92
93
  }
93
94
  return inferredProject;
@@ -197,7 +198,7 @@ function createWorkspaceProjects(runtimeEnv, plugins, fsHost, rootUri, ts, tsLoc
197
198
  function getProjectByCreate(tsConfig) {
198
199
  let project = projects.pathGet(rootUri, tsConfig);
199
200
  if (!project) {
200
- project = (0, project_1.createProject)(runtimeEnv, plugins, fsHost, sys, ts, options, rootUri, path.dirname(tsConfig), tsConfig, tsLocalized, documents, connection, configHost);
201
+ project = (0, project_1.createProject)(runtimeEnv, plugins, fsHost, sys, ts, options, rootUri, path.dirname(tsConfig), tsConfig, tsLocalized, documents, connection, configHost, documentRegistry);
201
202
  projects.pathSet(rootUri, tsConfig, project);
202
203
  }
203
204
  return project;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volar/language-server",
3
- "version": "1.0.0-alpha.3",
3
+ "version": "1.0.0-alpha.5",
4
4
  "main": "out/index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -17,9 +17,9 @@
17
17
  "directory": "packages/language-server"
18
18
  },
19
19
  "dependencies": {
20
- "@volar/language-core": "1.0.0-alpha.3",
21
- "@volar/language-service": "1.0.0-alpha.3",
22
- "@volar/shared": "1.0.0-alpha.3",
20
+ "@volar/language-core": "1.0.0-alpha.5",
21
+ "@volar/language-service": "1.0.0-alpha.5",
22
+ "@volar/shared": "1.0.0-alpha.5",
23
23
  "request-light": "^0.5.8",
24
24
  "upath": "^2.0.1",
25
25
  "vscode-html-languageservice": "^5.0.1",
@@ -28,5 +28,5 @@
28
28
  "vscode-languageserver-textdocument": "^1.0.7",
29
29
  "vscode-uri": "^3.0.3"
30
30
  },
31
- "gitHead": "55a1d3fa143411dd4520020f407e427df4e4e26a"
31
+ "gitHead": "dd3efd3f7458aca9ba5dcdf549ce80999cb7affd"
32
32
  }