diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-08-25 17:04:25 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-08-25 17:04:25 +0000 |
commit | 55817afdf9d453a443262a733f6caf6692dca118 (patch) | |
tree | 8b00c2f68023cf89c25d77cb00bf53e982cad1fa /lib/Lex/Preprocessor.cpp | |
parent | 1e32ca6e3007e09073ddafb3cb5e0adc1f83293c (diff) |
Introduce a preprocessor code-completion hook for contexts where we
expect "natural" language and should not provide any completions,
e.g., comments, string literals, #error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112054 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r-- | lib/Lex/Preprocessor.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index 04de68baef..a23290e952 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -284,6 +284,13 @@ bool Preprocessor::isCodeCompletionFile(SourceLocation FileLoc) const { == CodeCompletionFile; } +void Preprocessor::CodeCompleteNaturalLanguage() { + SetCodeCompletionPoint(0, 0, 0); + getDiagnostics().setSuppressAllDiagnostics(true); + if (CodeComplete) + CodeComplete->CodeCompleteNaturalLanguage(); +} + //===----------------------------------------------------------------------===// // Token Spelling //===----------------------------------------------------------------------===// |