mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 02:33:53 -06:00
use canonical filename function
This commit is contained in:
parent
97d170b388
commit
a1cf51faac
@ -894,7 +894,7 @@ namespace ts {
|
||||
return;
|
||||
}
|
||||
|
||||
const sourcePathComponents = getNormalizedPathComponents(sourceFile.fileName, currentDirectory);
|
||||
const sourcePathComponents = getNormalizedPathComponents(getCanonicalFileName(sourceFile.fileName), currentDirectory);
|
||||
sourcePathComponents.pop(); // The base file name is not part of the common directory path
|
||||
|
||||
if (!commonPathComponents) {
|
||||
@ -903,9 +903,8 @@ namespace ts {
|
||||
return;
|
||||
}
|
||||
|
||||
const caseSensitive = host.useCaseSensitiveFileNames();
|
||||
for (let i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) {
|
||||
if (caseSensitive ? commonPathComponents[i] !== sourcePathComponents[i] : commonPathComponents[i].toLocaleLowerCase() !== sourcePathComponents[i].toLocaleLowerCase()) {
|
||||
if (commonPathComponents[i] !== sourcePathComponents[i]) {
|
||||
if (i === 0) {
|
||||
// Failed to find any common path component
|
||||
return true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user