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

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 7 01:15:18 PDT 2019


sammccall created this revision.
sammccall added a reviewer: kadircet.
Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay, ilya-biryukov.
Herald added a project: clang.

Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D61630

Files:
  clangd/ClangdLSPServer.cpp
  clangd/ClangdLSPServer.h


Index: clangd/ClangdLSPServer.h
===================================================================
--- clangd/ClangdLSPServer.h
+++ clangd/ClangdLSPServer.h
@@ -85,7 +85,7 @@
                         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 &);
Index: clangd/ClangdLSPServer.cpp
===================================================================
--- clangd/ClangdLSPServer.cpp
+++ clangd/ClangdLSPServer.cpp
@@ -825,9 +825,9 @@
 
 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);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61630.198407.patch
Type: text/x-patch
Size: 1309 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190507/fc28674b/attachment-0001.bin>


More information about the cfe-commits mailing list