[PATCH] D64855: [clangd] Added highlightings for template parameters and specializations.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 18 01:04:39 PDT 2019


hokein added inline comments.


================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:141
     // visit a TypeLoc where the underlying Type is a CXXRecordDecl).
+    if(isa<ClassTemplateDecl>(D)) {
+      addToken(Loc, HighlightingKind::Class);
----------------
nit: clang-format


================
Comment at: clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp:179
+    R"cpp(
+      template<typename $TemplateParameter[[T]], typename = void>
+      class $Class[[A]] {
----------------
could you add some more test cases?

- for unnamed template parameter, `template <typename> class Foo {};`
- for partial template specialization


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64855





More information about the cfe-commits mailing list