diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2012-07-02 17:35:10 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2012-07-02 17:35:10 +0000 |
commit | d99ef536b241071b6f4c01db6525dc03242ac30b (patch) | |
tree | ad1f07e99303c902595dd6d3045158d361726975 /include/clang-c | |
parent | f45f23493d762b7548afc02563b1908a101c6721 (diff) |
Add a new libclang completion API to get brief documentation comment that is
attached to a declaration in the completion string.
Since extracting comments isn't free, a new code completion option is
introduced.
A new code completion option that enables including brief comments
into CodeCompletionString should be a, err, code completion option.
But because ASTUnit caches global declarations during parsing before
even completion consumer is created, the option is duplicated as a
translation unit option (in both libclang and ASTUnit, like the option
to cache code completion results).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159539 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang-c')
-rw-r--r-- | include/clang-c/Index.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index fd048775d3..b34918fb6f 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -1058,7 +1058,14 @@ enum CXTranslationUnit_Flags { * This option can be used to search for declarations/definitions while * ignoring the usages. */ - CXTranslationUnit_SkipFunctionBodies = 0x40 + CXTranslationUnit_SkipFunctionBodies = 0x40, + + /** + * \brief Used to indicate that brief documentation comments should be + * included into the set of code completions returned from this translation + * unit. + */ + CXTranslationUnit_IncludeBriefCommentsInCodeCompletion = 0x80 }; /** @@ -3786,6 +3793,14 @@ clang_getCompletionAnnotation(CXCompletionString completion_string, CINDEX_LINKAGE CXString clang_getCompletionParent(CXCompletionString completion_string, enum CXCursorKind *kind); + +/** + * \brief Retrieve the brief documentation comment attached to the declaration + * that corresponds to the given completion string. + */ +CINDEX_LINKAGE CXString +clang_getCompletionBriefComment(CXCompletionString completion_string); + /** * \brief Retrieve a completion string for an arbitrary declaration or macro * definition cursor. @@ -3836,7 +3851,13 @@ enum CXCodeComplete_Flags { * \brief Whether to include code patterns for language constructs * within the set of code completions, e.g., for loops. */ - CXCodeComplete_IncludeCodePatterns = 0x02 + CXCodeComplete_IncludeCodePatterns = 0x02, + + /** + * \brief Whether to include brief documentation within the set of code + * completions returned. + */ + CXCodeComplete_IncludeBriefComments = 0x04 }; /** |