From 735953a262994c208162315b5bfc461cc37ad5eb Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Mon, 9 Sep 2024 15:45:09 +0800 Subject: [PATCH 1/2] c/clang:displayname --- c/clang/_wrap/cursor.cpp | 2 ++ c/clang/clang.go | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/c/clang/_wrap/cursor.cpp b/c/clang/_wrap/cursor.cpp index db63dbc46..f54afdf52 100644 --- a/c/clang/_wrap/cursor.cpp +++ b/c/clang/_wrap/cursor.cpp @@ -113,6 +113,8 @@ CXString wrap_clang_getCursorUSR(CXCursor *cur) { return clang_getCursorUSR(*cur CXString wrap_clang_getCursorSpelling(CXCursor *cur) { return clang_getCursorSpelling(*cur); } +CXString wrap_clang_getCursorDisplayName(CXCursor *cur) { return clang_getCursorDisplayName(*cur); } + unsigned wrap_clang_Cursor_isVariadic(CXCursor *cur) { return clang_Cursor_isVariadic(*cur); } CXString wrap_clang_Cursor_getRawCommentText(CXCursor *cursor) { return clang_Cursor_getRawCommentText(*cursor); } diff --git a/c/clang/clang.go b/c/clang/clang.go index 422252a85..e60cccace 100644 --- a/c/clang/clang.go +++ b/c/clang/clang.go @@ -2196,6 +2196,21 @@ func (c Cursor) String() (ret String) { return c.wrapString() } +/** + * Retrieve 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. + */ +// llgo:link (*Cursor).wrapDisplayName C.wrap_clang_getCursorDisplayName +func (*Cursor) wrapDisplayName() (ret String) { + return +} +func (c Cursor) DisplayName() (ret String) { + return c.wrapDisplayName() +} + /** * Returns non-zero if the given cursor is a variadic function or method. */ From 2b8d2b0026bad93251614a6c603e5550df660946 Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Mon, 9 Sep 2024 18:35:52 +0800 Subject: [PATCH 2/2] c/clang:comment range --- c/clang/_wrap/cursor.cpp | 4 ++++ c/clang/clang.go | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/c/clang/_wrap/cursor.cpp b/c/clang/_wrap/cursor.cpp index f54afdf52..254b0cdfd 100644 --- a/c/clang/_wrap/cursor.cpp +++ b/c/clang/_wrap/cursor.cpp @@ -117,6 +117,10 @@ CXString wrap_clang_getCursorDisplayName(CXCursor *cur) { return clang_getCursor unsigned wrap_clang_Cursor_isVariadic(CXCursor *cur) { return clang_Cursor_isVariadic(*cur); } +void wrap_clang_Cursor_getCommentRange(CXCursor *cur, CXSourceRange *range) { + *range = clang_Cursor_getCommentRange(*cur); +} + CXString wrap_clang_Cursor_getRawCommentText(CXCursor *cursor) { return clang_Cursor_getRawCommentText(*cursor); } CXString wrap_clang_Cursor_getMangling(CXCursor *cur) { return clang_Cursor_getMangling(*cur); } diff --git a/c/clang/clang.go b/c/clang/clang.go index e60cccace..671f7a222 100644 --- a/c/clang/clang.go +++ b/c/clang/clang.go @@ -2219,6 +2219,19 @@ func (*Cursor) wrapIsVariadic() (ret c.Uint) { return 0 } func (c Cursor) IsVariadic() (ret c.Uint) { return c.wrapIsVariadic() } +/** + * Given a cursor that represents a declaration, return the associated + * comment's source range. The range may include multiple consecutive comments + * with whitespace in between. + */ +// llgo:link (*Cursor).wrapCommentRange C.wrap_clang_Cursor_getCommentRange +func (c *Cursor) wrapCommentRange(ret *SourceRange) {} + +func (c Cursor) CommentRange() (loc SourceRange) { + c.wrapCommentRange(&loc) + return +} + /** * Given a cursor that represents a declaration, return the associated * comment text, including comment markers.