[PATCH] D63559: [clangd] Added functionality for getting semantic highlights for variable and function declarations

Johan Vikström via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 25 02:43:07 PDT 2019


jvikstrom added inline comments.


================
Comment at: clang-tools-extra/clangd/unittests/SemanticHighlightTests.cpp:57
+
+  checkTokensExists(Tokens, Variables, SemanticHighlightKind::Variable);
+  checkTokensExists(Tokens, Function, SemanticHighlightKind::Function);
----------------
hokein wrote:
> 
> ```
> checkHighlights(R"cpp(void $Function[[Foo]]))cpp");
> 
> checkHighlights(...) {
>    ...
>    ExpectedTokens = annotation.ranges(toString(SemanticHighlightKind::Variable));
>    ExpectedTokens = annotation.ranges(toString(SemanticHighlightKind::Function));
>    EXPECT_THAT(ExpectedTokens, UnorderedElementsAreArray(ActualTokens));
> }
Had to add some extra logic to merge the different token types


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63559





More information about the cfe-commits mailing list