[PATCH] D66828: [clangd] Add distinct highlightings for static fields and methods

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 28 02:00:23 PDT 2019


hokein accepted this revision.
hokein added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:208
     }
-    if (isa<CXXMethodDecl>(D)) {
-      addToken(Loc, HighlightingKind::Method);
+    if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(D)) {
+      addToken(Loc, MD->isStatic() ? HighlightingKind::StaticMethod
----------------
nit: just use auto, the type is obvious from RHS


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66828





More information about the cfe-commits mailing list