[CodeComplete] Fix completion in the middle of ident in ctor lists.
authorIlya Biryukov <ibiryukov@google.com>
Wed, 25 Apr 2018 15:13:34 +0000 (15:13 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Wed, 25 Apr 2018 15:13:34 +0000 (15:13 +0000)
commitef4ece75fdb48b06ab4b8cd087a6fc64b44d5978
tree28f8dd79f2318936707e3ae88382e5a485ba013a
parent5559cc3b75bd2c3bfdffd7ef752d899e085e4a39
[CodeComplete] Fix completion in the middle of ident in ctor lists.

Summary:
The example that was broken before (^ designates completion points):

    class Foo {
      Foo() : fie^ld^() {} // no completions were provided here.
      int field;
    };

To fix it we don't cut off lexing after an identifier followed by code
completion token is lexed. Instead we skip the rest of identifier and
continue lexing.
This is consistent with behavior of completion when completion token is
right before the identifier.

Reviewers: sammccall, aaron.ballman, bkramer, sepavloff, arphaman, rsmith

Reviewed By: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 330833
clang/lib/Lex/Lexer.cpp
clang/test/CodeCompletion/ctor-initializer.cpp
clang/test/CodeCompletion/end-of-file.cpp [new file with mode: 0644]