@volar/language-server 1.6.8 → 1.6.9-patch.1

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.
@@ -71,6 +71,7 @@ function createWebFileSystemHost(_0, _1, env, initOptions) {
71
71
  function createWorkspaceFileSystem(rootUri) {
72
72
  const rootPath = env.uriToFileName(rootUri.toString());
73
73
  return {
74
+ args: [],
74
75
  newLine: '\n',
75
76
  useCaseSensitiveFileNames: false,
76
77
  getCurrentDirectory: () => env.uriToFileName(rootUri.toString()),
@@ -79,7 +80,14 @@ function createWebFileSystemHost(_0, _1, env, initOptions) {
79
80
  readDirectory,
80
81
  getDirectories,
81
82
  resolvePath,
82
- realpath: path => path, // TODO: cannot implement with vscode
83
+ // ignore
84
+ write: () => { },
85
+ writeFile: () => { },
86
+ createDirectory: () => { },
87
+ realpath: path => path,
88
+ directoryExists: () => true,
89
+ exit: () => { },
90
+ getExecutingFilePath: () => rootPath + '/__fake__.js',
83
91
  };
84
92
  function resolvePath(fsPath) {
85
93
  return path.resolve(fsPath);
@@ -2,57 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.register = void 0;
4
4
  const protocol_1 = require("../../protocol");
5
+ const language_core_1 = require("@volar/language-core");
5
6
  function register(connection, workspaces, env) {
6
- connection.onNotification(protocol_1.ReportStats.type, async () => {
7
- for (const [rootUri, _workspace] of workspaces.workspaces) {
8
- connection.console.log('workspace: ' + rootUri);
9
- const workspace = await _workspace;
10
- connection.console.log('documentRegistry stats: ' + workspace.documentRegistry?.reportStats());
11
- connection.console.log('');
12
- connection.console.log('tsconfig: inferred');
13
- const _inferredProject = workspace.getInferredProjectDontCreate();
14
- if (_inferredProject) {
15
- connection.console.log('loaded: true');
16
- const inferredProject = await _inferredProject;
17
- connection.console.log('largest 10 files:');
18
- for (const script of [...inferredProject.scripts.values()]
19
- .sort((a, b) => (b.snapshot?.getLength() ?? 0) - (a.snapshot?.getLength() ?? 0))
20
- .slice(0, 10)) {
21
- connection.console.log(' - ' + script.fileName);
22
- connection.console.log(` size: ${script.snapshot?.getLength()}`);
23
- }
24
- connection.console.log('files:');
25
- for (const script of inferredProject.scripts.values()) {
26
- connection.console.log(' - ' + script.fileName);
27
- connection.console.log(` size: ${script.snapshot?.getLength()}`);
28
- connection.console.log(` ref counts: "${workspace.documentRegistry.getLanguageServiceRefCounts?.(script.fileName, inferredProject.languageServiceHost.getScriptKind?.(script.fileName))})"`);
29
- }
30
- }
31
- else {
32
- connection.console.log('loaded: false');
33
- }
34
- connection.console.log('');
35
- for (const _project of workspace.projects.values()) {
36
- const project = await _project;
37
- connection.console.log('tsconfig: ' + project.tsConfig);
38
- connection.console.log('loaded: ' + !!project.getLanguageServiceDontCreate());
39
- connection.console.log('largest 10 files:');
40
- for (const script of [...project.scripts.values()]
41
- .sort((a, b) => (b.snapshot?.getLength() ?? 0) - (a.snapshot?.getLength() ?? 0))
42
- .slice(0, 10)) {
43
- connection.console.log(' - ' + script.fileName);
44
- connection.console.log(` size: ${script.snapshot?.getLength()}`);
45
- }
46
- connection.console.log('files:');
47
- for (const script of project.scripts.values()) {
48
- connection.console.log(' - ' + script.fileName);
49
- connection.console.log(` size: ${script.snapshot?.getLength()}`);
50
- connection.console.log(` ref counts: "${workspace.documentRegistry.getLanguageServiceRefCounts?.(script.fileName, project.languageServiceHost.getScriptKind?.(script.fileName))})"`);
51
- }
52
- }
53
- connection.console.log('');
54
- }
55
- });
7
+ const scriptVersions = new Map();
8
+ const scriptVersionSnapshots = new WeakSet();
56
9
  connection.onRequest(protocol_1.GetMatchTsConfigRequest.type, async (params) => {
57
10
  const project = (await workspaces.getProject(params.uri));
58
11
  if (project?.tsconfig) {
@@ -105,15 +58,21 @@ function register(connection, workspaces, env) {
105
58
  connection.onRequest(protocol_1.GetVirtualFilesRequest.type, async (document) => {
106
59
  const project = await workspaces.getProject(document.uri);
107
60
  if (project) {
108
- const file = project.project?.getLanguageService().context.core.virtualFiles.getSource(env.uriToFileName(document.uri))?.root;
61
+ const file = project.project?.getLanguageService().context.virtualFiles.getSource(env.uriToFileName(document.uri))?.root;
109
62
  return file ? prune(file) : undefined;
110
63
  function prune(file) {
64
+ let version = scriptVersions.get(file.fileName) ?? 0;
65
+ if (!scriptVersionSnapshots.has(file.snapshot)) {
66
+ version++;
67
+ scriptVersions.set(file.fileName, version);
68
+ scriptVersionSnapshots.add(file.snapshot);
69
+ }
111
70
  return {
112
71
  fileName: file.fileName,
113
72
  kind: file.kind,
114
73
  capabilities: file.capabilities,
115
74
  embeddedFiles: file.embeddedFiles.map(prune),
116
- version: project.project.getLanguageService().context.core.typescript.languageServiceHost.getScriptVersion(file.fileName),
75
+ version,
117
76
  };
118
77
  }
119
78
  }
@@ -121,7 +80,7 @@ function register(connection, workspaces, env) {
121
80
  connection.onRequest(protocol_1.GetVirtualFileRequest.type, async (params) => {
122
81
  const project = await workspaces.getProject(params.sourceFileUri);
123
82
  if (project) {
124
- const [virtualFile, source] = project.project?.getLanguageService().context.core.virtualFiles.getVirtualFile(params.virtualFileName) ?? [];
83
+ const [virtualFile, source] = project.project?.getLanguageService().context.virtualFiles.getVirtualFile(params.virtualFileName) ?? [];
125
84
  if (virtualFile && source) {
126
85
  const mappings = {};
127
86
  for (const mapping of virtualFile.mappings) {
@@ -146,12 +105,22 @@ function register(connection, workspaces, env) {
146
105
  if (project) {
147
106
  const ls = (await project.project)?.getLanguageServiceDontCreate();
148
107
  if (ls) {
149
- const sourceFiles = new Set(ls.context.host.getScriptFileNames());
150
- for (const virtualFile of ls.context.core.typescript.languageServiceHost.getScriptFileNames()) {
151
- if (virtualFile.startsWith(ls.context.host.getCurrentDirectory()) && !sourceFiles.has(virtualFile)) {
152
- const snapshot = ls.context.core.typescript.languageServiceHost.getScriptSnapshot(virtualFile);
108
+ for (const { root } of ls.context.virtualFiles.allSources()) {
109
+ (0, language_core_1.forEachEmbeddedFile)(root, virtualFile => {
110
+ if (virtualFile.kind === language_core_1.FileKind.TypeScriptHostFile) {
111
+ if (virtualFile.fileName.startsWith(ls.context.host.getCurrentDirectory())) {
112
+ const snapshot = virtualFile.snapshot;
113
+ fs.writeFile(virtualFile.fileName, snapshot.getText(0, snapshot.getLength()), () => { });
114
+ }
115
+ }
116
+ });
117
+ }
118
+ // global virtual files
119
+ for (const fileName of ls.context.host.getScriptFileNames()) {
120
+ if (!fs.existsSync(fileName)) {
121
+ const snapshot = ls.context.host.getScriptSnapshot(fileName);
153
122
  if (snapshot) {
154
- fs.writeFile(virtualFile, snapshot.getText(0, snapshot.getLength()), () => { });
123
+ fs.writeFile(fileName, snapshot.getText(0, snapshot.getLength()), () => { });
155
124
  }
156
125
  }
157
126
  }
@@ -8,12 +8,12 @@ export interface ProjectContext extends WorkspaceContext {
8
8
  project: {
9
9
  rootUri: URI;
10
10
  tsConfig: path.PosixPath | ts.CompilerOptions;
11
- documentRegistry: ts.DocumentRegistry | undefined;
12
11
  };
13
12
  }
14
13
  export type Project = ReturnType<typeof createProject>;
15
14
  export declare function createProject(context: ProjectContext): Promise<{
16
- tsConfig: ts.CompilerOptions | path.PosixPath;
15
+ readFiles: Set<string>;
16
+ tsConfig: path.PosixPath | ts.CompilerOptions;
17
17
  scripts: {
18
18
  clear: () => void;
19
19
  values: () => IterableIterator<{
@@ -107,8 +107,8 @@ export declare function createProject(context: ProjectContext): Promise<{
107
107
  getIncomingCalls(item: embeddedLS.CallHierarchyItem, token: embeddedLS.CancellationToken): Promise<embeddedLS.CallHierarchyIncomingCall[]>;
108
108
  getOutgoingCalls(item: embeddedLS.CallHierarchyItem, token: embeddedLS.CancellationToken): Promise<embeddedLS.CallHierarchyOutgoingCall[]>;
109
109
  };
110
- dispose: () => void | undefined;
111
- context: embeddedLS.ServiceContext;
110
+ dispose: () => void;
111
+ context: embeddedLS.ServiceContext<any>;
112
112
  };
113
113
  getLanguageServiceDontCreate: () => {
114
114
  triggerCharacters: string[];
@@ -160,8 +160,8 @@ export declare function createProject(context: ProjectContext): Promise<{
160
160
  getIncomingCalls(item: embeddedLS.CallHierarchyItem, token: embeddedLS.CancellationToken): Promise<embeddedLS.CallHierarchyIncomingCall[]>;
161
161
  getOutgoingCalls(item: embeddedLS.CallHierarchyItem, token: embeddedLS.CancellationToken): Promise<embeddedLS.CallHierarchyOutgoingCall[]>;
162
162
  };
163
- dispose: () => void | undefined;
164
- context: embeddedLS.ServiceContext;
163
+ dispose: () => void;
164
+ context: embeddedLS.ServiceContext<any>;
165
165
  } | undefined;
166
166
  getParsedCommandLine: () => ts.ParsedCommandLine;
167
167
  tryAddFile: (fileName: string) => void;
@@ -13,22 +13,37 @@ async function createProject(context) {
13
13
  const fileNameToUri = context.server.runtimeEnv.fileNameToUri;
14
14
  const sys = context.workspaces.initOptions.serverMode === types_1.ServerMode.Syntactic || !context.workspaces.fileSystemHost
15
15
  ? {
16
+ args: [],
16
17
  newLine: '\n',
17
18
  useCaseSensitiveFileNames: false,
18
19
  fileExists: () => false,
19
20
  readFile: () => undefined,
20
21
  readDirectory: () => [],
21
22
  getCurrentDirectory: () => '',
22
- realpath: () => '',
23
23
  resolvePath: () => '',
24
+ write: () => { },
25
+ writeFile: () => { },
26
+ createDirectory: () => { },
27
+ realpath: path => path,
28
+ directoryExists: () => true,
29
+ exit: () => { },
30
+ getDirectories: () => [],
31
+ getExecutingFilePath: () => '/__fake__.js',
24
32
  }
25
33
  : context.workspaces.fileSystemHost.getWorkspaceFileSystem(context.project.rootUri);
26
34
  let typeRootVersion = 0;
27
35
  let projectVersion = 0;
28
36
  let projectVersionUpdateTime = context.workspaces.cancelTokenHost.getMtime();
29
37
  let languageService;
30
- let parsedCommandLine = createParsedCommandLine(context.workspaces.ts, sys, uriToFileName(context.project.rootUri.toString()), context.project.tsConfig, context.workspaces.plugins);
38
+ let existingOptions;
39
+ for (const plugin of context.workspaces.plugins) {
40
+ if (plugin.resolveExistingOptions) {
41
+ existingOptions = plugin.resolveExistingOptions(existingOptions);
42
+ }
43
+ }
44
+ let parsedCommandLine = createParsedCommandLine(context.workspaces.ts, sys, uriToFileName(context.project.rootUri.toString()), context.project.tsConfig, context.workspaces.plugins, existingOptions);
31
45
  const scripts = (0, uriMap_1.createUriMap)(fileNameToUri);
46
+ const readFiles = new Set();
32
47
  const languageServiceHost = createLanguageServiceHost();
33
48
  const disposeWatchEvent = context.workspaces.fileSystemHost?.onDidChangeWatchedFiles(params => {
34
49
  onWorkspaceFilesChanged(params.changes);
@@ -38,6 +53,7 @@ async function createProject(context) {
38
53
  projectVersionUpdateTime = context.workspaces.cancelTokenHost.getMtime();
39
54
  });
40
55
  return {
56
+ readFiles,
41
57
  tsConfig: context.project.tsConfig,
42
58
  scripts,
43
59
  languageServiceHost,
@@ -74,6 +90,7 @@ async function createProject(context) {
74
90
  }
75
91
  return '';
76
92
  },
93
+ sys,
77
94
  };
78
95
  let config = (context.workspace.rootUri.scheme === 'file' ? (0, serverConfig_1.loadConfig)(context.server.runtimeEnv.uriToFileName(context.workspace.rootUri.toString()), context.workspaces.initOptions.configFilePath) : {}) ?? {};
79
96
  for (const plugin of context.workspaces.plugins) {
@@ -86,7 +103,7 @@ async function createProject(context) {
86
103
  });
87
104
  }
88
105
  }
89
- languageService = embeddedLS.createLanguageService({ typescript: context.workspaces.ts }, env, config, languageServiceHost, context.project.documentRegistry);
106
+ languageService = embeddedLS.createLanguageService({ typescript: context.workspaces.ts }, env, config, languageServiceHost);
90
107
  }
91
108
  return languageService;
92
109
  }
@@ -114,7 +131,7 @@ async function createProject(context) {
114
131
  const creates = changes.filter(change => change.type === vscode.FileChangeType.Created);
115
132
  const deletes = changes.filter(change => change.type === vscode.FileChangeType.Deleted);
116
133
  if (creates.length || deletes.length) {
117
- parsedCommandLine = createParsedCommandLine(context.workspaces.ts, sys, uriToFileName(context.project.rootUri.toString()), context.project.tsConfig, context.workspaces.plugins);
134
+ parsedCommandLine = createParsedCommandLine(context.workspaces.ts, sys, uriToFileName(context.project.rootUri.toString()), context.project.tsConfig, context.workspaces.plugins, existingOptions);
118
135
  projectVersion++;
119
136
  typeRootVersion++;
120
137
  }
@@ -133,7 +150,10 @@ async function createProject(context) {
133
150
  // ts
134
151
  getNewLine: () => sys.newLine,
135
152
  useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames,
136
- readFile: sys.readFile,
153
+ readFile: fileName => {
154
+ readFiles.add(fileName);
155
+ return sys.readFile(fileName);
156
+ },
137
157
  writeFile: sys.writeFile,
138
158
  directoryExists: sys.directoryExists,
139
159
  getDirectories: sys.getDirectories,
@@ -223,17 +243,20 @@ async function createProject(context) {
223
243
  }
224
244
  }
225
245
  exports.createProject = createProject;
226
- function createParsedCommandLine(ts, sys, rootPath, tsConfig, plugins) {
246
+ function createParsedCommandLine(ts, sys, rootPath, tsConfig, plugins, existingOptions) {
227
247
  const extraFileExtensions = plugins.map(plugin => plugin.extraFileExtensions ?? []).flat();
228
248
  if (ts) {
229
249
  try {
230
250
  let content;
231
251
  if (typeof tsConfig === 'string') {
232
252
  const config = ts.readJsonConfigFile(tsConfig, sys.readFile);
233
- content = ts.parseJsonSourceFileConfigFileContent(config, sys, path.dirname(tsConfig), {}, tsConfig, undefined, extraFileExtensions);
253
+ content = ts.parseJsonSourceFileConfigFileContent(config, sys, path.dirname(tsConfig), existingOptions, tsConfig, undefined, extraFileExtensions);
234
254
  }
235
255
  else {
236
- content = ts.parseJsonConfigFileContent({ files: [] }, sys, rootPath, tsConfig, path.join(rootPath, 'jsconfig.json'), undefined, extraFileExtensions);
256
+ content = ts.parseJsonConfigFileContent({ files: [] }, sys, rootPath, {
257
+ ...tsConfig,
258
+ ...existingOptions,
259
+ }, path.join(rootPath, 'jsconfig.json'), undefined, extraFileExtensions);
237
260
  }
238
261
  // fix https://github.com/johnsoncodehk/volar/issues/1786
239
262
  // https://github.com/microsoft/TypeScript/issues/30457
@@ -14,7 +14,8 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
14
14
  projects: {
15
15
  clear: () => void;
16
16
  values: () => IterableIterator<Promise<{
17
- tsConfig: ts.CompilerOptions | import("typesafe-path").PosixPath;
17
+ readFiles: Set<string>;
18
+ tsConfig: import("typesafe-path").PosixPath | ts.CompilerOptions;
18
19
  scripts: {
19
20
  clear: () => void;
20
21
  values: () => IterableIterator<{
@@ -108,8 +109,8 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
108
109
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
109
110
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
110
111
  };
111
- dispose: () => void | undefined;
112
- context: import("@volar/language-service").ServiceContext;
112
+ dispose: () => void;
113
+ context: import("@volar/language-service").ServiceContext<any>;
113
114
  };
114
115
  getLanguageServiceDontCreate: () => {
115
116
  triggerCharacters: string[];
@@ -161,8 +162,8 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
161
162
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
162
163
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
163
164
  };
164
- dispose: () => void | undefined;
165
- context: import("@volar/language-service").ServiceContext;
165
+ dispose: () => void;
166
+ context: import("@volar/language-service").ServiceContext<any>;
166
167
  } | undefined;
167
168
  getParsedCommandLine: () => ts.ParsedCommandLine;
168
169
  tryAddFile: (fileName: string) => void;
@@ -170,7 +171,8 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
170
171
  }>>;
171
172
  uriDelete: (_uri: string) => boolean;
172
173
  uriGet: (_uri: string) => Promise<{
173
- tsConfig: ts.CompilerOptions | import("typesafe-path").PosixPath;
174
+ readFiles: Set<string>;
175
+ tsConfig: import("typesafe-path").PosixPath | ts.CompilerOptions;
174
176
  scripts: {
175
177
  clear: () => void;
176
178
  values: () => IterableIterator<{
@@ -264,8 +266,8 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
264
266
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
265
267
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
266
268
  };
267
- dispose: () => void | undefined;
268
- context: import("@volar/language-service").ServiceContext;
269
+ dispose: () => void;
270
+ context: import("@volar/language-service").ServiceContext<any>;
269
271
  };
270
272
  getLanguageServiceDontCreate: () => {
271
273
  triggerCharacters: string[];
@@ -317,8 +319,8 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
317
319
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
318
320
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
319
321
  };
320
- dispose: () => void | undefined;
321
- context: import("@volar/language-service").ServiceContext;
322
+ dispose: () => void;
323
+ context: import("@volar/language-service").ServiceContext<any>;
322
324
  } | undefined;
323
325
  getParsedCommandLine: () => ts.ParsedCommandLine;
324
326
  tryAddFile: (fileName: string) => void;
@@ -326,7 +328,8 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
326
328
  }> | undefined;
327
329
  uriHas: (_uri: string) => boolean;
328
330
  uriSet: (_uri: string, item: Promise<{
329
- tsConfig: ts.CompilerOptions | import("typesafe-path").PosixPath;
331
+ readFiles: Set<string>;
332
+ tsConfig: import("typesafe-path").PosixPath | ts.CompilerOptions;
330
333
  scripts: {
331
334
  clear: () => void;
332
335
  values: () => IterableIterator<{
@@ -420,8 +423,8 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
420
423
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
421
424
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
422
425
  };
423
- dispose: () => void | undefined;
424
- context: import("@volar/language-service").ServiceContext;
426
+ dispose: () => void;
427
+ context: import("@volar/language-service").ServiceContext<any>;
425
428
  };
426
429
  getLanguageServiceDontCreate: () => {
427
430
  triggerCharacters: string[];
@@ -473,8 +476,8 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
473
476
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
474
477
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
475
478
  };
476
- dispose: () => void | undefined;
477
- context: import("@volar/language-service").ServiceContext;
479
+ dispose: () => void;
480
+ context: import("@volar/language-service").ServiceContext<any>;
478
481
  } | undefined;
479
482
  getParsedCommandLine: () => ts.ParsedCommandLine;
480
483
  tryAddFile: (fileName: string) => void;
@@ -482,7 +485,8 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
482
485
  }>) => void;
483
486
  pathDelete: (path: string) => boolean;
484
487
  pathGet: (path: string) => Promise<{
485
- tsConfig: ts.CompilerOptions | import("typesafe-path").PosixPath;
488
+ readFiles: Set<string>;
489
+ tsConfig: import("typesafe-path").PosixPath | ts.CompilerOptions;
486
490
  scripts: {
487
491
  clear: () => void;
488
492
  values: () => IterableIterator<{
@@ -576,8 +580,8 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
576
580
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
577
581
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
578
582
  };
579
- dispose: () => void | undefined;
580
- context: import("@volar/language-service").ServiceContext;
583
+ dispose: () => void;
584
+ context: import("@volar/language-service").ServiceContext<any>;
581
585
  };
582
586
  getLanguageServiceDontCreate: () => {
583
587
  triggerCharacters: string[];
@@ -629,15 +633,16 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
629
633
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
630
634
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
631
635
  };
632
- dispose: () => void | undefined;
633
- context: import("@volar/language-service").ServiceContext;
636
+ dispose: () => void;
637
+ context: import("@volar/language-service").ServiceContext<any>;
634
638
  } | undefined;
635
639
  getParsedCommandLine: () => ts.ParsedCommandLine;
636
640
  tryAddFile: (fileName: string) => void;
637
641
  dispose: () => void;
638
642
  }> | undefined;
639
643
  pathHas: (path: string) => Promise<{
640
- tsConfig: ts.CompilerOptions | import("typesafe-path").PosixPath;
644
+ readFiles: Set<string>;
645
+ tsConfig: import("typesafe-path").PosixPath | ts.CompilerOptions;
641
646
  scripts: {
642
647
  clear: () => void;
643
648
  values: () => IterableIterator<{
@@ -731,8 +736,8 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
731
736
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
732
737
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
733
738
  };
734
- dispose: () => void | undefined;
735
- context: import("@volar/language-service").ServiceContext;
739
+ dispose: () => void;
740
+ context: import("@volar/language-service").ServiceContext<any>;
736
741
  };
737
742
  getLanguageServiceDontCreate: () => {
738
743
  triggerCharacters: string[];
@@ -784,15 +789,16 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
784
789
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
785
790
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
786
791
  };
787
- dispose: () => void | undefined;
788
- context: import("@volar/language-service").ServiceContext;
792
+ dispose: () => void;
793
+ context: import("@volar/language-service").ServiceContext<any>;
789
794
  } | undefined;
790
795
  getParsedCommandLine: () => ts.ParsedCommandLine;
791
796
  tryAddFile: (fileName: string) => void;
792
797
  dispose: () => void;
793
798
  }> | undefined;
794
799
  pathSet: (path: string, item: Promise<{
795
- tsConfig: ts.CompilerOptions | import("typesafe-path").PosixPath;
800
+ readFiles: Set<string>;
801
+ tsConfig: import("typesafe-path").PosixPath | ts.CompilerOptions;
796
802
  scripts: {
797
803
  clear: () => void;
798
804
  values: () => IterableIterator<{
@@ -886,8 +892,8 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
886
892
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
887
893
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
888
894
  };
889
- dispose: () => void | undefined;
890
- context: import("@volar/language-service").ServiceContext;
895
+ dispose: () => void;
896
+ context: import("@volar/language-service").ServiceContext<any>;
891
897
  };
892
898
  getLanguageServiceDontCreate: () => {
893
899
  triggerCharacters: string[];
@@ -939,19 +945,19 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
939
945
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
940
946
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
941
947
  };
942
- dispose: () => void | undefined;
943
- context: import("@volar/language-service").ServiceContext;
948
+ dispose: () => void;
949
+ context: import("@volar/language-service").ServiceContext<any>;
944
950
  } | undefined;
945
951
  getParsedCommandLine: () => ts.ParsedCommandLine;
946
952
  tryAddFile: (fileName: string) => void;
947
953
  dispose: () => void;
948
954
  }>) => void;
949
955
  };
950
- documentRegistry: ts.DocumentRegistry | undefined;
951
956
  getProjectAndTsConfig: (uri: string) => Promise<{
952
957
  tsconfig: string;
953
958
  project: {
954
- tsConfig: ts.CompilerOptions | import("typesafe-path").PosixPath;
959
+ readFiles: Set<string>;
960
+ tsConfig: import("typesafe-path").PosixPath | ts.CompilerOptions;
955
961
  scripts: {
956
962
  clear: () => void;
957
963
  values: () => IterableIterator<{
@@ -1045,8 +1051,8 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
1045
1051
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
1046
1052
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
1047
1053
  };
1048
- dispose: () => void | undefined;
1049
- context: import("@volar/language-service").ServiceContext;
1054
+ dispose: () => void;
1055
+ context: import("@volar/language-service").ServiceContext<any>;
1050
1056
  };
1051
1057
  getLanguageServiceDontCreate: () => {
1052
1058
  triggerCharacters: string[];
@@ -1098,16 +1104,17 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
1098
1104
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
1099
1105
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
1100
1106
  };
1101
- dispose: () => void | undefined;
1102
- context: import("@volar/language-service").ServiceContext;
1107
+ dispose: () => void;
1108
+ context: import("@volar/language-service").ServiceContext<any>;
1103
1109
  } | undefined;
1104
1110
  getParsedCommandLine: () => ts.ParsedCommandLine;
1105
1111
  tryAddFile: (fileName: string) => void;
1106
1112
  dispose: () => void;
1107
- } | undefined;
1113
+ };
1108
1114
  } | undefined>;
1109
1115
  getInferredProject: () => Promise<{
1110
- tsConfig: ts.CompilerOptions | import("typesafe-path").PosixPath;
1116
+ readFiles: Set<string>;
1117
+ tsConfig: import("typesafe-path").PosixPath | ts.CompilerOptions;
1111
1118
  scripts: {
1112
1119
  clear: () => void;
1113
1120
  values: () => IterableIterator<{
@@ -1201,8 +1208,8 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
1201
1208
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
1202
1209
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
1203
1210
  };
1204
- dispose: () => void | undefined;
1205
- context: import("@volar/language-service").ServiceContext;
1211
+ dispose: () => void;
1212
+ context: import("@volar/language-service").ServiceContext<any>;
1206
1213
  };
1207
1214
  getLanguageServiceDontCreate: () => {
1208
1215
  triggerCharacters: string[];
@@ -1254,15 +1261,16 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
1254
1261
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
1255
1262
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
1256
1263
  };
1257
- dispose: () => void | undefined;
1258
- context: import("@volar/language-service").ServiceContext;
1264
+ dispose: () => void;
1265
+ context: import("@volar/language-service").ServiceContext<any>;
1259
1266
  } | undefined;
1260
1267
  getParsedCommandLine: () => ts.ParsedCommandLine;
1261
1268
  tryAddFile: (fileName: string) => void;
1262
1269
  dispose: () => void;
1263
1270
  }>;
1264
1271
  getInferredProjectDontCreate: () => Promise<{
1265
- tsConfig: ts.CompilerOptions | import("typesafe-path").PosixPath;
1272
+ readFiles: Set<string>;
1273
+ tsConfig: import("typesafe-path").PosixPath | ts.CompilerOptions;
1266
1274
  scripts: {
1267
1275
  clear: () => void;
1268
1276
  values: () => IterableIterator<{
@@ -1356,8 +1364,8 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
1356
1364
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
1357
1365
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
1358
1366
  };
1359
- dispose: () => void | undefined;
1360
- context: import("@volar/language-service").ServiceContext;
1367
+ dispose: () => void;
1368
+ context: import("@volar/language-service").ServiceContext<any>;
1361
1369
  };
1362
1370
  getLanguageServiceDontCreate: () => {
1363
1371
  triggerCharacters: string[];
@@ -1409,8 +1417,8 @@ export declare function createWorkspace(context: WorkspaceContext): Promise<{
1409
1417
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
1410
1418
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
1411
1419
  };
1412
- dispose: () => void | undefined;
1413
- context: import("@volar/language-service").ServiceContext;
1420
+ dispose: () => void;
1421
+ context: import("@volar/language-service").ServiceContext<any>;
1414
1422
  } | undefined;
1415
1423
  getParsedCommandLine: () => ts.ParsedCommandLine;
1416
1424
  tryAddFile: (fileName: string) => void;
@@ -14,7 +14,6 @@ async function createWorkspace(context) {
14
14
  const uriToFileName = context.server.runtimeEnv.uriToFileName;
15
15
  let inferredProject;
16
16
  const sys = context.workspaces.fileSystemHost?.getWorkspaceFileSystem(context.workspace.rootUri);
17
- const documentRegistry = sys ? context.workspaces.ts?.createDocumentRegistry(sys.useCaseSensitiveFileNames, uriToFileName(context.workspace.rootUri.toString())) : undefined;
18
17
  const projects = (0, uriMap_1.createUriMap)(fileNameToUri);
19
18
  const rootTsConfigs = new Set();
20
19
  const searchedDirs = new Set();
@@ -39,7 +38,6 @@ async function createWorkspace(context) {
39
38
  });
40
39
  return {
41
40
  projects,
42
- documentRegistry,
43
41
  getProjectAndTsConfig,
44
42
  getInferredProject,
45
43
  getInferredProjectDontCreate: () => inferredProject,
@@ -79,7 +77,6 @@ async function createWorkspace(context) {
79
77
  project: {
80
78
  rootUri: context.workspace.rootUri,
81
79
  tsConfig: inferOptions,
82
- documentRegistry,
83
80
  },
84
81
  });
85
82
  })();
@@ -129,9 +126,7 @@ async function createWorkspace(context) {
129
126
  function findIndirectReferenceTsconfig() {
130
127
  return findTsconfig(async (tsconfig) => {
131
128
  const project = await projects.pathGet(tsconfig);
132
- const ls = project?.getLanguageServiceDontCreate();
133
- const validDoc = ls?.context.typescript?.languageService.getProgram()?.getSourceFile(uriToFileName(uri.toString()));
134
- return !!validDoc;
129
+ return project?.readFiles.has(uriToFileName(uri.toString())) ?? false;
135
130
  });
136
131
  }
137
132
  async function findTsconfig(match) {
@@ -200,13 +195,12 @@ async function createWorkspace(context) {
200
195
  function getProjectByCreate(_tsConfig) {
201
196
  const tsConfig = _tsConfig.replace(/\\/g, '/');
202
197
  let project = projects.pathGet(tsConfig);
203
- if (!project && documentRegistry) {
198
+ if (!project) {
204
199
  project = (0, project_1.createProject)({
205
200
  ...context,
206
201
  project: {
207
202
  rootUri: vscode_uri_1.URI.parse(fileNameToUri(path.dirname(tsConfig))),
208
203
  tsConfig,
209
- documentRegistry,
210
204
  },
211
205
  });
212
206
  projects.pathSet(tsConfig, project);
@@ -27,7 +27,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
27
27
  projects: {
28
28
  clear: () => void;
29
29
  values: () => IterableIterator<Promise<{
30
- tsConfig: ts.CompilerOptions | path.PosixPath;
30
+ readFiles: Set<string>;
31
+ tsConfig: path.PosixPath | ts.CompilerOptions;
31
32
  scripts: {
32
33
  clear: () => void;
33
34
  values: () => IterableIterator<{
@@ -121,8 +122,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
121
122
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
122
123
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
123
124
  };
124
- dispose: () => void | undefined;
125
- context: import("@volar/language-service").ServiceContext;
125
+ dispose: () => void;
126
+ context: import("@volar/language-service").ServiceContext<any>;
126
127
  };
127
128
  getLanguageServiceDontCreate: () => {
128
129
  triggerCharacters: string[];
@@ -174,8 +175,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
174
175
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
175
176
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
176
177
  };
177
- dispose: () => void | undefined;
178
- context: import("@volar/language-service").ServiceContext;
178
+ dispose: () => void;
179
+ context: import("@volar/language-service").ServiceContext<any>;
179
180
  } | undefined;
180
181
  getParsedCommandLine: () => ts.ParsedCommandLine;
181
182
  tryAddFile: (fileName: string) => void;
@@ -183,7 +184,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
183
184
  }>>;
184
185
  uriDelete: (_uri: string) => boolean;
185
186
  uriGet: (_uri: string) => Promise<{
186
- tsConfig: ts.CompilerOptions | path.PosixPath;
187
+ readFiles: Set<string>;
188
+ tsConfig: path.PosixPath | ts.CompilerOptions;
187
189
  scripts: {
188
190
  clear: () => void;
189
191
  values: () => IterableIterator<{
@@ -277,8 +279,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
277
279
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
278
280
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
279
281
  };
280
- dispose: () => void | undefined;
281
- context: import("@volar/language-service").ServiceContext;
282
+ dispose: () => void;
283
+ context: import("@volar/language-service").ServiceContext<any>;
282
284
  };
283
285
  getLanguageServiceDontCreate: () => {
284
286
  triggerCharacters: string[];
@@ -330,8 +332,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
330
332
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
331
333
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
332
334
  };
333
- dispose: () => void | undefined;
334
- context: import("@volar/language-service").ServiceContext;
335
+ dispose: () => void;
336
+ context: import("@volar/language-service").ServiceContext<any>;
335
337
  } | undefined;
336
338
  getParsedCommandLine: () => ts.ParsedCommandLine;
337
339
  tryAddFile: (fileName: string) => void;
@@ -339,7 +341,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
339
341
  }> | undefined;
340
342
  uriHas: (_uri: string) => boolean;
341
343
  uriSet: (_uri: string, item: Promise<{
342
- tsConfig: ts.CompilerOptions | path.PosixPath;
344
+ readFiles: Set<string>;
345
+ tsConfig: path.PosixPath | ts.CompilerOptions;
343
346
  scripts: {
344
347
  clear: () => void;
345
348
  values: () => IterableIterator<{
@@ -433,8 +436,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
433
436
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
434
437
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
435
438
  };
436
- dispose: () => void | undefined;
437
- context: import("@volar/language-service").ServiceContext;
439
+ dispose: () => void;
440
+ context: import("@volar/language-service").ServiceContext<any>;
438
441
  };
439
442
  getLanguageServiceDontCreate: () => {
440
443
  triggerCharacters: string[];
@@ -486,8 +489,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
486
489
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
487
490
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
488
491
  };
489
- dispose: () => void | undefined;
490
- context: import("@volar/language-service").ServiceContext;
492
+ dispose: () => void;
493
+ context: import("@volar/language-service").ServiceContext<any>;
491
494
  } | undefined;
492
495
  getParsedCommandLine: () => ts.ParsedCommandLine;
493
496
  tryAddFile: (fileName: string) => void;
@@ -495,7 +498,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
495
498
  }>) => void;
496
499
  pathDelete: (path: string) => boolean;
497
500
  pathGet: (path: string) => Promise<{
498
- tsConfig: ts.CompilerOptions | path.PosixPath;
501
+ readFiles: Set<string>;
502
+ tsConfig: path.PosixPath | ts.CompilerOptions;
499
503
  scripts: {
500
504
  clear: () => void;
501
505
  values: () => IterableIterator<{
@@ -589,8 +593,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
589
593
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
590
594
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
591
595
  };
592
- dispose: () => void | undefined;
593
- context: import("@volar/language-service").ServiceContext;
596
+ dispose: () => void;
597
+ context: import("@volar/language-service").ServiceContext<any>;
594
598
  };
595
599
  getLanguageServiceDontCreate: () => {
596
600
  triggerCharacters: string[];
@@ -642,15 +646,16 @@ export declare function createWorkspaces(context: WorkspacesContext): {
642
646
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
643
647
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
644
648
  };
645
- dispose: () => void | undefined;
646
- context: import("@volar/language-service").ServiceContext;
649
+ dispose: () => void;
650
+ context: import("@volar/language-service").ServiceContext<any>;
647
651
  } | undefined;
648
652
  getParsedCommandLine: () => ts.ParsedCommandLine;
649
653
  tryAddFile: (fileName: string) => void;
650
654
  dispose: () => void;
651
655
  }> | undefined;
652
656
  pathHas: (path: string) => Promise<{
653
- tsConfig: ts.CompilerOptions | path.PosixPath;
657
+ readFiles: Set<string>;
658
+ tsConfig: path.PosixPath | ts.CompilerOptions;
654
659
  scripts: {
655
660
  clear: () => void;
656
661
  values: () => IterableIterator<{
@@ -744,8 +749,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
744
749
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
745
750
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
746
751
  };
747
- dispose: () => void | undefined;
748
- context: import("@volar/language-service").ServiceContext;
752
+ dispose: () => void;
753
+ context: import("@volar/language-service").ServiceContext<any>;
749
754
  };
750
755
  getLanguageServiceDontCreate: () => {
751
756
  triggerCharacters: string[];
@@ -797,15 +802,16 @@ export declare function createWorkspaces(context: WorkspacesContext): {
797
802
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
798
803
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
799
804
  };
800
- dispose: () => void | undefined;
801
- context: import("@volar/language-service").ServiceContext;
805
+ dispose: () => void;
806
+ context: import("@volar/language-service").ServiceContext<any>;
802
807
  } | undefined;
803
808
  getParsedCommandLine: () => ts.ParsedCommandLine;
804
809
  tryAddFile: (fileName: string) => void;
805
810
  dispose: () => void;
806
811
  }> | undefined;
807
812
  pathSet: (path: string, item: Promise<{
808
- tsConfig: ts.CompilerOptions | path.PosixPath;
813
+ readFiles: Set<string>;
814
+ tsConfig: path.PosixPath | ts.CompilerOptions;
809
815
  scripts: {
810
816
  clear: () => void;
811
817
  values: () => IterableIterator<{
@@ -899,8 +905,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
899
905
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
900
906
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
901
907
  };
902
- dispose: () => void | undefined;
903
- context: import("@volar/language-service").ServiceContext;
908
+ dispose: () => void;
909
+ context: import("@volar/language-service").ServiceContext<any>;
904
910
  };
905
911
  getLanguageServiceDontCreate: () => {
906
912
  triggerCharacters: string[];
@@ -952,19 +958,19 @@ export declare function createWorkspaces(context: WorkspacesContext): {
952
958
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
953
959
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
954
960
  };
955
- dispose: () => void | undefined;
956
- context: import("@volar/language-service").ServiceContext;
961
+ dispose: () => void;
962
+ context: import("@volar/language-service").ServiceContext<any>;
957
963
  } | undefined;
958
964
  getParsedCommandLine: () => ts.ParsedCommandLine;
959
965
  tryAddFile: (fileName: string) => void;
960
966
  dispose: () => void;
961
967
  }>) => void;
962
968
  };
963
- documentRegistry: ts.DocumentRegistry | undefined;
964
969
  getProjectAndTsConfig: (uri: string) => Promise<{
965
970
  tsconfig: string;
966
971
  project: {
967
- tsConfig: ts.CompilerOptions | path.PosixPath;
972
+ readFiles: Set<string>;
973
+ tsConfig: path.PosixPath | ts.CompilerOptions;
968
974
  scripts: {
969
975
  clear: () => void;
970
976
  values: () => IterableIterator<{
@@ -1058,8 +1064,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
1058
1064
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
1059
1065
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
1060
1066
  };
1061
- dispose: () => void | undefined;
1062
- context: import("@volar/language-service").ServiceContext;
1067
+ dispose: () => void;
1068
+ context: import("@volar/language-service").ServiceContext<any>;
1063
1069
  };
1064
1070
  getLanguageServiceDontCreate: () => {
1065
1071
  triggerCharacters: string[];
@@ -1111,16 +1117,17 @@ export declare function createWorkspaces(context: WorkspacesContext): {
1111
1117
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
1112
1118
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
1113
1119
  };
1114
- dispose: () => void | undefined;
1115
- context: import("@volar/language-service").ServiceContext;
1120
+ dispose: () => void;
1121
+ context: import("@volar/language-service").ServiceContext<any>;
1116
1122
  } | undefined;
1117
1123
  getParsedCommandLine: () => ts.ParsedCommandLine;
1118
1124
  tryAddFile: (fileName: string) => void;
1119
1125
  dispose: () => void;
1120
- } | undefined;
1126
+ };
1121
1127
  } | undefined>;
1122
1128
  getInferredProject: () => Promise<{
1123
- tsConfig: ts.CompilerOptions | path.PosixPath;
1129
+ readFiles: Set<string>;
1130
+ tsConfig: path.PosixPath | ts.CompilerOptions;
1124
1131
  scripts: {
1125
1132
  clear: () => void;
1126
1133
  values: () => IterableIterator<{
@@ -1214,8 +1221,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
1214
1221
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
1215
1222
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
1216
1223
  };
1217
- dispose: () => void | undefined;
1218
- context: import("@volar/language-service").ServiceContext;
1224
+ dispose: () => void;
1225
+ context: import("@volar/language-service").ServiceContext<any>;
1219
1226
  };
1220
1227
  getLanguageServiceDontCreate: () => {
1221
1228
  triggerCharacters: string[];
@@ -1267,15 +1274,16 @@ export declare function createWorkspaces(context: WorkspacesContext): {
1267
1274
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
1268
1275
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
1269
1276
  };
1270
- dispose: () => void | undefined;
1271
- context: import("@volar/language-service").ServiceContext;
1277
+ dispose: () => void;
1278
+ context: import("@volar/language-service").ServiceContext<any>;
1272
1279
  } | undefined;
1273
1280
  getParsedCommandLine: () => ts.ParsedCommandLine;
1274
1281
  tryAddFile: (fileName: string) => void;
1275
1282
  dispose: () => void;
1276
1283
  }>;
1277
1284
  getInferredProjectDontCreate: () => Promise<{
1278
- tsConfig: ts.CompilerOptions | path.PosixPath;
1285
+ readFiles: Set<string>;
1286
+ tsConfig: path.PosixPath | ts.CompilerOptions;
1279
1287
  scripts: {
1280
1288
  clear: () => void;
1281
1289
  values: () => IterableIterator<{
@@ -1369,8 +1377,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
1369
1377
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
1370
1378
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
1371
1379
  };
1372
- dispose: () => void | undefined;
1373
- context: import("@volar/language-service").ServiceContext;
1380
+ dispose: () => void;
1381
+ context: import("@volar/language-service").ServiceContext<any>;
1374
1382
  };
1375
1383
  getLanguageServiceDontCreate: () => {
1376
1384
  triggerCharacters: string[];
@@ -1422,8 +1430,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
1422
1430
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
1423
1431
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
1424
1432
  };
1425
- dispose: () => void | undefined;
1426
- context: import("@volar/language-service").ServiceContext;
1433
+ dispose: () => void;
1434
+ context: import("@volar/language-service").ServiceContext<any>;
1427
1435
  } | undefined;
1428
1436
  getParsedCommandLine: () => ts.ParsedCommandLine;
1429
1437
  tryAddFile: (fileName: string) => void;
@@ -1435,7 +1443,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
1435
1443
  getProject: (uri: string) => Promise<{
1436
1444
  tsconfig: string;
1437
1445
  project: {
1438
- tsConfig: ts.CompilerOptions | path.PosixPath;
1446
+ readFiles: Set<string>;
1447
+ tsConfig: path.PosixPath | ts.CompilerOptions;
1439
1448
  scripts: {
1440
1449
  clear: () => void;
1441
1450
  values: () => IterableIterator<{
@@ -1529,8 +1538,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
1529
1538
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
1530
1539
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
1531
1540
  };
1532
- dispose: () => void | undefined;
1533
- context: import("@volar/language-service").ServiceContext;
1541
+ dispose: () => void;
1542
+ context: import("@volar/language-service").ServiceContext<any>;
1534
1543
  };
1535
1544
  getLanguageServiceDontCreate: () => {
1536
1545
  triggerCharacters: string[];
@@ -1582,17 +1591,18 @@ export declare function createWorkspaces(context: WorkspacesContext): {
1582
1591
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
1583
1592
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
1584
1593
  };
1585
- dispose: () => void | undefined;
1586
- context: import("@volar/language-service").ServiceContext;
1594
+ dispose: () => void;
1595
+ context: import("@volar/language-service").ServiceContext<any>;
1587
1596
  } | undefined;
1588
1597
  getParsedCommandLine: () => ts.ParsedCommandLine;
1589
1598
  tryAddFile: (fileName: string) => void;
1590
1599
  dispose: () => void;
1591
- } | undefined;
1600
+ };
1592
1601
  } | {
1593
1602
  tsconfig: undefined;
1594
1603
  project: {
1595
- tsConfig: ts.CompilerOptions | path.PosixPath;
1604
+ readFiles: Set<string>;
1605
+ tsConfig: path.PosixPath | ts.CompilerOptions;
1596
1606
  scripts: {
1597
1607
  clear: () => void;
1598
1608
  values: () => IterableIterator<{
@@ -1686,8 +1696,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
1686
1696
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
1687
1697
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
1688
1698
  };
1689
- dispose: () => void | undefined;
1690
- context: import("@volar/language-service").ServiceContext;
1699
+ dispose: () => void;
1700
+ context: import("@volar/language-service").ServiceContext<any>;
1691
1701
  };
1692
1702
  getLanguageServiceDontCreate: () => {
1693
1703
  triggerCharacters: string[];
@@ -1739,8 +1749,8 @@ export declare function createWorkspaces(context: WorkspacesContext): {
1739
1749
  getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyIncomingCall[]>;
1740
1750
  getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise<vscode.CallHierarchyOutgoingCall[]>;
1741
1751
  };
1742
- dispose: () => void | undefined;
1743
- context: import("@volar/language-service").ServiceContext;
1752
+ dispose: () => void;
1753
+ context: import("@volar/language-service").ServiceContext<any>;
1744
1754
  } | undefined;
1745
1755
  getParsedCommandLine: () => ts.ParsedCommandLine;
1746
1756
  tryAddFile: (fileName: string) => void;
package/out/protocol.d.ts CHANGED
@@ -91,6 +91,3 @@ export declare namespace GetVirtualFileRequest {
91
91
  type ErrorType = never;
92
92
  const type: vscode.RequestType<ParamsType, ResponseType, never>;
93
93
  }
94
- export declare namespace ReportStats {
95
- const type: vscode.NotificationType0;
96
- }
package/out/protocol.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReportStats = exports.GetVirtualFileRequest = exports.GetVirtualFilesRequest = exports.ReloadProjectNotification = exports.WriteVirtualFilesNotification = exports.AutoInsertRequest = exports.GetProjectFilesRequest = exports.GetProjectsRequest = exports.GetMatchTsConfigRequest = exports.FindFileReferenceRequest = exports.FsReadDirectoryRequest = exports.FsReadFileRequest = void 0;
3
+ exports.GetVirtualFileRequest = exports.GetVirtualFilesRequest = exports.ReloadProjectNotification = exports.WriteVirtualFilesNotification = exports.AutoInsertRequest = exports.GetProjectFilesRequest = exports.GetProjectsRequest = exports.GetMatchTsConfigRequest = exports.FindFileReferenceRequest = exports.FsReadDirectoryRequest = exports.FsReadFileRequest = void 0;
4
4
  const vscode = require("vscode-languageserver-protocol");
5
5
  /**
6
6
  * Server request client
@@ -52,8 +52,4 @@ var GetVirtualFileRequest;
52
52
  (function (GetVirtualFileRequest) {
53
53
  GetVirtualFileRequest.type = new vscode.RequestType('volar/client/virtualFile');
54
54
  })(GetVirtualFileRequest = exports.GetVirtualFileRequest || (exports.GetVirtualFileRequest = {}));
55
- var ReportStats;
56
- (function (ReportStats) {
57
- ReportStats.type = new vscode.NotificationType0('volar/client/stats');
58
- })(ReportStats = exports.ReportStats || (exports.ReportStats = {}));
59
55
  //# sourceMappingURL=protocol.js.map
package/out/types.d.ts CHANGED
@@ -10,10 +10,9 @@ import { ProjectContext } from './common/project';
10
10
  export type FileSystemHost = {
11
11
  ready(connection: vscode.Connection): void;
12
12
  reload(): void;
13
- getWorkspaceFileSystem(rootUri: URI): FileSystem;
13
+ getWorkspaceFileSystem(rootUri: URI): ts.System;
14
14
  onDidChangeWatchedFiles(cb: (params: vscode.DidChangeWatchedFilesParams) => void): () => void;
15
15
  };
16
- export type FileSystem = Pick<ts.System, 'newLine' | 'useCaseSensitiveFileNames' | 'fileExists' | 'readFile' | 'readDirectory' | 'getCurrentDirectory' | 'realpath' | 'resolvePath'> & Partial<ts.System>;
17
16
  export interface RuntimeEnvironment {
18
17
  uriToFileName: (uri: string) => string;
19
18
  fileNameToUri: (fileName: string) => string;
@@ -32,7 +31,7 @@ export interface RuntimeEnvironment {
32
31
  interface LanguageServerPluginContext extends ProjectContext {
33
32
  env: ServiceEnvironment;
34
33
  host: embedded.LanguageServiceHost;
35
- sys: FileSystem;
34
+ sys: ts.System;
36
35
  }
37
36
  export interface LanguageServerPlugin {
38
37
  (initOptions: InitializationOptions, modules: {
@@ -41,6 +40,7 @@ export interface LanguageServerPlugin {
41
40
  extraFileExtensions?: ts.FileExtensionInfo[];
42
41
  watchFileExtensions?: string[];
43
42
  resolveConfig?(config: Config, ctx: LanguageServerPluginContext | undefined): Config;
43
+ resolveExistingOptions?(options: ts.CompilerOptions | undefined): ts.CompilerOptions | undefined;
44
44
  onInitialized?(getLanguageService: (uri: string) => Promise<LanguageService | undefined>, env: RuntimeEnvironment): void;
45
45
  };
46
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volar/language-server",
3
- "version": "1.6.8",
3
+ "version": "1.6.9-patch.1",
4
4
  "main": "out/index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -15,8 +15,8 @@
15
15
  "directory": "packages/language-server"
16
16
  },
17
17
  "dependencies": {
18
- "@volar/language-core": "1.6.8",
19
- "@volar/language-service": "1.6.8",
18
+ "@volar/language-core": "1.6.9",
19
+ "@volar/language-service": "1.6.9",
20
20
  "@vscode/l10n": "^0.0.11",
21
21
  "request-light": "^0.7.0",
22
22
  "typesafe-path": "^0.2.2",
@@ -27,7 +27,6 @@
27
27
  "vscode-uri": "^3.0.7"
28
28
  },
29
29
  "devDependencies": {
30
- "@volar/source-map": "1.6.8"
31
- },
32
- "gitHead": "3d269c7e69850ac5497469bede13f057db8a4980"
30
+ "@volar/source-map": "1.6.9"
31
+ }
33
32
  }