@volar/language-server 1.4.0-alpha.5 → 1.4.0-alpha.7

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.
@@ -8,7 +8,6 @@ const vscode_uri_1 = require("vscode-uri");
8
8
  const protocol_1 = require("../protocol");
9
9
  const utilities_1 = require("./typescript/utilities");
10
10
  const uriMap_1 = require("../common/utils/uriMap");
11
- let currentCwd = '/';
12
11
  function createWebFileSystemHost(_0, _1, env, initOptions) {
13
12
  const instances = (0, uriMap_1.createUriMap)(env.fileNameToUri);
14
13
  const onDidChangeWatchedFilesCb = new Set();
@@ -83,10 +82,6 @@ function createWebFileSystemHost(_0, _1, env, initOptions) {
83
82
  realpath: path => path, // TODO: cannot implement with vscode
84
83
  };
85
84
  function resolvePath(fsPath) {
86
- if (currentCwd !== rootPath) {
87
- process.chdir(rootPath);
88
- currentCwd = rootPath;
89
- }
90
85
  return path.resolve(fsPath);
91
86
  }
92
87
  function fileExists(fsPath) {
@@ -173,14 +173,6 @@ async function createProject(context) {
173
173
  return context.workspace.workspaces.documents.data.pathGet(fileName)?.languageId;
174
174
  },
175
175
  };
176
- if (context.workspace.workspaces.initOptions.noProjectReferences) {
177
- host.getProjectReferences = undefined;
178
- host.getCompilationSettings = () => ({
179
- ...parsedCommandLine.options,
180
- rootDir: undefined,
181
- composite: false,
182
- });
183
- }
184
176
  if (context.workspace.workspaces.tsLocalized) {
185
177
  host.getLocalizedDiagnosticMessages = () => context.workspace.workspaces.tsLocalized;
186
178
  }
@@ -49,8 +49,14 @@ function createNodeFileSystemHost(ts, capabilities, env, _initOptions) {
49
49
  return new Proxy(fn, {
50
50
  apply(target, thisArg, args) {
51
51
  if (currentCwd !== rootPath) {
52
- if (ts.sys.directoryExists(rootPath)) { // #2234, #2039
53
- process.chdir(rootPath);
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 { }
54
60
  }
55
61
  currentCwd = rootPath;
56
62
  }
package/out/types.d.ts CHANGED
@@ -91,7 +91,6 @@ export interface LanguageServerInitializationOptions {
91
91
  * https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29#cancellation
92
92
  */
93
93
  cancellationPipeName?: string;
94
- noProjectReferences?: boolean;
95
94
  reverseConfigFilePriority?: boolean;
96
95
  disableFileWatcher?: boolean;
97
96
  maxFileSize?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volar/language-server",
3
- "version": "1.4.0-alpha.5",
3
+ "version": "1.4.0-alpha.7",
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.5",
21
- "@volar/language-service": "1.4.0-alpha.5",
20
+ "@volar/language-core": "1.4.0-alpha.7",
21
+ "@volar/language-service": "1.4.0-alpha.7",
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": "85378fe538a34f18fa3f45784d5d5a72cbf2a54c"
31
+ "gitHead": "3d4412419e4ca483eb856e9bd6b74e5e387d0d55"
32
32
  }