Skip to content

Commit a1cf51f

Browse files
committed
use canonical filename function
1 parent 97d170b commit a1cf51f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/compiler/program.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ namespace ts {
894894
return;
895895
}
896896

897-
const sourcePathComponents = getNormalizedPathComponents(sourceFile.fileName, currentDirectory);
897+
const sourcePathComponents = getNormalizedPathComponents(getCanonicalFileName(sourceFile.fileName), currentDirectory);
898898
sourcePathComponents.pop(); // The base file name is not part of the common directory path
899899

900900
if (!commonPathComponents) {
@@ -903,9 +903,8 @@ namespace ts {
903903
return;
904904
}
905905

906-
const caseSensitive = host.useCaseSensitiveFileNames();
907906
for (let i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) {
908-
if (caseSensitive ? commonPathComponents[i] !== sourcePathComponents[i] : commonPathComponents[i].toLocaleLowerCase() !== sourcePathComponents[i].toLocaleLowerCase()) {
907+
if (commonPathComponents[i] !== sourcePathComponents[i]) {
909908
if (i === 0) {
910909
// Failed to find any common path component
911910
return true;

0 commit comments

Comments
 (0)