[PATCH] D64293: [clangd] Don't insert absolute paths, give up instead.

Sam McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 8 11:11:56 PDT 2019


sammccall marked 2 inline comments as done.
sammccall added inline comments.


================
Comment at: clang-tools-extra/clangd/Headers.cpp:206
+    SmallString<256> RelFile(InsertedHeader.File);
+    llvm::sys::path::replace_path_prefix(RelFile, IncludingDir, "./");
+    Suggested = llvm::sys::path::convert_to_slash(
----------------
kadircet wrote:
> why not directly replace with `""`?
Because replace_path_prefix("/foo/bar.c", "/foo", "") yields "/bar.c" rather than "bar.c". Added a comment.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64293/new/

https://reviews.llvm.org/D64293





More information about the llvm-commits mailing list