mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-12 03:20:56 -06:00
Ensure that from tsc with --incremental sets source file version
Fixes #30588 and #30589
This commit is contained in:
parent
684c531386
commit
e28869d888
@ -275,7 +275,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
export function setGetSourceFileAsHashVersioned(compilerHost: CompilerHost, host: ProgramHost<any>) {
|
||||
export function setGetSourceFileAsHashVersioned(compilerHost: CompilerHost, host: { createHash?(data: string): string; }) {
|
||||
const originalGetSourceFile = compilerHost.getSourceFile;
|
||||
const computeHash = host.createHash || generateDjb2Hash;
|
||||
compilerHost.getSourceFile = (...args) => {
|
||||
|
||||
@ -263,6 +263,7 @@ namespace ts {
|
||||
const host = createCompilerHost(options);
|
||||
const currentDirectory = host.getCurrentDirectory();
|
||||
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
||||
setGetSourceFileAsHashVersioned(host, sys);
|
||||
changeCompilerHostLikeToUseCache(host, fileName => toPath(fileName, currentDirectory, getCanonicalFileName));
|
||||
enableStatistics(options);
|
||||
const oldProgram = readBuilderProgram(options, path => host.readFile(path));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user