This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Complete filenames after < / ".
ClosedPublic

Authored by sammccall on May 5 2020, 4:41 PM.

Details

Summary

Extract prefix filters to CodeComplete so it can be easily tested.

Fixes https://github.com/clangd/clangd/issues/366

Diff Detail

Event Timeline

sammccall created this revision.May 5 2020, 4:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2020, 4:41 PM
adamcz added inline comments.May 6 2020, 4:41 AM
clang-tools-extra/clangd/CodeComplete.cpp
1922

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.

clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
2846

Add test for "#<^" here, since it should be false, but I think it will be true right now.

kiwixz added a subscriber: kiwixz.May 15 2020, 5:16 AM
sammccall updated this revision to Diff 264721.May 18 2020, 2:18 PM

Address comments

sammccall marked 3 inline comments as done.May 18 2020, 2:20 PM

*finally* getting back to this...

clang-tools-extra/clangd/CodeComplete.cpp
1922

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.

adamcz accepted this revision.May 19 2020, 4:03 AM
This revision is now accepted and ready to land.May 19 2020, 4:03 AM
This revision was automatically updated to reflect the committed changes.
sammccall marked an inline comment as done.