diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-08-05 09:09:23 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-08-05 09:09:23 +0000 |
| commit | b68bc59a2d51dce59a221b52a6490cac8bb65c56 (patch) | |
| tree | 7708292d1996bce7b67f5329d2b3086c68e8b0d6 /clang/include/clang-c/Index.h | |
| parent | 42d7d19710d09f00f030eff543ff8841b5b56c64 (diff) | |
| download | bcm5719-llvm-b68bc59a2d51dce59a221b52a6490cac8bb65c56.tar.gz bcm5719-llvm-b68bc59a2d51dce59a221b52a6490cac8bb65c56.zip | |
Give clang_codeCompleteAt() an "options" parameter, and add a new
flags enumeration + default-generating function that allows
code-completion to be customized via the libclang API.
Plus, turn on spell-checking when performing code completion.
llvm-svn: 110319
Diffstat (limited to 'clang/include/clang-c/Index.h')
| -rw-r--r-- | clang/include/clang-c/Index.h | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index 9e8623a3d87..bbc8fbaf962 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/include/clang-c/Index.h @@ -2079,6 +2079,33 @@ CXCodeCompleteResults *clang_codeComplete(CXIndex CIdx, unsigned complete_column); /** + * \brief Flags that can be passed to \c clang_codeCompleteAt() to + * modify its behavior. + * + * The enumerators in this enumeration can be bitwise-OR'd together to + * provide multiple options to \c clang_codeCompleteAt(). + */ +enum CXCodeComplete_Flags { + /** + * \brief Whether to include macros within the set of code + * completions returned. + */ + CXCodeComplete_IncludeMacros = 0x01, + + /** + * \brief Whether to include code patterns for language constructs + * within the set of code completions, e.g., for loops. + */ + CXCodeComplete_IncludeCodePatterns = 0x02 +}; + +/** + * \brief Returns a default set of code-completion options that can be + * passed to\c clang_codeCompleteAt(). + */ +CINDEX_LINKAGE unsigned clang_defaultCodeCompleteOptions(void); + +/** * \brief Perform code completion at a given location in a translation unit. * * This function performs code completion at a particular file, line, and @@ -2135,6 +2162,12 @@ CXCodeCompleteResults *clang_codeComplete(CXIndex CIdx, * \param num_unsaved_files The number of unsaved file entries in \p * unsaved_files. * + * \param options Extra options that control the behavior of code + * completion, expressed as a bitwise OR of the enumerators of the + * CXCodeComplete_Flags enumeration. The + * \c clang_defaultCodeCompleteOptions() function returns a default set + * of code-completion options. + * * \returns If successful, a new \c CXCodeCompleteResults structure * containing code-completion results, which should eventually be * freed with \c clang_disposeCodeCompleteResults(). If code @@ -2146,7 +2179,8 @@ CXCodeCompleteResults *clang_codeCompleteAt(CXTranslationUnit TU, unsigned complete_line, unsigned complete_column, struct CXUnsavedFile *unsaved_files, - unsigned num_unsaved_files); + unsigned num_unsaved_files, + unsigned options); /** * \brief Free the given set of code-completion results. |

