use canonical filename function

This commit is contained in:
Wesley Wigham 2015-11-10 13:25:09 -08:00
parent 97d170b388
commit a1cf51faac

View File

@ -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;