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

Don't canonicalize file case in source maps #541

Merged
merged 6 commits into from
Jan 4, 2019
Merged

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented Dec 10, 2018

Closes #540

@nex3
Copy link
Contributor Author

nex3 commented Dec 10, 2018

Adding tests first, without implementation, to verify that they fail on Windows and thus that the fix actually does something.

@nex3 nex3 force-pushed the dont-canonicalize-case branch 2 times, most recently from 6ac1cb6 to 514b263 Compare December 11, 2018 08:17
Copy link
Contributor

@nshahan nshahan left a comment

Choose a reason for hiding this comment

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

LGTM with one comment.

@@ -27,7 +27,9 @@ class FilesystemImporter extends Importer {
ImporterResult load(Uri url) {
var path = p.fromUri(url);
return ImporterResult(io.readFile(path),
sourceMapUrl: url, syntax: Syntax.forPath(path));
sourceMapUrl:
io.couldBeCaseInsensitive ? p.toUri(io.realCasePath(path)) : url,
Copy link
Contributor

Choose a reason for hiding this comment

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

Could omit this check here since realCasePath() makes a point to do the right thing. I guess this avoids converting to back to a uri from a string but it feels awkward.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, efficiency is the goal here. URI parsing is probably dwarfed by file IO, but this importer is on a fairly hot path and little things can add up. I'll add a comment explaining why we're doing this.

@nex3 nex3 merged commit 7a75b7b into master Jan 4, 2019
@nex3 nex3 deleted the dont-canonicalize-case branch January 4, 2019 19:17
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.

None yet

2 participants