[clang-tools-extra] r360121 - [clangd] Oops, switchSourceHeader still needs to return a URI.

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Tue May 7 01:30:32 PDT 2019


Author: sammccall
Date: Tue May  7 01:30:32 2019
New Revision: 360121

URL: http://llvm.org/viewvc/llvm-project?rev=360121&view=rev
Log:
[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

Modified:
    clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp
    clang-tools-extra/trunk/clangd/ClangdLSPServer.h

Modified: clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp?rev=360121&r1=360120&r2=360121&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp (original)
+++ clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp Tue May  7 01:30:32 2019
@@ -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);
 }

Modified: clang-tools-extra/trunk/clangd/ClangdLSPServer.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/ClangdLSPServer.h?rev=360121&r1=360120&r2=360121&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/ClangdLSPServer.h (original)
+++ clang-tools-extra/trunk/clangd/ClangdLSPServer.h Tue May  7 01:30:32 2019
@@ -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 &);




More information about the cfe-commits mailing list