volar-service-typescript 0.0.5 → 0.0.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.
package/out/index.d.ts CHANGED
@@ -5,6 +5,7 @@ import { IDtsHost } from '@volar/typescript';
5
5
  export * from '@volar/typescript';
6
6
  export interface Provide {
7
7
  'typescript/typescript': () => typeof import('typescript/lib/tsserverlibrary');
8
+ 'typescript/sys': () => ts.System;
8
9
  'typescript/sourceFile': (document: TextDocument) => ts.SourceFile | undefined;
9
10
  'typescript/textDocument': (uri: string) => TextDocument | undefined;
10
11
  'typescript/languageService': (document?: TextDocument) => ts.LanguageService;
package/out/index.js CHANGED
@@ -59,7 +59,6 @@ const typescript_1 = require("@volar/typescript");
59
59
  const tsFaster = __importStar(require("typescript-auto-import-cache"));
60
60
  __exportStar(require("@volar/typescript"), exports);
61
61
  ;
62
- let documentRegistry;
63
62
  exports.default = (options) => (contextOrNull, modules) => {
64
63
  const jsDocTriggerCharacter = '*';
65
64
  const directiveCommentTriggerCharacter = '@';
@@ -85,7 +84,7 @@ exports.default = (options) => (contextOrNull, modules) => {
85
84
  const ts = modules.typescript;
86
85
  const sys = (0, typescript_1.createSys)(context, ts, context.env, options?.dtsHost);
87
86
  const languageServiceHost = (0, typescript_1.createLanguageServiceHost)(context, ts, sys);
88
- const created = tsFaster.createLanguageService(ts, sys, languageServiceHost, proxiedHost => ts.createLanguageService(proxiedHost, documentRegistry ??= ts.createDocumentRegistry()));
87
+ const created = tsFaster.createLanguageService(ts, sys, languageServiceHost, proxiedHost => ts.createLanguageService(proxiedHost, (0, typescript_1.getDocumentRegistry)(ts, sys.useCaseSensitiveFileNames, context.host.getCurrentDirectory())));
89
88
  const { languageService } = created;
90
89
  if (created.setPreferences && context.env.getConfiguration) {
91
90
  updatePreferences();
@@ -194,6 +193,7 @@ exports.default = (options) => (contextOrNull, modules) => {
194
193
  },
195
194
  provide: {
196
195
  'typescript/typescript': () => ts,
196
+ 'typescript/sys': () => sys,
197
197
  'typescript/sourceFile': document => {
198
198
  if ((0, shared_1.isTsDocument)(document)) {
199
199
  const sourceFile = getSemanticServiceSourceFile(document.uri);
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.EventName = exports.DisplayPartKind = exports.KindModifiers = exports.DiagnosticCategory = exports.Kind = void 0;
8
8
  class Kind {
9
9
  }
10
- exports.Kind = Kind;
11
10
  Kind.alias = 'alias';
12
11
  Kind.callSignature = 'call';
13
12
  Kind.class = 'class';
@@ -38,15 +37,15 @@ Kind.warning = 'warning';
38
37
  Kind.string = 'string';
39
38
  Kind.parameter = 'parameter';
40
39
  Kind.typeParameter = 'type parameter';
40
+ exports.Kind = Kind;
41
41
  class DiagnosticCategory {
42
42
  }
43
- exports.DiagnosticCategory = DiagnosticCategory;
44
43
  DiagnosticCategory.error = 'error';
45
44
  DiagnosticCategory.warning = 'warning';
46
45
  DiagnosticCategory.suggestion = 'suggestion';
46
+ exports.DiagnosticCategory = DiagnosticCategory;
47
47
  class KindModifiers {
48
48
  }
49
- exports.KindModifiers = KindModifiers;
50
49
  KindModifiers.optional = 'optional';
51
50
  KindModifiers.deprecated = 'deprecated';
52
51
  KindModifiers.color = 'color';
@@ -64,15 +63,16 @@ KindModifiers.fileExtensionKindModifiers = [
64
63
  KindModifiers.jsxFile,
65
64
  KindModifiers.jsonFile,
66
65
  ];
66
+ exports.KindModifiers = KindModifiers;
67
67
  class DisplayPartKind {
68
68
  }
69
- exports.DisplayPartKind = DisplayPartKind;
70
69
  DisplayPartKind.functionName = 'functionName';
71
70
  DisplayPartKind.methodName = 'methodName';
72
71
  DisplayPartKind.parameterName = 'parameterName';
73
72
  DisplayPartKind.propertyName = 'propertyName';
74
73
  DisplayPartKind.punctuation = 'punctuation';
75
74
  DisplayPartKind.text = 'text';
75
+ exports.DisplayPartKind = DisplayPartKind;
76
76
  var EventName;
77
77
  (function (EventName) {
78
78
  EventName["syntaxDiag"] = "syntaxDiag";
@@ -88,5 +88,5 @@ var EventName;
88
88
  EventName["surveyReady"] = "surveyReady";
89
89
  EventName["projectLoadingStart"] = "projectLoadingStart";
90
90
  EventName["projectLoadingFinish"] = "projectLoadingFinish";
91
- })(EventName || (exports.EventName = EventName = {}));
91
+ })(EventName = exports.EventName || (exports.EventName = {}));
92
92
  //# sourceMappingURL=protocol.const.js.map
@@ -1,4 +1,4 @@
1
1
  import type * as ts from 'typescript/lib/tsserverlibrary';
2
2
  export declare namespace SymbolKind {
3
- function fromProtocolScriptElementKind(kind: ts.ScriptElementKind): 2 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 15 | 22 | 26;
3
+ function fromProtocolScriptElementKind(kind: ts.ScriptElementKind): 2 | 5 | 10 | 22 | 11 | 6 | 7 | 13 | 12 | 9 | 26 | 15;
4
4
  }
@@ -59,5 +59,5 @@ var SymbolKind;
59
59
  }
60
60
  }
61
61
  SymbolKind.fromProtocolScriptElementKind = fromProtocolScriptElementKind;
62
- })(SymbolKind || (exports.SymbolKind = SymbolKind = {}));
62
+ })(SymbolKind = exports.SymbolKind || (exports.SymbolKind = {}));
63
63
  //# sourceMappingURL=typeConverters.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volar-service-typescript",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "main": "out/index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@types/semver": "^7.3.13",
17
- "@volar/typescript": "1.7.0"
17
+ "@volar/typescript": "1.7.3"
18
18
  },
19
19
  "dependencies": {
20
20
  "semver": "^7.3.8",
@@ -24,7 +24,13 @@
24
24
  "vscode-uri": "^3.0.7"
25
25
  },
26
26
  "peerDependencies": {
27
+ "@volar/language-service": "*",
27
28
  "@volar/typescript": "*"
28
29
  },
29
- "gitHead": "7b58234769e16ccb8eed0e6eb03f58ed24b7df40"
30
+ "peerDependenciesMeta": {
31
+ "@volar/language-service": {
32
+ "optional": true
33
+ }
34
+ },
35
+ "gitHead": "e34fbc0b88190d347cc7b75a590f1a5e53aa52b0"
30
36
  }