summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Lexer.cpp
diff options
context:
space:
mode:
authorVassil Vassilev <v.g.vassilev@gmail.com>2016-07-27 14:56:59 +0000
committerVassil Vassilev <v.g.vassilev@gmail.com>2016-07-27 14:56:59 +0000
commit644ea61d2dc1d185994c845e7e3de173d95a5674 (patch)
tree3aaf0cf24fcc3e9ced186a9e02905af6c3db8eaf /clang/lib/Lex/Lexer.cpp
parent5267d53779b45002837c779e513811aa8e9ad755 (diff)
downloadbcm5719-llvm-644ea61d2dc1d185994c845e7e3de173d95a5674.tar.gz
bcm5719-llvm-644ea61d2dc1d185994c845e7e3de173d95a5674.zip
Implement filtering for code completion of identifiers.
Patch by Cristina Cristescu and Axel Naumann! Agreed on post commit review (D17820). llvm-svn: 276878
Diffstat (limited to 'clang/lib/Lex/Lexer.cpp')
-rw-r--r--clang/lib/Lex/Lexer.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp
index 9c2a0163ace..9f7638d8329 100644
--- a/clang/lib/Lex/Lexer.cpp
+++ b/clang/lib/Lex/Lexer.cpp
@@ -1533,7 +1533,15 @@ FinishIdentifier:
// preprocessor, which may macro expand it or something.
if (II->isHandleIdentifierCase())
return PP->HandleIdentifier(Result);
-
+
+ if (II->getTokenID() == tok::identifier && isCodeCompletionPoint(CurPtr)
+ && II->getPPKeywordID() == tok::pp_not_keyword
+ && II->getObjCKeywordID() == tok::objc_not_keyword) {
+ // Return the code-completion token.
+ Result.setKind(tok::code_completion);
+ cutOffLexing();
+ return true;
+ }
return true;
}
OpenPOWER on IntegriCloud