[clang][Index] Introduce a TemplateParm SymbolKind
Summary:
Currently template parameters has symbolkind `Unknown`. This patch
introduces a new kind `TemplateParm` for templatetemplate, templatetype and
nontypetemplate parameters.
Also adds tests in clangd hover feature.
Reviewers: sammccall
Subscribers: kristof.beyls, ilya-biryukov, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73696
diff --git a/clang/unittests/Index/IndexTests.cpp b/clang/unittests/Index/IndexTests.cpp
index a279f48..068b30e 100644
--- a/clang/unittests/Index/IndexTests.cpp
+++ b/clang/unittests/Index/IndexTests.cpp
@@ -249,8 +249,13 @@
Index->Symbols.clear();
tooling::runToolOnCode(std::make_unique<IndexAction>(Index, Opts), Code);
EXPECT_THAT(Index->Symbols,
- AllOf(Contains(QName("Foo::T")), Contains(QName("Foo::I")),
- Contains(QName("Foo::C")), Contains(QName("Foo::NoRef"))));
+ AllOf(Contains(AllOf(QName("Foo::T"),
+ Kind(SymbolKind::TemplateTypeParm))),
+ Contains(AllOf(QName("Foo::I"),
+ Kind(SymbolKind::NonTypeTemplateParm))),
+ Contains(AllOf(QName("Foo::C"),
+ Kind(SymbolKind::TemplateTemplateParm))),
+ Contains(QName("Foo::NoRef"))));
}
TEST(IndexTest, UsingDecls) {