]> granicus.if.org Git - clang/commit
[CodeComplete] Fix completion in the middle of idents in macro calls
authorIlya Biryukov <ibiryukov@google.com>
Mon, 22 Jan 2018 17:18:28 +0000 (17:18 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Mon, 22 Jan 2018 17:18:28 +0000 (17:18 +0000)
commit39491d7b6098f96eb1f88d68068eb654c1e2bd81
treed02226a4105790314fafacbc33287077c0a49df9
parent6967d60504374c3d4c0e4122caf8c33f34717fee
[CodeComplete] Fix completion in the middle of idents in macro calls

Summary:
This patch removes IdentifierInfo from completion token after remembering
the identifier in the preprocessor.

Prior to this patch, completion token had the IdentifierInfo set to null when
completing at the start of identifier and to the II for completion prefix
when in the middle of identifier.

This patch unifies how code completion token is handled when it is insterted
before the identifier and in the middle of the identifier.

The actual IdentifierInfo can still be obtained from the Preprocessor.

Reviewers: bkramer, arphaman

Reviewed By: bkramer

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323133 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Lex/Preprocessor.cpp
test/CodeCompletion/inside-macros.cpp [new file with mode: 0644]