HomePhabricator

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

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

Description

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

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.

Reviewers: sammccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73177

Details