diff options
Diffstat (limited to 'clang/include')
| -rw-r--r-- | clang/include/clang-c/Index.h | 23 | ||||
| -rw-r--r-- | clang/include/clang/Parse/Action.h | 31 | ||||
| -rw-r--r-- | clang/include/clang/Sema/CodeCompleteConsumer.h | 13 |
3 files changed, 64 insertions, 3 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index 1c8da3077c1..96c1b2f087a 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/include/clang-c/Index.h @@ -581,7 +581,28 @@ enum CXCompletionChunkKind { * the text buffer. Rather, it is meant to illustrate the type that an * expression using the given completion string would have. */ - CXCompletionChunk_ResultType + CXCompletionChunk_ResultType, + /** + * \brief A colon (':'). + */ + CXCompletionChunk_Colon, + /** + * \brief A semicolon (';'). + */ + CXCompletionChunk_SemiColon, + /** + * \brief An '=' sign. + */ + CXCompletionChunk_Equal, + /** + * Horizontal space (' '). + */ + CXCompletionChunk_HorizontalSpace, + /** + * Vertical space ('\n'), after which it is generally a good idea to + * perform indentation. + */ + CXCompletionChunk_VerticalSpace }; /** diff --git a/clang/include/clang/Parse/Action.h b/clang/include/clang/Parse/Action.h index 1bf999094b4..be46851fe1a 100644 --- a/clang/include/clang/Parse/Action.h +++ b/clang/include/clang/Parse/Action.h @@ -2340,11 +2340,40 @@ public: /// \todo Code completion for attributes. //@{ + /// \brief Describes the context in which code completion occurs. + enum CodeCompletionContext { + /// \brief Code completion occurs at top-level or namespace context. + CCC_Namespace, + /// \brief Code completion occurs within a class, struct, or union. + CCC_Class, + /// \brief Code completion occurs following one or more template + /// headers. + CCC_Template, + /// \brief Code completion occurs following one or more template + /// headers within a class. + CCC_MemberTemplate, + /// \brief Code completion occurs within an expression. + CCC_Expression, + /// \brief Code completion occurs within a statement, which may + /// also be an expression or a declaration. + CCC_Statement, + /// \brief Code completion occurs at the beginning of the + /// initialization statement (or expression) in a for loop. + CCC_ForInit, + /// \brief Code completion ocurs within the condition of an if, + /// while, switch, or for statement. + CCC_Condition + }; + /// \brief Code completion for an ordinary name that occurs within the given /// scope. /// /// \param S the scope in which the name occurs. - virtual void CodeCompleteOrdinaryName(Scope *S) { } + /// + /// \param CompletionContext the context in which code completion + /// occurs. + virtual void CodeCompleteOrdinaryName(Scope *S, + CodeCompletionContext CompletionContext) { } /// \brief Code completion for a member access expression. /// diff --git a/clang/include/clang/Sema/CodeCompleteConsumer.h b/clang/include/clang/Sema/CodeCompleteConsumer.h index aec10f32fe6..82f9bd8ccf9 100644 --- a/clang/include/clang/Sema/CodeCompleteConsumer.h +++ b/clang/include/clang/Sema/CodeCompleteConsumer.h @@ -85,7 +85,18 @@ public: /// \brief A right angle bracket ('>'). CK_RightAngle, /// \brief A comma separator (','). - CK_Comma + CK_Comma, + /// \brief A colon (':'). + CK_Colon, + /// \brief A semicolon (';'). + CK_SemiColon, + /// \brief An '=' sign. + CK_Equal, + /// \brief Horizontal whitespace (' '). + CK_HorizontalSpace, + /// \brief Verticle whitespace ('\n' or '\r\n', depending on the + /// platform). + CK_VerticalSpace }; /// \brief One piece of the code completion string. |

