Throw errors to create fixer

This commit is contained in:
Sheetal Nandi
2025-09-17 16:11:02 -07:00
parent 8b451ce8c9
commit 86ace2f019
2 changed files with 9 additions and 1 deletions

View File

@@ -63,7 +63,6 @@ import {
DiagnosticWithLocation,
directorySeparator,
DirectoryStructureHost,
emitDetachedComments,
emitFileNamesIsEqual,
emitFiles,
EmitHost,
@@ -316,6 +315,7 @@ import {
trace,
tracing,
tryCast,
tsFixRootDirSignal,
TypeChecker,
typeDirectiveIsEqualTo,
TypeReferenceDirectiveResolutionCache,
@@ -2177,6 +2177,7 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
sourceFile.fileName,
"!!! Sheetal CommonDir computed: " + commonSourceDirectory + " commonDir in 6.0 : " + commonDir60,
);
tsFixRootDirSignal("allFilesDontBelong", commonSourceDirectory, commonDir60);
});
}
}
@@ -4464,6 +4465,7 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
"\n outputPaths:: " + JSON.stringify(outputPaths) +
"\n Output paths in 6.0: " + JSON.stringify(outputPaths60),
));
tsFixRootDirSignal("outputPathsChange", getCommonSourceDirectory(), commonDir60);
}
}
}

View File

@@ -6628,6 +6628,12 @@ export function sourceFileMayBeEmitted(sourceFile: SourceFile, host: SourceFileM
return true;
}
/**@internal */
export function tsFixRootDirSignal(kind: string, rootDir: string, rootDir60: string): void {
throw new Error(`TS_FIX_ROOTDIR_SIGNAL:: ${kind}:: 5.9:: ${rootDir} 6.0:: ${rootDir60} <End>`);
}
/** @internal */
export function sourceFileMayBeEmitted60(sourceFile: SourceFile, host: SourceFileMayBeEmittedHost, forceDtsEmit?: boolean): boolean {
const options = host.getCompilerOptions();
// Js files are emitted only if option is enabled