[PATCH] D79456: [clangd] Complete filenames after < / ".
Adam Czachorowski via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed May 6 04:48:19 PDT 2020
adamcz added inline comments.
================
Comment at: clang-tools-extra/clangd/CodeComplete.cpp:1922
+ Line.consume_front("include") || Line.consume_front("import") ||
+ Line.consume_front("import_next");
+ Line = Line.ltrim();
----------------
Did you mean include_next?
Also, this will never trigger, because you already consumed import before, so you'd need "#importimport_next" ;-) Reverse the order.
You should also return false if the whole || thing is not true.
================
Comment at: clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp:2846
+ "#include \"foo.h\"^",
+ "#error <^",
+ };
----------------
Add test for "#<^" here, since it should be false, but I think it will be true right now.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79456/new/
https://reviews.llvm.org/D79456
More information about the cfe-commits
mailing list