-
Notifications
You must be signed in to change notification settings - Fork 145
Workaround the drive letter casing issue on windows. #747
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
base: master
Are you sure you want to change the base?
Workaround the drive letter casing issue on windows. #747
Conversation
Bump from es6 to `ES2022` as is recommended in the current vscode extension template.
b25d08d
to
55c6e58
Compare
ef96d20
to
59bfeb1
Compare
Do we know where the lower case letter comes from? I'm a bit worried that this change fixes the symptoms instead of the underlying problem. If that's the case, clangd might know about the same file twice with different casing. I wouldn't be surprised to find out that more issues would popup. |
On our systems, using both Windows with vs code and CMake, it always uses the same casing, which I believe is upper case. |
I don't know the origin but probably cmake? It generates the compile commands after all. Ideally clangd should normalise every path it receives/reads using some library. Then all these issues should go away. I am sure cpp has some sort of normalise function. |
So it works on your system. When the drive letter casing is already uppercase, my code should have no effect. Did this branch cause issues on your systems? |
Any progress here or on the main issue? It's unfortunate that we as devs have to apply our own fixes to make the tooling work. |
May I ask why this PR is not accepted? From these historical discussions:
We can see that:
So we either:
Is my understanding correct? If so, @raldone01 the author of the PR might be right that vscode-clangd is the most easy solution here. |
I think the proper solution is this one:
There is work in progress towards it at llvm/llvm-project#136439. |
Fixes: #726.
Lower case drive letters seem to be the cause of the issues.
Not being able to refactor on windows makes
clangd
borderline unusable.The workaround can be removed once clangd/clangd#108 is fixed.
In the mean time I think this simple workaround should be quite robust and alleviates the pain.
Why I fixed it here:
Working around the
clangd
issue in the vscode extension is much easier than attempting to tame the beast that isclangd
.The impact of the workaround is also very small.
Some things I am uncertain about:
I don't know if
clangd
normalizes paths at all.If it doesn't:
Maybe a setting should be added to decide between upper and lower case drive letter normalization on windows.
I have never observed lower case ones in
compile_commands.json
though.So we should probably wait for complaints 😁 before adding the setting.
Note:
I changed the typescript target because I needed named capture groups.
Maybe it is also time to move on from
commonjs
to"module": "Node16",
.