[PATCH] D42640: [clangd] collect symbol #include & insert #include in global code completion.
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 16 01:46:34 PST 2018
sammccall added inline comments.
================
Comment at: unittests/clangd/HeadersTests.cpp:29
+ // absolute path.
+ std::string addToSubdir(PathRef File, llvm::StringRef Code = "") {
+ assert(llvm::sys::path::is_relative(File) && "FileName should be relative");
----------------
sammccall wrote:
> This test would be clearer to me if you removed this helper and just did
>
> ```FS.Files["sub/bar.h"] = ...```
>
> in the test.
>
> Can we change `buildTestFS` in `TestFS.cpp` to call `getVirtualTestFilePath` on relative paths to allow this?
>
> (I can do this as a followup if you like, but it seems like a trivial change)
I thought better of that change to TestFS, but did some renames in r325326.
So this would be `FS.Files[testPath("sub/bar.h")) = ...` which still seems more transparent - up to you.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D42640
More information about the cfe-commits
mailing list