mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-10 18:04:18 -05:00
Cache the latest source file from document registry so we can keep it alive when script info is orphan
This commit is contained in:
@@ -202,6 +202,12 @@ namespace ts.server {
|
||||
return fileName[0] === "^" || getBaseFileName(fileName)[0] === "^";
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
export interface DocumentRegistrySourceFileCache {
|
||||
key: DocumentRegistryBucketKey;
|
||||
sourceFile: SourceFile;
|
||||
}
|
||||
|
||||
export class ScriptInfo {
|
||||
/**
|
||||
* All projects that include this file
|
||||
@@ -221,6 +227,9 @@ namespace ts.server {
|
||||
/** Set to real path if path is different from info.path */
|
||||
private realpath: Path | undefined;
|
||||
|
||||
/*@internal*/
|
||||
cacheSourceFile: DocumentRegistrySourceFileCache;
|
||||
|
||||
constructor(
|
||||
private readonly host: ServerHost,
|
||||
readonly fileName: NormalizedPath,
|
||||
|
||||
Reference in New Issue
Block a user