@@ -348,7 +348,7 @@ namespace ts {
348
348
* This is to allow the callers to be able to actually remove affected file only when the operation is complete
349
349
* eg. if during diagnostics check cancellation token ends up cancelling the request, the affected file should be retained
350
350
*/
351
- function getNextAffectedFile ( state : BuilderProgramState , cancellationToken : CancellationToken | undefined , computeHash : BuilderState . ComputeHash ) : SourceFile | Program | undefined {
351
+ function getNextAffectedFile ( state : BuilderProgramState , cancellationToken : CancellationToken | undefined , computeHash : BuilderState . ComputeHash , host : BuilderProgramHost ) : SourceFile | Program | undefined {
352
352
while ( true ) {
353
353
const { affectedFiles } = state ;
354
354
if ( affectedFiles ) {
@@ -359,7 +359,7 @@ namespace ts {
359
359
if ( ! seenAffectedFiles . has ( affectedFile . resolvedPath ) ) {
360
360
// Set the next affected file as seen and remove the cached semantic diagnostics
361
361
state . affectedFilesIndex = affectedFilesIndex ;
362
- handleDtsMayChangeOfAffectedFile ( state , affectedFile , cancellationToken , computeHash ) ;
362
+ handleDtsMayChangeOfAffectedFile ( state , affectedFile , cancellationToken , computeHash , host ) ;
363
363
return affectedFile ;
364
364
}
365
365
affectedFilesIndex ++ ;
@@ -433,7 +433,7 @@ namespace ts {
433
433
* Handles semantic diagnostics and dts emit for affectedFile and files, that are referencing modules that export entities from affected file
434
434
* This is because even though js emit doesnt change, dts emit / type used can change resulting in need for dts emit and js change
435
435
*/
436
- function handleDtsMayChangeOfAffectedFile ( state : BuilderProgramState , affectedFile : SourceFile , cancellationToken : CancellationToken | undefined , computeHash : BuilderState . ComputeHash ) {
436
+ function handleDtsMayChangeOfAffectedFile ( state : BuilderProgramState , affectedFile : SourceFile , cancellationToken : CancellationToken | undefined , computeHash : BuilderState . ComputeHash , host : BuilderProgramHost ) {
437
437
removeSemanticDiagnosticsOf ( state , affectedFile . resolvedPath ) ;
438
438
439
439
// If affected files is everything except default library, then nothing more to do
@@ -467,15 +467,15 @@ namespace ts {
467
467
}
468
468
469
469
if ( ! state . compilerOptions . assumeChangesOnlyAffectDirectDependencies ) {
470
- forEachReferencingModulesOfExportOfAffectedFile ( state , affectedFile , ( state , path ) => handleDtsMayChangeOf ( state , path , cancellationToken , computeHash ) ) ;
470
+ forEachReferencingModulesOfExportOfAffectedFile ( state , affectedFile , ( state , path ) => handleDtsMayChangeOf ( state , path , cancellationToken , computeHash , host ) ) ;
471
471
}
472
472
}
473
473
474
474
/**
475
475
* Handle the dts may change, so they need to be added to pending emit if dts emit is enabled,
476
476
* Also we need to make sure signature is updated for these files
477
477
*/
478
- function handleDtsMayChangeOf ( state : BuilderProgramState , path : Path , cancellationToken : CancellationToken | undefined , computeHash : BuilderState . ComputeHash ) : void {
478
+ function handleDtsMayChangeOf ( state : BuilderProgramState , path : Path , cancellationToken : CancellationToken | undefined , computeHash : BuilderState . ComputeHash , host : BuilderProgramHost ) : void {
479
479
removeSemanticDiagnosticsOf ( state , path ) ;
480
480
481
481
if ( ! state . changedFilesSet . has ( path ) ) {
@@ -495,7 +495,7 @@ namespace ts {
495
495
cancellationToken ,
496
496
computeHash ,
497
497
state . currentAffectedFilesExportedModulesMap ,
498
- /* useFileVersionAsSignature */ true
498
+ ! host . disableUseFileVersionAsSignature
499
499
) ;
500
500
// If not dts emit, nothing more to do
501
501
if ( getEmitDeclarations ( state . compilerOptions ) ) {
@@ -1039,7 +1039,7 @@ namespace ts {
1039
1039
* in that order would be used to write the files
1040
1040
*/
1041
1041
function emitNextAffectedFile ( writeFile ?: WriteFileCallback , cancellationToken ?: CancellationToken , emitOnlyDtsFiles ?: boolean , customTransformers ?: CustomTransformers ) : AffectedFileResult < EmitResult > {
1042
- let affected = getNextAffectedFile ( state , cancellationToken , computeHash ) ;
1042
+ let affected = getNextAffectedFile ( state , cancellationToken , computeHash , host ) ;
1043
1043
let emitKind = BuilderFileEmit . Full ;
1044
1044
let isPendingEmitFile = false ;
1045
1045
if ( ! affected ) {
@@ -1162,7 +1162,7 @@ namespace ts {
1162
1162
*/
1163
1163
function getSemanticDiagnosticsOfNextAffectedFile ( cancellationToken ?: CancellationToken , ignoreSourceFile ?: ( sourceFile : SourceFile ) => boolean ) : AffectedFileResult < readonly Diagnostic [ ] > {
1164
1164
while ( true ) {
1165
- const affected = getNextAffectedFile ( state , cancellationToken , computeHash ) ;
1165
+ const affected = getNextAffectedFile ( state , cancellationToken , computeHash , host ) ;
1166
1166
if ( ! affected ) {
1167
1167
// Done
1168
1168
return undefined ;
0 commit comments