Author: Sam McCall Date: 2019-11-15T17:34:22+01:00 New Revision: c9081968ead183ee1df824f7b96fcafcfcbe57cd
URL: https://github.com/llvm/llvm-project/commit/c9081968ead183ee1df824f7b96fcafcfcbe57cd DIFF: https://github.com/llvm/llvm-project/commit/c9081968ead183ee1df824f7b96fcafcfcbe57cd.diff LOG: [clangd] Fix typo in symbol kind conversion Reviewers: hokein Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70309 Added: Modified: clang-tools-extra/clangd/Protocol.cpp clang-tools-extra/clangd/unittests/FindSymbolsTests.cpp clang-tools-extra/clangd/unittests/XRefsTests.cpp Removed: ################################################################################ diff --git a/clang-tools-extra/clangd/Protocol.cpp b/clang-tools-extra/clangd/Protocol.cpp index 9b0fbc5b2f3f..bdf284dc502f 100644 --- a/clang-tools-extra/clangd/Protocol.cpp +++ b/clang-tools-extra/clangd/Protocol.cpp @@ -257,7 +257,7 @@ SymbolKind indexSymbolKindToSymbolKind(index::SymbolKind Kind) { return SymbolKind::Property; case index::SymbolKind::Constructor: case index::SymbolKind::Destructor: - return SymbolKind::Method; + return SymbolKind::Constructor; case index::SymbolKind::ConversionFunction: return SymbolKind::Function; case index::SymbolKind::Parameter: diff --git a/clang-tools-extra/clangd/unittests/FindSymbolsTests.cpp b/clang-tools-extra/clangd/unittests/FindSymbolsTests.cpp index 8d4633626340..8eebb190edae 100644 --- a/clang-tools-extra/clangd/unittests/FindSymbolsTests.cpp +++ b/clang-tools-extra/clangd/unittests/FindSymbolsTests.cpp @@ -390,16 +390,16 @@ TEST_F(DocumentSymbolsTest, BasicSymbols) { ElementsAreArray( {AllOf(WithName("Foo"), WithKind(SymbolKind::Class), Children()), AllOf(WithName("Foo"), WithKind(SymbolKind::Class), - Children(AllOf(WithName("Foo"), WithKind(SymbolKind::Method), - Children()), - AllOf(WithName("Foo"), WithKind(SymbolKind::Method), - Children()), + Children(AllOf(WithName("Foo"), + WithKind(SymbolKind::Constructor), Children()), + AllOf(WithName("Foo"), + WithKind(SymbolKind::Constructor), Children()), AllOf(WithName("f"), WithKind(SymbolKind::Method), Children()), AllOf(WithName("operator="), WithKind(SymbolKind::Method), Children()), - AllOf(WithName("~Foo"), WithKind(SymbolKind::Method), - Children()), + AllOf(WithName("~Foo"), + WithKind(SymbolKind::Constructor), Children()), AllOf(WithName("Nested"), WithKind(SymbolKind::Class), Children(AllOf(WithName("f"), WithKind(SymbolKind::Method), diff --git a/clang-tools-extra/clangd/unittests/XRefsTests.cpp b/clang-tools-extra/clangd/unittests/XRefsTests.cpp index e896096b7ef4..15f94e986770 100644 --- a/clang-tools-extra/clangd/unittests/XRefsTests.cpp +++ b/clang-tools-extra/clangd/unittests/XRefsTests.cpp @@ -917,7 +917,7 @@ void foo())cpp"; HI.NamespaceScope = ""; HI.Name = "X"; HI.LocalScope = "X::"; // FIXME: Should be X<T *>:: - HI.Kind = SymbolKind::Method; // FIXME: Should be Constructor + HI.Kind = SymbolKind::Constructor; HI.Type = "void ()"; // FIXME: Should be None HI.ReturnType = "void"; // FIXME: Should be None or X<T*> HI.Definition = "X<type - parameter - 0 - 0 *>()"; // FIXME: --> X() _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits