diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-08-25 17:10:00 +0000 | 
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-08-25 17:10:00 +0000 | 
| commit | ea7363732aa4f9504fc61570c832c9507e0cdf87 (patch) | |
| tree | b9dabd85ded94a9fc13a91bb06899caa2620e93a | |
| parent | 1f4b028b757f53c4903ff28863ca2592d2f639d1 (diff) | |
| download | bcm5719-llvm-ea7363732aa4f9504fc61570c832c9507e0cdf87.tar.gz bcm5719-llvm-ea7363732aa4f9504fc61570c832c9507e0cdf87.zip  | |
Add a code-completion context for "natural language" completions, so
that ASTUnit knows not to try to provide completions there.
llvm-svn: 112057
| -rw-r--r-- | clang/include/clang/Sema/CodeCompleteConsumer.h | 8 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 3 | 
2 files changed, 8 insertions, 3 deletions
diff --git a/clang/include/clang/Sema/CodeCompleteConsumer.h b/clang/include/clang/Sema/CodeCompleteConsumer.h index 3bb9df34bc9..13d16e357d0 100644 --- a/clang/include/clang/Sema/CodeCompleteConsumer.h +++ b/clang/include/clang/Sema/CodeCompleteConsumer.h @@ -181,7 +181,13 @@ public:      /// (without any arguments, in the case of a function-like macro).      CCC_MacroNameUse,      /// \brief Code completion occurred within a preprocessor expression. -    CCC_PreprocessorExpression +    CCC_PreprocessorExpression, +    /// \brief Code completion occurred in a context where natural language is +    /// expected, e.g., a comment or string literal. +    /// +    /// This context usually implies that no completions should be added, +    /// unless they come from an appropriate natural-language dictionary. +    CCC_NaturalLanguage    };  private: diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 3aa3e6df8cf..6d91b465de2 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -4874,9 +4874,8 @@ void Sema::CodeCompletePreprocessorMacroArgument(Scope *S,  }  void Sema::CodeCompleteNaturalLanguage() { -  // FIXME: Use a dedicated completion context for this!    HandleCodeCompleteResults(this, CodeCompleter, -                            CodeCompletionContext::CCC_Other, +                            CodeCompletionContext::CCC_NaturalLanguage,                              0, 0);  }  | 

