@volar/kit 1.6.8 → 1.6.9-patch.2

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,7 @@ export declare function createInferredProject(rootPath: string, getScriptFileNam
8
8
  fileCreated(fileName: string): void;
9
9
  reload(): void;
10
10
  };
11
- export declare function createProject(sourceTsconfigPath: string, extraFileExtensions?: ts.FileExtensionInfo[]): {
11
+ export declare function createProject(sourceTsconfigPath: string, extraFileExtensions?: ts.FileExtensionInfo[], existingOptions?: ts.CompilerOptions): {
12
12
  languageServiceHost: LanguageServiceHost;
13
13
  isKnownRelatedFile: (fileName: string) => boolean;
14
14
  fileUpdated(fileName: string): void;
@@ -10,11 +10,11 @@ function createInferredProject(rootPath, getScriptFileNames, compilerOptions = u
10
10
  }));
11
11
  }
12
12
  exports.createInferredProject = createInferredProject;
13
- function createProject(sourceTsconfigPath, extraFileExtensions = []) {
13
+ function createProject(sourceTsconfigPath, extraFileExtensions = [], existingOptions) {
14
14
  const ts = require('typescript');
15
15
  const tsconfigPath = (0, utils_1.asPosix)(sourceTsconfigPath);
16
16
  return createProjectBase(path.dirname(tsconfigPath), () => {
17
- const parsed = ts.parseJsonSourceFileConfigFileContent(ts.readJsonConfigFile(tsconfigPath, ts.sys.readFile), ts.sys, path.dirname(tsconfigPath), {}, tsconfigPath, undefined, extraFileExtensions);
17
+ const parsed = ts.parseJsonSourceFileConfigFileContent(ts.readJsonConfigFile(tsconfigPath, ts.sys.readFile), ts.sys, path.dirname(tsconfigPath), existingOptions, tsconfigPath, undefined, extraFileExtensions);
18
18
  parsed.fileNames = parsed.fileNames.map(utils_1.asPosix);
19
19
  return parsed;
20
20
  });
@@ -44,8 +44,13 @@ function createProjectBase(rootPath, createParsedCommandLine) {
44
44
  getScriptSnapshot: (fileName) => {
45
45
  const version = host.getScriptVersion(fileName);
46
46
  if (!scriptSnapshots[fileName] || scriptSnapshots[fileName][0] !== version) {
47
- const fileText = ts.sys.readFile(fileName);
48
- scriptSnapshots[fileName] = [version, fileText ? ts.ScriptSnapshot.fromString(fileText) : undefined];
47
+ const fileText = ts.sys.readFile(fileName, 'utf8');
48
+ if (fileText !== undefined) {
49
+ scriptSnapshots[fileName] = [version, ts.ScriptSnapshot.fromString(fileText)];
50
+ }
51
+ else {
52
+ scriptSnapshots[fileName] = [version, undefined];
53
+ }
49
54
  }
50
55
  return scriptSnapshots[fileName][1];
51
56
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volar/kit",
3
- "version": "1.6.8",
3
+ "version": "1.6.9-patch.2",
4
4
  "main": "out/index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -13,13 +13,12 @@
13
13
  "directory": "packages/kit"
14
14
  },
15
15
  "dependencies": {
16
- "@volar/language-service": "1.6.8",
16
+ "@volar/language-service": "1.6.9",
17
17
  "typesafe-path": "^0.2.2",
18
18
  "vscode-languageserver-textdocument": "^1.0.8",
19
19
  "vscode-uri": "^3.0.7"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "typescript": "*"
23
- },
24
- "gitHead": "3d269c7e69850ac5497469bede13f057db8a4980"
23
+ }
25
24
  }