mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 16:56:35 +00:00
[clangd] Prefer definitions for gototype and implementation
Differential Revision: https://reviews.llvm.org/D133843
This commit is contained in:
parent
be62041e7e
commit
0a093f62d1
@ -1451,7 +1451,7 @@ void ClangdLSPServer::onGoToType(const TextDocumentPositionParams &Params,
|
||||
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 @@ void ClangdLSPServer::onGoToImplementation(
|
||||
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));
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user