This revision was automatically updated to reflect the committed changes. Closed by commit rG0a093f62d154: [clangd] Prefer definitions for gototype and implementation (authored by kadircet).
Changed prior to commit: https://reviews.llvm.org/D133843?vs=460003&id=542874#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133843/new/ https://reviews.llvm.org/D133843 Files: clang-tools-extra/clangd/ClangdLSPServer.cpp Index: clang-tools-extra/clangd/ClangdLSPServer.cpp =================================================================== --- clang-tools-extra/clangd/ClangdLSPServer.cpp +++ clang-tools-extra/clangd/ClangdLSPServer.cpp @@ -1451,7 +1451,7 @@ return Reply(Types.takeError()); std::vector<Location> Response; for (const LocatedSymbol &Sym : *Types) - Response.push_back(Sym.PreferredDeclaration); + Response.push_back(Sym.Definition.value_or(Sym.PreferredDeclaration)); return Reply(std::move(Response)); }); } @@ -1467,7 +1467,7 @@ return Reply(Overrides.takeError()); std::vector<Location> Impls; for (const LocatedSymbol &Sym : *Overrides) - Impls.push_back(Sym.PreferredDeclaration); + Impls.push_back(Sym.Definition.value_or(Sym.PreferredDeclaration)); return Reply(std::move(Impls)); }); }
Index: clang-tools-extra/clangd/ClangdLSPServer.cpp =================================================================== --- clang-tools-extra/clangd/ClangdLSPServer.cpp +++ clang-tools-extra/clangd/ClangdLSPServer.cpp @@ -1451,7 +1451,7 @@ return Reply(Types.takeError()); std::vector<Location> Response; for (const LocatedSymbol &Sym : *Types) - Response.push_back(Sym.PreferredDeclaration); + Response.push_back(Sym.Definition.value_or(Sym.PreferredDeclaration)); return Reply(std::move(Response)); }); } @@ -1467,7 +1467,7 @@ return Reply(Overrides.takeError()); std::vector<Location> Impls; for (const LocatedSymbol &Sym : *Overrides) - Impls.push_back(Sym.PreferredDeclaration); + Impls.push_back(Sym.Definition.value_or(Sym.PreferredDeclaration)); return Reply(std::move(Impls)); }); }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits