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

Normalize paths when matching problems #77875

Merged
merged 4 commits into from Aug 7, 2019

Conversation

@csk-ableton
Copy link
Contributor

commented Jul 24, 2019

Fixes #77804

@@ -220,6 +220,7 @@ export async function getResource(filename: string, matcher: ProblemMatcher, fil
if (fullPath[0] !== '/') {
fullPath = '/' + fullPath;
}
fullPath = normalize(fullPath);

This comment has been minimized.

Copy link
@diguifi

diguifi Jul 25, 2019

I'm a beginner on vscode's code, could you explain to me how does this line avoids this:

Actual: A new editor is opened containing the relative part of the path. The file history contains a new entry. When using "Go to file", both file locations are offered.

?

This comment has been minimized.

Copy link
@csk-ableton

csk-ableton Jul 25, 2019

Author Contributor

Without this change, two editors will be opened. One for /Users/foo/dev/project/main.cpp and one for /Users/foo/dev/project/output/../main.cpp, even though it refers to the same file. By normalizing it upfront, the seconds path will be identical to the first one.

Ideally, vscode normalizes the paths before opening an editor but that sounded like a bigger change to me.

@alexr00 alexr00 added this to the August 2019 milestone Jul 31, 2019

@alexr00
alexr00 approved these changes Aug 7, 2019
Copy link
Member

left a comment

Nice bug, thank you for the fix!

csk-ableton and others added 2 commits Aug 7, 2019

@alexr00 alexr00 merged commit 3a85597 into microsoft:master Aug 7, 2019

1 of 2 checks passed

VS Code queued
Details
license/cla All CLA requirements met.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.