@@ -246,7 +246,7 @@ namespace ts {
246
246
247
247
if ( oldCompilerOptions && compilerOptionsAffectEmit ( compilerOptions , oldCompilerOptions ) ) {
248
248
// Add all files to affectedFilesPendingEmit since emit changed
249
- newProgram . getSourceFiles ( ) . forEach ( f => addToAffectedFilesPendingEmit ( state , f . path , BuilderFileEmit . Full ) ) ;
249
+ newProgram . getSourceFiles ( ) . forEach ( f => addToAffectedFilesPendingEmit ( state , f . resolvedPath , BuilderFileEmit . Full ) ) ;
250
250
Debug . assert ( state . seenAffectedFiles === undefined ) ;
251
251
state . seenAffectedFiles = createMap < true > ( ) ;
252
252
}
@@ -321,7 +321,7 @@ namespace ts {
321
321
* Verifies that source file is ok to be used in calls that arent handled by next
322
322
*/
323
323
function assertSourceFileOkWithoutNextAffectedCall ( state : BuilderProgramState , sourceFile : SourceFile | undefined ) {
324
- Debug . assert ( ! sourceFile || ! state . affectedFiles || state . affectedFiles [ state . affectedFilesIndex ! - 1 ] !== sourceFile || ! state . semanticDiagnosticsPerFile ! . has ( sourceFile . path ) ) ;
324
+ Debug . assert ( ! sourceFile || ! state . affectedFiles || state . affectedFiles [ state . affectedFilesIndex ! - 1 ] !== sourceFile || ! state . semanticDiagnosticsPerFile ! . has ( sourceFile . resolvedPath ) ) ;
325
325
}
326
326
327
327
/**
@@ -338,7 +338,7 @@ namespace ts {
338
338
let affectedFilesIndex = state . affectedFilesIndex ! ; // TODO: GH#18217
339
339
while ( affectedFilesIndex < affectedFiles . length ) {
340
340
const affectedFile = affectedFiles [ affectedFilesIndex ] ;
341
- if ( ! seenAffectedFiles . has ( affectedFile . path ) ) {
341
+ if ( ! seenAffectedFiles . has ( affectedFile . resolvedPath ) ) {
342
342
// Set the next affected file as seen and remove the cached semantic diagnostics
343
343
state . affectedFilesIndex = affectedFilesIndex ;
344
344
handleDtsMayChangeOfAffectedFile ( state , affectedFile , cancellationToken , computeHash ) ;
@@ -395,8 +395,8 @@ namespace ts {
395
395
for ( let i = state . affectedFilesPendingEmitIndex ! ; i < affectedFilesPendingEmit . length ; i ++ ) {
396
396
const affectedFile = Debug . assertDefined ( state . program ) . getSourceFileByPath ( affectedFilesPendingEmit [ i ] ) ;
397
397
if ( affectedFile ) {
398
- const seenKind = seenEmittedFiles . get ( affectedFile . path ) ;
399
- const emitKind = Debug . assertDefined ( Debug . assertDefined ( state . affectedFilesPendingEmitKind ) . get ( affectedFile . path ) ) ;
398
+ const seenKind = seenEmittedFiles . get ( affectedFile . resolvedPath ) ;
399
+ const emitKind = Debug . assertDefined ( Debug . assertDefined ( state . affectedFilesPendingEmitKind ) . get ( affectedFile . resolvedPath ) ) ;
400
400
if ( seenKind === undefined || seenKind < emitKind ) {
401
401
// emit this file
402
402
state . affectedFilesPendingEmitIndex = i ;
@@ -416,7 +416,7 @@ namespace ts {
416
416
* This is because even though js emit doesnt change, dts emit / type used can change resulting in need for dts emit and js change
417
417
*/
418
418
function handleDtsMayChangeOfAffectedFile ( state : BuilderProgramState , affectedFile : SourceFile , cancellationToken : CancellationToken | undefined , computeHash : BuilderState . ComputeHash ) {
419
- removeSemanticDiagnosticsOf ( state , affectedFile . path ) ;
419
+ removeSemanticDiagnosticsOf ( state , affectedFile . resolvedPath ) ;
420
420
421
421
// If affected files is everything except default library, then nothing more to do
422
422
if ( state . allFilesExcludingDefaultLibraryFile === state . affectedFiles ) {
@@ -427,7 +427,7 @@ namespace ts {
427
427
forEach ( program . getSourceFiles ( ) , f =>
428
428
program . isSourceFileDefaultLibrary ( f ) &&
429
429
! skipTypeChecking ( f , options , program ) &&
430
- removeSemanticDiagnosticsOf ( state , f . path )
430
+ removeSemanticDiagnosticsOf ( state , f . resolvedPath )
431
431
) ;
432
432
}
433
433
return ;
@@ -495,17 +495,17 @@ namespace ts {
495
495
function forEachReferencingModulesOfExportOfAffectedFile ( state : BuilderProgramState , affectedFile : SourceFile , fn : ( state : BuilderProgramState , filePath : Path ) => boolean ) {
496
496
// If there was change in signature (dts output) for the changed file,
497
497
// then only we need to handle pending file emit
498
- if ( ! state . exportedModulesMap || ! state . changedFilesSet . has ( affectedFile . path ) ) {
498
+ if ( ! state . exportedModulesMap || ! state . changedFilesSet . has ( affectedFile . resolvedPath ) ) {
499
499
return ;
500
500
}
501
501
502
- if ( ! isChangedSignagure ( state , affectedFile . path ) ) return ;
502
+ if ( ! isChangedSignagure ( state , affectedFile . resolvedPath ) ) return ;
503
503
504
504
// Since isolated modules dont change js files, files affected by change in signature is itself
505
505
// But we need to cleanup semantic diagnostics and queue dts emit for affected files
506
506
if ( state . compilerOptions . isolatedModules ) {
507
507
const seenFileNamesMap = createMap < true > ( ) ;
508
- seenFileNamesMap . set ( affectedFile . path , true ) ;
508
+ seenFileNamesMap . set ( affectedFile . resolvedPath , true ) ;
509
509
const queue = BuilderState . getReferencedByPaths ( state , affectedFile . resolvedPath ) ;
510
510
while ( queue . length > 0 ) {
511
511
const currentPath = queue . pop ( ) ! ;
@@ -526,7 +526,7 @@ namespace ts {
526
526
// If exported modules has path, all files referencing file exported from are affected
527
527
if ( forEachEntry ( state . currentAffectedFilesExportedModulesMap ! , ( exportedModules , exportedFromPath ) =>
528
528
exportedModules &&
529
- exportedModules . has ( affectedFile . path ) &&
529
+ exportedModules . has ( affectedFile . resolvedPath ) &&
530
530
forEachFilesReferencingPath ( state , exportedFromPath as Path , seenFileAndExportsOfFile , fn )
531
531
) ) {
532
532
return ;
@@ -535,7 +535,7 @@ namespace ts {
535
535
// If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected
536
536
forEachEntry ( state . exportedModulesMap , ( exportedModules , exportedFromPath ) =>
537
537
! state . currentAffectedFilesExportedModulesMap ! . has ( exportedFromPath ) && // If we already iterated this through cache, ignore it
538
- exportedModules . has ( affectedFile . path ) &&
538
+ exportedModules . has ( affectedFile . resolvedPath ) &&
539
539
forEachFilesReferencingPath ( state , exportedFromPath as Path , seenFileAndExportsOfFile , fn )
540
540
) ;
541
541
}
@@ -610,9 +610,9 @@ namespace ts {
610
610
state . programEmitComplete = true ;
611
611
}
612
612
else {
613
- state . seenAffectedFiles ! . set ( ( affected as SourceFile ) . path , true ) ;
613
+ state . seenAffectedFiles ! . set ( ( affected as SourceFile ) . resolvedPath , true ) ;
614
614
if ( emitKind !== undefined ) {
615
- ( state . seenEmittedFiles || ( state . seenEmittedFiles = createMap ( ) ) ) . set ( ( affected as SourceFile ) . path , emitKind ) ;
615
+ ( state . seenEmittedFiles || ( state . seenEmittedFiles = createMap ( ) ) ) . set ( ( affected as SourceFile ) . resolvedPath , emitKind ) ;
616
616
}
617
617
if ( isPendingEmit ) {
618
618
state . affectedFilesPendingEmitIndex ! ++ ;
@@ -662,7 +662,7 @@ namespace ts {
662
662
* Note that it is assumed that when asked about binder and checker diagnostics, the file has been taken out of affected files/changed file set
663
663
*/
664
664
function getBinderAndCheckerDiagnosticsOfFile ( state : BuilderProgramState , sourceFile : SourceFile , cancellationToken ?: CancellationToken ) : readonly Diagnostic [ ] {
665
- const path = sourceFile . path ;
665
+ const path = sourceFile . resolvedPath ;
666
666
if ( state . semanticDiagnosticsPerFile ) {
667
667
const cachedDiagnostics = state . semanticDiagnosticsPerFile . get ( path ) ;
668
668
// Report the bind and check diagnostics from the cache if we already have those diagnostics present
@@ -806,7 +806,7 @@ namespace ts {
806
806
const { file } = diagnostic ;
807
807
return {
808
808
...diagnostic ,
809
- file : file ? relativeToBuildInfo ( file . path ) : undefined
809
+ file : file ? relativeToBuildInfo ( file . resolvedPath ) : undefined
810
810
} ;
811
811
}
812
812
@@ -1032,7 +1032,7 @@ namespace ts {
1032
1032
1033
1033
// Add file to affected file pending emit to handle for later emit time
1034
1034
if ( kind === BuilderProgramKind . EmitAndSemanticDiagnosticsBuilderProgram ) {
1035
- addToAffectedFilesPendingEmit ( state , ( affected as SourceFile ) . path , BuilderFileEmit . Full ) ;
1035
+ addToAffectedFilesPendingEmit ( state , ( affected as SourceFile ) . resolvedPath , BuilderFileEmit . Full ) ;
1036
1036
}
1037
1037
1038
1038
// Get diagnostics for the affected file if its not ignored
0 commit comments