Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore drive letters when comparing casings of the files with forceConsistentCasingInFileNames #31503

Merged
merged 1 commit into from May 22, 2019

Conversation

sheetalkamat
Copy link
Member

Fixes #31327


function getPathWithoutRoot(pathComponents: ReadonlyArray<string>) {
if (pathComponents.length === 0) return "";
return pathComponents.slice(1).join(directorySeparator);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So pathComponents[0] is always / on *nix systems, and e.g. C:/ on Windows, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@sheetalkamat sheetalkamat merged commit 1e7a77c into master May 22, 2019
@sheetalkamat sheetalkamat deleted the casing branch May 22, 2019 16:25
Copy link
Contributor

@mihailik mihailik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a bug?

@@ -2232,7 +2232,10 @@ namespace ts {
if (isRedirect) {
inputName = getProjectReferenceRedirect(fileName) || fileName;
}
if (getNormalizedAbsolutePath(checkedName, currentDirectory) !== getNormalizedAbsolutePath(inputName, currentDirectory)) {
// Check if it differs only in drive letters its ok to ignore that error:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it??

C:\file is indeed the same as c:\file — but it is most definitely NOT the same as D:\file.

Looking at the use below the code will wrongly assume C:\file match D:\file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's guaranteed to be match because the file was found by its name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

forceConsistentCasingInFileNames shouldn't compare drive letters
3 participants