[clangd] Oops, switchSourceHeader still needs to return a URI.

Reviewers: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D61630

llvm-svn: 360121
This commit is contained in:
Sam McCall 2019-05-07 08:30:32 +00:00
parent bcaee49d00
commit b9ec3e9370
2 changed files with 3 additions and 3 deletions

View File

@ -825,9 +825,9 @@ void ClangdLSPServer::onGoToDeclaration(
void ClangdLSPServer::onSwitchSourceHeader(
const TextDocumentIdentifier &Params,
Callback<llvm::Optional<std::string>> Reply) {
Callback<llvm::Optional<URIForFile>> Reply) {
if (auto Result = Server->switchSourceHeader(Params.uri.file()))
Reply(URI::resolvePath(*Result, Params.uri.file()));
Reply(URIForFile::canonicalize(*Result, Params.uri.file()));
else
Reply(llvm::None);
}

View File

@ -85,7 +85,7 @@ private:
Callback<std::vector<Location>>);
void onReference(const ReferenceParams &, Callback<std::vector<Location>>);
void onSwitchSourceHeader(const TextDocumentIdentifier &,
Callback<llvm::Optional<std::string>>);
Callback<llvm::Optional<URIForFile>>);
void onDocumentHighlight(const TextDocumentPositionParams &,
Callback<std::vector<DocumentHighlight>>);
void onFileEvent(const DidChangeWatchedFilesParams &);