[PATCH] D48290: [clangd] Use workspace root path as hint path for resolving URIs in workspace/symbol

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 19 02:28:32 PDT 2018


sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: unittests/clangd/TestFS.cpp:93
     return URI(Scheme, /*Authority=*/"",
-               llvm::sys::path::convert_to_slash(Body));
+               StringRef(llvm::sys::path::convert_to_slash(Body)).ltrim('/'));
   }
----------------
ioeric wrote:
> sammccall wrote:
> > why this change?
> The `consume_front` above would not consume the second slash in `/clangd-test/x.h` which results in "/x.h" in the body, but that doesn't work with `testPath()` which requires a relative path. That's why I added a requirement that the body should be relative path.
can we switch back to that path being represented by `unittest:/x.h` rather than `unittest:x.h`? 
That looks more like the URI schemes we use in practice.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D48290





More information about the cfe-commits mailing list