mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 21:06:50 -05:00
Handle getScriptVersion correctly to ensure program structure is checked correctly (#36808)
* Fix tests when there are project references but has disableSourceOfProjectReferenceRedirect * Handle getScriptVersion correctly to ensure program structure is checked correctly Fixes #36748 * Harness's language service host doesnt have getProjectVersion. This means earlier we were creating fresh program everytime we did LS operation Now we reuse same program, so quick info depends on order of quickinfo demands * Because same program is used, it unvails a bug that if `export=` is evaluated before finding references, it cant find all definitions from the merge * Update src/server/project.ts Co-Authored-By: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> * Make clearSourceMapperCache required Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
This commit is contained in:
@@ -553,7 +553,7 @@ namespace ts {
|
||||
program: Program | undefined,
|
||||
rootFileNames: string[],
|
||||
newOptions: CompilerOptions,
|
||||
getSourceVersion: (path: Path) => string | undefined,
|
||||
getSourceVersion: (path: Path, fileName: string) => string | undefined,
|
||||
fileExists: (fileName: string) => boolean,
|
||||
hasInvalidatedResolution: HasInvalidatedResolution,
|
||||
hasChangedAutomaticTypeDirectiveNames: boolean,
|
||||
@@ -606,7 +606,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function sourceFileVersionUptoDate(sourceFile: SourceFile) {
|
||||
return sourceFile.version === getSourceVersion(sourceFile.resolvedPath);
|
||||
return sourceFile.version === getSourceVersion(sourceFile.resolvedPath, sourceFile.fileName);
|
||||
}
|
||||
|
||||
function projectReferenceUptoDate(oldRef: ProjectReference, newRef: ProjectReference, index: number) {
|
||||
|
||||
Reference in New Issue
Block a user