vscode always escapes the colon on the file uri, which causes the semantic highlighting fails on windows.
Details
Diff Detail
Event Timeline
clang-tools-extra/clangd/clients/clangd-vscode/src/semantic-highlighting.ts | ||
---|---|---|
128 ↗ | (On Diff #228405) | Could we accept a URI in the highlight (and similar function in highlighting) instead and compare the URIs instead of strings in the Highlighter.applyHighlightings? i.e. in code: fileUri : string; if (e.document.uri.toString() !== fileUri) return; Could instead be: fileUri : Uri; if (e.document.uri.toString() !== fileUri.toString()) return; This should normalize accordingly and is generally safer and more readable than passing around strings. |
clang-tools-extra/clangd/clients/clangd-vscode/src/semantic-highlighting.ts | ||
---|---|---|
128 ↗ | (On Diff #228405) | Yes, you are right, I will refactor it. |
LGTM, thanks!
Should I land this patch for you?
If you don't have commit access yet, you could consider applying to get one.
Thanks for your reminder, I have sent an email to apply for commit access, but I don't know how long it will take.
Should I land this patch for you?
Yes, you can land this patch.
Sorry for the delay, forgot to submit on Friday.
Also updated package-lock.json before submitting.
I believe this patch fixes the issue, but we need to update the file test/semantic-highlighting.test.ts), the test "Colorizer groups decorations correctly" is diverged from the actual code, although it is still passed (both string and vscode.Uri have the toString method unfortunately).
@lh123 do you mind doing that?