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 {
583583 }
584584
585585 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 ) ;
587588 }
588589
589590 function compareGeneratedPositions ( left : MappedPosition , right : MappedPosition ) {
Original file line number Diff line number Diff line change @@ -2604,7 +2604,7 @@ namespace ts.server {
26042604
26052605 /** @internal */
26062606 fileExists ( fileName : NormalizedPath ) : boolean {
2607- return this . filenameToScriptInfo . has ( fileName ) || this . host . fileExists ( fileName ) ;
2607+ return ! ! this . getScriptInfoForNormalizedPath ( fileName ) || this . host . fileExists ( fileName ) ;
26082608 }
26092609
26102610 private findExternalProjectContainingOpenScriptInfo ( info : ScriptInfo ) : ExternalProject | undefined {
Original file line number Diff line number Diff line change @@ -759,7 +759,10 @@ namespace ts.server {
759759 }
760760
761761 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 ;
763766 }
764767
765768 containsFile ( filename : NormalizedPath , requireOpen ?: boolean ) : boolean {
You can’t perform that action at this time.
0 commit comments