[PATCH] D69506: [clangd] Add missing highlights for using decls.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 28 09:04:56 PDT 2019


ilya-biryukov accepted this revision.
ilya-biryukov added a comment.
This revision is now accepted and ready to land.

LGTM. See the NITs, though



================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:51
   }
+  if (auto *USD = dyn_cast<UsingShadowDecl>(D))
+    return kindForDecl(USD->getTargetDecl());
----------------
Maybe put this at the first line? This looks like a very good first step.


================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:52
+  if (auto *USD = dyn_cast<UsingShadowDecl>(D))
+    return kindForDecl(USD->getTargetDecl());
+
----------------
Maybe do `D = USD->getTargetDecl()` instead?
This would align with how we handle templates in this function and avoid recursive calls (which always look a bit suspicious, e.g. require more thought to ensure the function does not recurse indefinitely)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69506





More information about the cfe-commits mailing list