volar-service-typescript 0.0.39 → 0.0.40

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.
@@ -4,12 +4,12 @@ exports.create = exports.getLanguageServiceByDocument = void 0;
4
4
  const getFormatCodeSettings_1 = require("../configs/getFormatCodeSettings");
5
5
  const shared_1 = require("../shared");
6
6
  const lspConverters_1 = require("../utils/lspConverters");
7
- const syntacticLanguageService_1 = require("../syntacticLanguageService");
7
+ const syntaxOnlyService_1 = require("../syntaxOnlyService");
8
8
  const snapshots = new WeakMap();
9
9
  let created;
10
10
  function getLanguageServiceByDocument(ts, document) {
11
11
  if (!created) {
12
- created = (0, syntacticLanguageService_1.createLanguageService)(ts, true);
12
+ created = (0, syntaxOnlyService_1.createSyntaxOnlyService)(ts, true);
13
13
  }
14
14
  let cache = snapshots.get(document);
15
15
  if (!cache || cache[0] !== document.version) {
@@ -1,6 +1,6 @@
1
1
  import type * as ts from 'typescript';
2
- export declare function createLanguageService(ts: typeof import('typescript'), syntaxOnly: boolean): {
2
+ export declare function createSyntaxOnlyService(ts: typeof import('typescript'), syntaxOnly: boolean): {
3
3
  languageService: ts.LanguageService;
4
4
  updateFile: (fileName: string, snapshot: ts.IScriptSnapshot, scriptKind: ts.ScriptKind) => void;
5
5
  };
6
- //# sourceMappingURL=syntacticLanguageService.d.ts.map
6
+ //# sourceMappingURL=syntaxOnlyService.d.ts.map
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createLanguageService = void 0;
4
- function createLanguageService(ts, syntaxOnly) {
3
+ exports.createSyntaxOnlyService = void 0;
4
+ function createSyntaxOnlyService(ts, syntaxOnly) {
5
5
  let currentProjectVersion = -1;
6
6
  let fileNames = [];
7
7
  const scriptInfos = new Map();
@@ -9,7 +9,8 @@ function createLanguageService(ts, syntaxOnly) {
9
9
  getProjectVersion: () => currentProjectVersion.toString(),
10
10
  getScriptFileNames: () => fileNames,
11
11
  getScriptVersion: () => currentProjectVersion.toString(),
12
- getScriptSnapshot: fileName => scriptInfos.get(fileName)?.snapshot,
12
+ getScriptSnapshot: fileName => scriptInfos.get(fileName).snapshot,
13
+ getScriptKind: fileName => scriptInfos.get(fileName).kind,
13
14
  getCompilationSettings: () => ({}),
14
15
  getCurrentDirectory: () => '',
15
16
  getDefaultLibFileName: () => '',
@@ -40,5 +41,5 @@ function createLanguageService(ts, syntaxOnly) {
40
41
  }
41
42
  }
42
43
  }
43
- exports.createLanguageService = createLanguageService;
44
- //# sourceMappingURL=syntacticLanguageService.js.map
44
+ exports.createSyntaxOnlyService = createSyntaxOnlyService;
45
+ //# sourceMappingURL=syntaxOnlyService.js.map
@@ -1,5 +1,5 @@
1
1
  import type * as ts from 'typescript';
2
2
  export declare namespace SymbolKind {
3
- function fromProtocolScriptElementKind(kind: ts.ScriptElementKind): 2 | 5 | 10 | 22 | 11 | 6 | 7 | 13 | 12 | 9 | 26 | 15;
3
+ function fromProtocolScriptElementKind(kind: ts.ScriptElementKind): 2 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 15 | 22 | 26;
4
4
  }
5
5
  //# sourceMappingURL=typeConverters.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volar-service-typescript",
3
- "version": "0.0.39",
3
+ "version": "0.0.40",
4
4
  "description": "Integrate TypeScript into Volar",
5
5
  "homepage": "https://github.com/volarjs/services/tree/master/packages/typescript",
6
6
  "bugs": "https://github.com/volarjs/services/issues",
@@ -42,5 +42,5 @@
42
42
  "optional": true
43
43
  }
44
44
  },
45
- "gitHead": "69bf117b9fddb1d485396d484948485183c6d40a"
45
+ "gitHead": "75c5472887e274929fa4c0c2a54f9e97e4fe30a0"
46
46
  }