mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
Code review feedback
This commit is contained in:
parent
ae7e00e741
commit
4a55025f20
@ -406,14 +406,13 @@ namespace ts {
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles sematic diagnostics and dts emit for affectedFile and files, that are referencing modules that export entities from affected file
|
||||
* Handles semantic diagnostics and dts emit for affectedFile and files, that are referencing modules that export entities from affected file
|
||||
* This is because even though js emit doesnt change, dts emit / type used can change resulting in need for dts emit and js change
|
||||
* Similar to cleanSemanticDiagnosticsOfAffectedFile
|
||||
*/
|
||||
function handleDtsMayChangeOfAffectedFile(state: BuilderProgramState, affectedFile: SourceFile, cancellationToken: CancellationToken | undefined, computeHash: BuilderState.ComputeHash) {
|
||||
removeSemanticDiagnosticsOf(state, affectedFile.path);
|
||||
|
||||
// If affected files is everything except default librarry, then nothing more to do
|
||||
// If affected files is everything except default library, then nothing more to do
|
||||
if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) {
|
||||
if (!state.cleanedDiagnosticsOfLibFiles) {
|
||||
state.cleanedDiagnosticsOfLibFiles = true;
|
||||
@ -442,7 +441,19 @@ namespace ts {
|
||||
const program = Debug.assertDefined(state.program);
|
||||
const sourceFile = program.getSourceFileByPath(path);
|
||||
if (sourceFile) {
|
||||
BuilderState.updateShapeSignature(state, program, sourceFile, Debug.assertDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap);
|
||||
// Even though the js emit doesnt change and we are already handling dts emit and semantic diagnostics
|
||||
// we need to update the signature to reflect correctness of the signature(which is output d.ts emit) of this file
|
||||
// This ensures that we dont later during incremental builds considering wrong signature.
|
||||
// Eg where this also is needed to ensure that .tsbuildinfo generated by incremental build should be same as if it was first fresh build
|
||||
BuilderState.updateShapeSignature(
|
||||
state,
|
||||
program,
|
||||
sourceFile,
|
||||
Debug.assertDefined(state.currentAffectedFilesSignatures),
|
||||
cancellationToken,
|
||||
computeHash,
|
||||
state.currentAffectedFilesExportedModulesMap
|
||||
);
|
||||
// If not dts emit, nothing more to do
|
||||
if (getEmitDeclarations(state.compilerOptions)) {
|
||||
addToAffectedFilesPendingEmit(state, [path]);
|
||||
|
||||
@ -92,7 +92,7 @@
|
||||
"unittests/tsbuild/amdModulesWithOut.ts",
|
||||
"unittests/tsbuild/emptyFiles.ts",
|
||||
"unittests/tsbuild/graphOrdering.ts",
|
||||
"unittests/tsbuild//inferredTypeFromTransitiveModule.ts",
|
||||
"unittests/tsbuild/inferredTypeFromTransitiveModule.ts",
|
||||
"unittests/tsbuild/missingExtendedFile.ts",
|
||||
"unittests/tsbuild/outFile.ts",
|
||||
"unittests/tsbuild/referencesWithRootDirInParent.ts",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user