Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

Fix path normalizations with correct case for all directories. #886

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

phogy
Copy link

@phogy phogy commented Feb 4, 2020

When using cquery inside VS Code I often got files "out of workspace" even though they are in it. This has unwanted effects like creating file save conflicts and breakpoints are incorrectly associated with their "out of workspace" counter part.
Now, GetLongPathName is used to ensure all directory names are transformed into their correct case (as stated by the comments). However, it seems like path elements already in the long format are kept as-is by the Windows API. Or at least there is something not working as intended with the call to GetLongPathName.
So, as it seems, by first transforming the path into its "short" 8.3 representation, I am able to force a subsequent call to GetLongPathName to transform all path elements into the correct case.
This in turn means the internal path matching in VS Code still identifies paths within the workspace to be correctly relative to the workspace root.

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

Successfully merging this pull request may close these issues.

None yet

1 participant