diff options
| author | Kadir Cetinkaya <kadircet@google.com> | 2018-08-13 08:13:35 +0000 |
|---|---|---|
| committer | Kadir Cetinkaya <kadircet@google.com> | 2018-08-13 08:13:35 +0000 |
| commit | 9b9c27490d24584bcb282f5ae873febe1612268a (patch) | |
| tree | 5d7cb0a155860afa339751e6b66f0d1492f89295 /clang/lib | |
| parent | 5c490b49c3a0cc190a010f21c7d4137fa9ade8d3 (diff) | |
| download | bcm5719-llvm-9b9c27490d24584bcb282f5ae873febe1612268a.tar.gz bcm5719-llvm-9b9c27490d24584bcb282f5ae873febe1612268a.zip | |
[clang] Store code completion token range in preprocessor.
Summary:
This change is to support a new fature in clangd, tests will be send toclang-tools-extra with that change.
Unittests are included in: https://reviews.llvm.org/D50449
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D50443
llvm-svn: 339540
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Lex/Preprocessor.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index def47b2f109..bfeaa03d85d 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -868,6 +868,7 @@ void Preprocessor::Lex(Token &Result) { if (Result.is(tok::code_completion) && Result.getIdentifierInfo()) { // Remember the identifier before code completion token. setCodeCompletionIdentifierInfo(Result.getIdentifierInfo()); + setCodeCompletionTokenRange(Result.getLocation(), Result.getEndLoc()); // Set IdenfitierInfo to null to avoid confusing code that handles both // identifiers and completion tokens. Result.setIdentifierInfo(nullptr); |

