aboutsummaryrefslogtreecommitdiff
path: root/bindings/python/clang
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/python/clang')
-rw-r--r--bindings/python/clang/cindex.py30
1 files changed, 28 insertions, 2 deletions
diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py
index d265f7e520..770ff0e0fe 100644
--- a/bindings/python/clang/cindex.py
+++ b/bindings/python/clang/cindex.py
@@ -1735,10 +1735,15 @@ class CompletionString(ClangObject):
res = conf.lib.clang_getCompletionAvailability(self.obj)
return availabilityKinds[res]
+ @property
+ def briefComment(self):
+ return conf.lib.clang_getCompletionBriefComment(self.obj)
+
def __repr__(self):
return " | ".join([str(a) for a in self]) \
+ " || Priority: " + str(self.priority) \
- + " || Availability: " + str(self.availability)
+ + " || Availability: " + str(self.availability) \
+ + " || Brief comment: " + str(self.briefComment.spelling)
availabilityKinds = {
0: CompletionChunk.Kind("Available"),
@@ -1877,6 +1882,10 @@ class TranslationUnit(ClangObject):
# searching for declarations/definitions.
PARSE_SKIP_FUNCTION_BODIES = 64
+ # Used to indicate that brief documentation comments should be included
+ # into the set of code completions returned from this translation unit.
+ PARSE_INCLUDE_BRIEF_COMMENTS_IN_CODE_COMPLETION = 128
+
@classmethod
def from_source(cls, filename, args=None, unsaved_files=None, options=0,
index=None):
@@ -2149,7 +2158,9 @@ class TranslationUnit(ClangObject):
raise TranslationUnitSaveError(result,
'Error saving TranslationUnit.')
- def codeComplete(self, path, line, column, unsaved_files=None, options=0):
+ def codeComplete(self, path, line, column, unsaved_files=None,
+ include_macros=False, include_code_patterns=False,
+ include_brief_comments=False):
"""
Code complete in this translation unit.
@@ -2158,6 +2169,17 @@ class TranslationUnit(ClangObject):
and the second should be the contents to be substituted for the
file. The contents may be passed as strings or file objects.
"""
+ options = 0
+
+ if include_macros:
+ options += 1
+
+ if include_code_patterns:
+ options += 2
+
+ if include_brief_comments:
+ options += 4
+
if unsaved_files is None:
unsaved_files = []
@@ -2556,6 +2578,10 @@ functionList = [
[c_void_p],
c_int),
+ ("clang_getCompletionBriefComment",
+ [c_void_p],
+ _CXString),
+
("clang_getCompletionChunkCompletionString",
[c_void_p, c_int],
c_object_p),