cquery icon indicating copy to clipboard operation
cquery copied to clipboard

Fix path normalizations with correct case for all directories.

Open phogy opened this issue 4 years ago • 0 comments

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.

phogy avatar Feb 04 '20 21:02 phogy