Skip to content

Commit ecd4435

Browse files
committed
Go all the way back to the original solution
1 parent 52fbf9e commit ecd4435

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/compiler/program.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)