llvm-project/clang/lib/Lex
Ilya Biryukov b3510c4254 [CodeComplete] Fix completion at the end of keywords
Summary:
Make completion behave consistently no matter if it is run at the
start, in the middle or at the end of an identifier that happens to
be a keyword or a macro name. Since completion is often ran on
incomplete identifiers, they may turn into keywords by accident.

For example, we should produce same results for all of these
completion points:

    // ^ is completion point.
    ^class
    cla^ss
    class^

Previously clang produced different results for the last case (as if
the completion point was after a space: `class ^`).

This change also updates some offsets in tests that (unintentionally?)
relied on the old behavior.

Reviewers: sammccall, bkramer, arphaman, aaron.ballman

Reviewed By: sammccall

Subscribers: cfe-commits

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

llvm-svn: 330717
2018-04-24 13:48:53 +00:00
..
CMakeLists.txt
HeaderMap.cpp Use StringRef for MemoryBuffer identifier API (NFC) 2016-10-01 16:38:28 +00:00
HeaderSearch.cpp Revert r329684 (and follow-ups 329693, 329714). See discussion on https://reviews.llvm.org/D43578. 2018-04-10 18:53:28 +00:00
Lexer.cpp [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00
LiteralSupport.cpp [Lex] Fix handling numerical literals ending with ' and signed exponent. 2018-02-06 22:39:25 +00:00
MacroArgs.cpp Fix typos in clang 2018-04-06 15:14:32 +00:00
MacroInfo.cpp [Lex] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-12-04 23:16:21 +00:00
ModuleMap.cpp Record whether a module came from a private module map 2018-04-20 17:16:04 +00:00
PPCaching.cpp [Lex] Fix crash on code completion in comment in included file. 2018-01-19 23:41:47 +00:00
PPCallbacks.cpp
PPConditionalDirectiveRecord.cpp
PPDirectives.cpp Fix typos in clang 2018-04-06 15:14:32 +00:00
PPExpressions.cpp Keep the IdentifierInfo in the Token for alternative operator keyword 2017-07-14 09:23:40 +00:00
PPLexerChange.cpp [Lex] Fix crash on code completion in comment in included file. 2018-01-19 23:41:47 +00:00
PPMacroExpansion.cpp hwasan: add -fsanitize=kernel-hwaddress flag 2018-04-13 18:05:21 +00:00
PTHLexer.cpp Fix typos in clang 2018-04-06 15:14:32 +00:00
Pragma.cpp Revert r329684 (and follow-ups 329693, 329714). See discussion on https://reviews.llvm.org/D43578. 2018-04-10 18:53:28 +00:00
PreprocessingRecord.cpp [PCH] Serialize skipped preprocessor ranges 2018-01-15 19:14:16 +00:00
Preprocessor.cpp Defer adding keywords to the identifier table until after the language options have been loaded from the AST file. 2018-04-16 21:07:08 +00:00
PreprocessorLexer.cpp [Lex] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-12-04 23:16:21 +00:00
ScratchBuffer.cpp [Lex] Use WritableMemoryBuffer in ScratchBuffer.cpp 2018-01-11 10:43:45 +00:00
TokenConcatenation.cpp Now that C++17 is official (https://www.iso.org/standard/68564.html), start changing the C++1z terminology over to C++17. NFC intended, these are all mechanical changes. 2017-12-04 20:27:34 +00:00
TokenLexer.cpp Fix typos in clang 2018-04-06 15:14:32 +00:00
UnicodeCharSets.h