Author: ibiryukov Date: Wed May 29 10:49:30 2019 New Revision: 361996 URL: http://llvm.org/viewvc/llvm-project?rev=361996&view=rev Log: [Index] Compute correct symbol kind for variable templates
Summary: The index library itself seems to never pass variable templates as input, however clangd does. Reviewers: kadircet Reviewed By: kadircet Subscribers: jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62579 Modified: clang-tools-extra/trunk/clangd/unittests/CodeCompleteTests.cpp Modified: clang-tools-extra/trunk/clangd/unittests/CodeCompleteTests.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/CodeCompleteTests.cpp?rev=361996&r1=361995&r2=361996&view=diff ============================================================================== --- clang-tools-extra/trunk/clangd/unittests/CodeCompleteTests.cpp (original) +++ clang-tools-extra/trunk/clangd/unittests/CodeCompleteTests.cpp Wed May 29 10:49:30 2019 @@ -463,6 +463,31 @@ TEST(CompletionTest, Kinds) { EXPECT_THAT( Results.Completions, UnorderedElementsAre(AllOf(Named("a"), Kind(CompletionItemKind::Field)))); + + // Completion kinds for templates should not be unknown. + Results = completions( + R"cpp( + template <class T> struct complete_class {}; + template <class T> void complete_function(); + template <class T> using complete_type_alias = int; + template <class T> int complete_variable = 10; + + struct X { + template <class T> static int complete_static_member = 10; + + static auto x = complete_^ + } + )cpp"); + EXPECT_THAT( + Results.Completions, + UnorderedElementsAre( + AllOf(Named("complete_class"), Kind(CompletionItemKind::Class)), + AllOf(Named("complete_function"), Kind(CompletionItemKind::Function)), + AllOf(Named("complete_type_alias"), + Kind(CompletionItemKind::Interface)), + AllOf(Named("complete_variable"), Kind(CompletionItemKind::Variable)), + AllOf(Named("complete_static_member"), + Kind(CompletionItemKind::Property)))); } TEST(CompletionTest, NoDuplicates) { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits