aboutsummaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-08-25 17:04:25 +0000
committerDouglas Gregor <dgregor@apple.com>2010-08-25 17:04:25 +0000
commit55817afdf9d453a443262a733f6caf6692dca118 (patch)
tree8b00c2f68023cf89c25d77cb00bf53e982cad1fa /include/clang
parent1e32ca6e3007e09073ddafb3cb5e0adc1f83293c (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 'include/clang')
-rw-r--r--include/clang/Lex/CodeCompletionHandler.h5
-rw-r--r--include/clang/Lex/Preprocessor.h4
-rw-r--r--include/clang/Parse/Parser.h1
-rw-r--r--include/clang/Sema/Action.h4
-rw-r--r--include/clang/Sema/Sema.h1
5 files changed, 15 insertions, 0 deletions
diff --git a/include/clang/Lex/CodeCompletionHandler.h b/include/clang/Lex/CodeCompletionHandler.h
index bb8705b9a6..d28a3aa7d6 100644
--- a/include/clang/Lex/CodeCompletionHandler.h
+++ b/include/clang/Lex/CodeCompletionHandler.h
@@ -55,6 +55,11 @@ public:
virtual void CodeCompleteMacroArgument(IdentifierInfo *Macro,
MacroInfo *MacroInfo,
unsigned ArgumentIndex) { }
+
+ /// \brief Callback invoked when performing code completion in a part of the
+ /// file where we expect natural language, e.g., a comment, string, or
+ /// #error directive.
+ virtual void CodeCompleteNaturalLanguage() { }
};
}
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h
index 543cb74226..018d1947a0 100644
--- a/include/clang/Lex/Preprocessor.h
+++ b/include/clang/Lex/Preprocessor.h
@@ -392,6 +392,10 @@ public:
CodeComplete = 0;
}
+ /// \brief Hook used by the lexer to invoke the "natural language" code
+ /// completion point.
+ void CodeCompleteNaturalLanguage();
+
/// \brief Retrieve the preprocessing record, or NULL if there is no
/// preprocessing record.
PreprocessingRecord *getPreprocessingRecord() const { return Record; }
diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h
index 1f680f8854..e4dad1fba5 100644
--- a/include/clang/Parse/Parser.h
+++ b/include/clang/Parse/Parser.h
@@ -1540,6 +1540,7 @@ private:
virtual void CodeCompleteMacroArgument(IdentifierInfo *Macro,
MacroInfo *MacroInfo,
unsigned ArgumentIndex);
+ virtual void CodeCompleteNaturalLanguage();
};
} // end namespace clang
diff --git a/include/clang/Sema/Action.h b/include/clang/Sema/Action.h
index 3b7fc2cc62..e7fb732c34 100644
--- a/include/clang/Sema/Action.h
+++ b/include/clang/Sema/Action.h
@@ -3244,6 +3244,10 @@ public:
IdentifierInfo *Macro,
MacroInfo *MacroInfo,
unsigned Argument) { }
+
+ /// \brief Callback invoked when performing code completion in a context where
+ /// we expect a natural language, e.g., inside a comment or string.
+ virtual void CodeCompleteNaturalLanguage() { }
//@}
};
diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h
index 0ee864c66a..ba1122e1ee 100644
--- a/include/clang/Sema/Sema.h
+++ b/include/clang/Sema/Sema.h
@@ -4363,6 +4363,7 @@ public:
IdentifierInfo *Macro,
MacroInfo *MacroInfo,
unsigned Argument);
+ virtual void CodeCompleteNaturalLanguage();
void GatherGlobalCodeCompletions(
llvm::SmallVectorImpl<CodeCompletionResult> &Results);
//@}