[PATCH] D79456: [clangd] Complete filenames after < / ".

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 18 14:39:26 PDT 2020


sammccall marked 3 inline comments as done.
sammccall added a comment.

*finally* getting back to this...



================
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();
----------------
adamcz wrote:
> 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.
I have to get points for the number of bugs on one line, right?

(The import vs import_next overlap I have a reasonable excuse - these had trailing spaces until I learned that `#include<foo.h>` is legal!)

Added more tests.


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