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

liu hui via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 8 05:31:53 PST 2019


lh123 marked 2 inline comments as done.
lh123 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);
   }
----------------
ilya-biryukov wrote:
> 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.
Yes, you are right, I will refactor it.


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

https://reviews.llvm.org/D69996





More information about the cfe-commits mailing list