File tree Expand file tree Collapse file tree 4 files changed +192
-123
lines changed Expand file tree Collapse file tree 4 files changed +192
-123
lines changed Original file line number Diff line number Diff line change @@ -583,7 +583,8 @@ namespace ts {
583
583
}
584
584
585
585
function compareSourcePositions ( left : SourceMappedPosition , right : SourceMappedPosition ) {
586
- return compareValues ( left . sourceIndex , right . sourceIndex ) ;
586
+ Debug . assert ( left . sourceIndex === right . sourceIndex ) ;
587
+ return compareValues ( left . sourcePosition , right . sourcePosition ) ;
587
588
}
588
589
589
590
function compareGeneratedPositions ( left : MappedPosition , right : MappedPosition ) {
Original file line number Diff line number Diff line change @@ -2604,7 +2604,7 @@ namespace ts.server {
2604
2604
2605
2605
/** @internal */
2606
2606
fileExists ( fileName : NormalizedPath ) : boolean {
2607
- return this . filenameToScriptInfo . has ( fileName ) || this . host . fileExists ( fileName ) ;
2607
+ return ! ! this . getScriptInfoForNormalizedPath ( fileName ) || this . host . fileExists ( fileName ) ;
2608
2608
}
2609
2609
2610
2610
private findExternalProjectContainingOpenScriptInfo ( info : ScriptInfo ) : ExternalProject | undefined {
Original file line number Diff line number Diff line change @@ -759,7 +759,10 @@ namespace ts.server {
759
759
}
760
760
761
761
containsScriptInfo ( info : ScriptInfo ) : boolean {
762
- return this . isRoot ( info ) || ( ! ! this . program && this . program . getSourceFileByPath ( info . path ) !== undefined ) ;
762
+ if ( this . isRoot ( info ) ) return true ;
763
+ if ( ! this . program ) return false ;
764
+ const file = this . program . getSourceFileByPath ( info . path ) ;
765
+ return ! ! file && file . resolvedPath === info . path ;
763
766
}
764
767
765
768
containsFile ( filename : NormalizedPath , requireOpen ?: boolean ) : boolean {
You can’t perform that action at this time.
0 commit comments