This is an archive of the discontinued LLVM Phabricator instance.

[clang][CodeComplete] Make completion work after initializer lists
ClosedPublic

Authored by kadircet on Jan 22 2020, 5:13 AM.

Details

Summary

CodeCompletion was not being triggered after successfully parsed
initializer lists, e.g.

cpp
void foo(int, bool);
void bar() {
  foo({1}^, false);
}

CodeCompletion would suggest the function foo as an overload candidate up until
the point marked with ^ but after that point we do not trigger signature help
since parsing succeeds.

This patch handles that case by failing in parsing expression lists whenever we
see a codecompletion token, in addition to getting an invalid subexpression.

Diff Detail

Event Timeline

kadircet created this revision.Jan 22 2020, 5:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 22 2020, 5:13 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Unit tests: pass. 62094 tests passed, 0 failed and 785 were skipped.

clang-tidy: unknown.

clang-format: pass.

Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

kadircet updated this revision to Diff 239555.Jan 22 2020, 5:44 AM
  • Add comments

Unit tests: pass. 62094 tests passed, 0 failed and 785 were skipped.

clang-tidy: unknown.

clang-format: pass.

Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

sammccall accepted this revision.Jan 22 2020, 6:40 AM
This revision is now accepted and ready to land.Jan 22 2020, 6:40 AM
This revision was automatically updated to reflect the committed changes.