aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bindings/python/clang/cindex.py11
-rw-r--r--bindings/python/tests/cindex/test_cursor.py2
2 files changed, 13 insertions, 0 deletions
diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py
index 4b7dc005f6..5b8f814c05 100644
--- a/bindings/python/clang/cindex.py
+++ b/bindings/python/clang/cindex.py
@@ -619,6 +619,17 @@ class Cursor(Structure):
return Cursor_spelling(self)
@property
+ def displayname(self):
+ """
+ Return the display name for the entity referenced by this cursor.
+
+ The display name contains extra information that helps identify the cursor,
+ such as the parameters of a function or template or the arguments of a
+ class template specialization.
+ """
+ return Cursor_displayname(self)
+
+ @property
def location(self):
"""
Return the source location (the starting character) of the entity
diff --git a/bindings/python/tests/cindex/test_cursor.py b/bindings/python/tests/cindex/test_cursor.py
index 04e4838945..3dde891a9c 100644
--- a/bindings/python/tests/cindex/test_cursor.py
+++ b/bindings/python/tests/cindex/test_cursor.py
@@ -54,8 +54,10 @@ def test_get_children():
assert tu_nodes[1].kind == CursorKind.STRUCT_DECL
assert tu_nodes[1].spelling == 's1'
+ assert tu_nodes[1].displayname == 's1'
assert tu_nodes[1].is_definition() == False
assert tu_nodes[2].kind == CursorKind.FUNCTION_DECL
assert tu_nodes[2].spelling == 'f0'
+ assert tu_nodes[2].displayname == 'f0(int, int)'
assert tu_nodes[2].is_definition() == True