This revision was automatically updated to reflect the committed changes. Closed by commit rL349750: [clangd] Don't miss the expected type in merge. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits.
Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55918/new/ https://reviews.llvm.org/D55918 Files: clang-tools-extra/trunk/clangd/index/Merge.cpp clang-tools-extra/trunk/unittests/clangd/IndexTests.cpp Index: clang-tools-extra/trunk/unittests/clangd/IndexTests.cpp =================================================================== --- clang-tools-extra/trunk/unittests/clangd/IndexTests.cpp +++ clang-tools-extra/trunk/unittests/clangd/IndexTests.cpp @@ -219,6 +219,7 @@ R.Documentation = "--doc--"; L.Origin = SymbolOrigin::Dynamic; R.Origin = SymbolOrigin::Static; + R.Type = "expectedType"; Symbol M = mergeSymbol(L, R); EXPECT_EQ(M.Name, "Foo"); @@ -227,6 +228,7 @@ EXPECT_EQ(M.Signature, "()"); EXPECT_EQ(M.CompletionSnippetSuffix, "{$1:0}"); EXPECT_EQ(M.Documentation, "--doc--"); + EXPECT_EQ(M.Type, "expectedType"); EXPECT_EQ(M.Origin, SymbolOrigin::Dynamic | SymbolOrigin::Static | SymbolOrigin::Merge); } Index: clang-tools-extra/trunk/clangd/index/Merge.cpp =================================================================== --- clang-tools-extra/trunk/clangd/index/Merge.cpp +++ clang-tools-extra/trunk/clangd/index/Merge.cpp @@ -134,6 +134,8 @@ S.Documentation = O.Documentation; if (S.ReturnType == "") S.ReturnType = O.ReturnType; + if (S.Type == "") + S.Type = O.Type; for (const auto &OI : O.IncludeHeaders) { bool Found = false; for (auto &SI : S.IncludeHeaders) {
Index: clang-tools-extra/trunk/unittests/clangd/IndexTests.cpp =================================================================== --- clang-tools-extra/trunk/unittests/clangd/IndexTests.cpp +++ clang-tools-extra/trunk/unittests/clangd/IndexTests.cpp @@ -219,6 +219,7 @@ R.Documentation = "--doc--"; L.Origin = SymbolOrigin::Dynamic; R.Origin = SymbolOrigin::Static; + R.Type = "expectedType"; Symbol M = mergeSymbol(L, R); EXPECT_EQ(M.Name, "Foo"); @@ -227,6 +228,7 @@ EXPECT_EQ(M.Signature, "()"); EXPECT_EQ(M.CompletionSnippetSuffix, "{$1:0}"); EXPECT_EQ(M.Documentation, "--doc--"); + EXPECT_EQ(M.Type, "expectedType"); EXPECT_EQ(M.Origin, SymbolOrigin::Dynamic | SymbolOrigin::Static | SymbolOrigin::Merge); } Index: clang-tools-extra/trunk/clangd/index/Merge.cpp =================================================================== --- clang-tools-extra/trunk/clangd/index/Merge.cpp +++ clang-tools-extra/trunk/clangd/index/Merge.cpp @@ -134,6 +134,8 @@ S.Documentation = O.Documentation; if (S.ReturnType == "") S.ReturnType = O.ReturnType; + if (S.Type == "") + S.Type = O.Type; for (const auto &OI : O.IncludeHeaders) { bool Found = false; for (auto &SI : S.IncludeHeaders) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits