@volar/typescript 2.3.4 → 2.3.5-alpha.0

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.
@@ -1,7 +1,7 @@
1
1
  import type { LanguageServiceEnvironment, Disposable } from '@volar/language-service';
2
2
  import type * as ts from 'typescript';
3
3
  import { URI } from 'vscode-uri';
4
- export declare function createSys(sys: ts.System | undefined, env: LanguageServiceEnvironment, workspaceFolder: URI | undefined, uriConverter: {
4
+ export declare function createSys(sys: ts.System | undefined, env: LanguageServiceEnvironment, getCurrentDirectory: () => string, uriConverter: {
5
5
  asUri(fileName: string): URI;
6
6
  asFileName(uri: URI): string;
7
7
  }): ts.System & {
@@ -5,9 +5,8 @@ const path = require("path-browserify");
5
5
  const utilities_1 = require("../typescript/utilities");
6
6
  const vscode_uri_1 = require("vscode-uri");
7
7
  let currentCwd = '';
8
- function createSys(sys, env, workspaceFolder, uriConverter) {
8
+ function createSys(sys, env, getCurrentDirectory, uriConverter) {
9
9
  let version = 0;
10
- const currentDirectory = workspaceFolder ? uriConverter.asFileName(workspaceFolder) : '';
11
10
  const caseSensitive = sys?.useCaseSensitiveFileNames ?? false;
12
11
  const root = {
13
12
  name: '',
@@ -57,8 +56,8 @@ function createSys(sys, env, workspaceFolder, uriConverter) {
57
56
  writeFile: sys?.writeFile ?? (() => { }),
58
57
  createDirectory: sys?.createDirectory ?? (() => { }),
59
58
  exit: sys?.exit ?? (() => { }),
60
- getExecutingFilePath: sys?.getExecutingFilePath ?? (() => currentDirectory + '/__fake__.js'),
61
- getCurrentDirectory: () => currentDirectory,
59
+ getExecutingFilePath: sys?.getExecutingFilePath ?? (() => getCurrentDirectory + '/__fake__.js'),
60
+ getCurrentDirectory,
62
61
  getModifiedTime,
63
62
  readFile,
64
63
  readDirectory,
@@ -78,6 +77,7 @@ function createSys(sys, env, workspaceFolder, uriConverter) {
78
77
  };
79
78
  function resolvePath(fsPath) {
80
79
  if (sys) {
80
+ const currentDirectory = getCurrentDirectory();
81
81
  if (currentCwd !== currentDirectory) {
82
82
  currentCwd = currentDirectory;
83
83
  // https://github.com/vuejs/language-tools/issues/2039
@@ -191,6 +191,7 @@ function createSys(sys, env, workspaceFolder, uriConverter) {
191
191
  }
192
192
  function readDirectory(dirName, extensions, excludes, includes, depth) {
193
193
  dirName = resolvePath(dirName);
194
+ const currentDirectory = getCurrentDirectory();
194
195
  const matches = (0, utilities_1.matchFiles)(dirName, extensions, excludes, includes, caseSensitive, currentDirectory, depth, dirPath => {
195
196
  dirPath = resolvePath(dirPath);
196
197
  readDirectoryWorker(dirPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volar/typescript",
3
- "version": "2.3.4",
3
+ "version": "2.3.5-alpha.0",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "**/*.js",
@@ -20,6 +20,5 @@
20
20
  "@types/node": "latest",
21
21
  "@types/path-browserify": "latest",
22
22
  "@volar/language-service": "2.3.4"
23
- },
24
- "gitHead": "ba5b381923bbc8a565e84de72fa98474501fe817"
23
+ }
25
24
  }