[PATCH] D64475: [clangd] Duplicate lines of semantic highlightings sent removed.

Johan Vikström via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 17 03:11:54 PDT 2019


jvikstrom added inline comments.


================
Comment at: clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp:281
+      )cpp"}},
+                {{5},
+                 {
----------------
hokein wrote:
> so the empty lines are stored separately, which is not easy to figure out from the testing code snippet. I think we should make the empty lines more obvious in the code snippet (maybe use an `Empty` annotations?) , and explicitly verify the empty lines.
> 
> What do you think refining the test like below, just annotate the diff tokens? I find it is easy to spot the diff tokens.
> 
> ```
> struct Testcase {
>    Code Before;
>    Code After;
> };
> 
> std::vector<TestCase> cases = {
>    { 
>        R"cpp(
>              int a;
>              int b; 
>              int c;
>       )cpp",
>       R"cpp(
>             int a;
>             $Empty[[]] // int b
>             int $Variable[[C]];
>       )cpp"
>   }
> }
> 
> oldHighlightings = getSemanticHighlightings(OldAST);
> newHighlightings = getSemanticHighlightings(NewAST);
> diffHighlightings = diff...;
> // verify the diffHighlightings has the expected empty lines ("Empty" annotations).
> // verify the diffHighlightings has the expected highlightings (the regular annotations);
> ```
> 
Moved everything into the checkDiffedHighlights as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64475





More information about the cfe-commits mailing list