[PATCH] D69996: [clangd] Fixed colon escaping on Windows

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 8 04:35:04 PST 2019


ilya-biryukov added inline comments.


================
Comment at: clang-tools-extra/clangd/clients/clangd-vscode/src/semantic-highlighting.ts:128
+    this.highlighter.highlight(
+        vscode.Uri.parse(params.textDocument.uri).toString(), lines);
   }
----------------
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.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69996/new/

https://reviews.llvm.org/D69996





More information about the cfe-commits mailing list