[PATCH] D64624: [clangd] Added highlighting to enum constants.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 12 03:07:31 PDT 2019


hokein added a comment.

mostly good.



================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:122
     }
+    if(isa<EnumConstantDecl>(D)) {
+      addToken(Loc, HighlightingKind::EnumConstant);
----------------
nit: clang-format.


================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:257
+  case HighlightingKind::EnumConstant:
+    return "constant.other.enum.cpp";
   case HighlightingKind::Namespace:
----------------
could you check the tm scope on vscode? They seem to use `variable.other.enummember`.


================
Comment at: clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp:107
     R"cpp(
       enum class $Enum[[E]] {};
       enum $Enum[[EE]] {};
----------------
since we have a dedicated testcase for `enum`, could you extend the testcase here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64624





More information about the cfe-commits mailing list