File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -910,7 +910,7 @@ namespace ts {
910910 return ;
911911 }
912912
913- const sourcePathComponents = getNormalizedPathComponents ( getCanonicalFileName ( sourceFile . fileName ) , currentDirectory ) ;
913+ const sourcePathComponents = getNormalizedPathComponents ( sourceFile . fileName , currentDirectory ) ;
914914 sourcePathComponents . pop ( ) ; // The base file name is not part of the common directory path
915915
916916 if ( ! commonPathComponents ) {
@@ -919,8 +919,9 @@ namespace ts {
919919 return ;
920920 }
921921
922+ const caseSensitive = host . useCaseSensitiveFileNames ( ) ;
922923 for ( let i = 0 , n = Math . min ( commonPathComponents . length , sourcePathComponents . length ) ; i < n ; i ++ ) {
923- if ( commonPathComponents [ i ] !== sourcePathComponents [ i ] ) {
924+ if ( caseSensitive ? commonPathComponents [ i ] !== sourcePathComponents [ i ] : commonPathComponents [ i ] . toLocaleLowerCase ( ) !== sourcePathComponents [ i ] . toLocaleLowerCase ( ) ) {
924925 if ( i === 0 ) {
925926 // Failed to find any common path component
926927 return true ;
@@ -947,9 +948,7 @@ namespace ts {
947948 return currentDirectory ;
948949 }
949950
950- const path = getNormalizedPathFromPathComponents ( commonPathComponents ) ;
951- const relativePath = convertToRelativePath ( path , currentDirectory , getCanonicalFileName ) ;
952- return relativePath ;
951+ return getNormalizedPathFromPathComponents ( commonPathComponents ) ;
953952 }
954953
955954 function checkSourceFilesBelongToPath ( sourceFiles : SourceFile [ ] , rootDirectory : string ) : boolean {
You can’t perform that action at this time.
0 commit comments