MCPcopy Index your code
hub / github.com/FSoft-AI4Code/CodeText-parser / get_docstring

Method get_docstring

src/codetext/parser/go_parser.py:74–88  ·  view source on GitHub ↗

Get docstring description for node Args: node (tree_sitter.Node) blob (str): original source code which parse the `node` Returns: str: docstring

(node, blob:str=None)

Source from the content-addressed store, hash-verified

72
73 @staticmethod
74 def get_docstring(node, blob:str=None):
75 """
76 Get docstring description for node
77
78 Args:
79 node (tree_sitter.Node)
80 blob (str): original source code which parse the `node`
81 Returns:
82 str: docstring
83 """
84 if blob:
85 logger.info('From version `0.0.6` this function will update argument in the API')
86 docstring_node = GoParser.get_docstring_node(node)
87 docstring = '\n'.join(get_node_text(s) for s in docstring_node)
88 return docstring
89
90 @staticmethod
91 def get_function_list(node):

Callers 10

test_get_docstringMethod · 0.45
test_get_docstringMethod · 0.45
test_get_docstringMethod · 0.45
test_get_docstringMethod · 0.45
test_get_docstringMethod · 0.45
test_get_docstringMethod · 0.45
test_get_docstringMethod · 0.45
test_get_docstringMethod · 0.45
test_get_docstringMethod · 0.45
test_get_docstringMethod · 0.45

Calls 2

get_node_textFunction · 0.85
get_docstring_nodeMethod · 0.45

Tested by 10

test_get_docstringMethod · 0.36
test_get_docstringMethod · 0.36
test_get_docstringMethod · 0.36
test_get_docstringMethod · 0.36
test_get_docstringMethod · 0.36
test_get_docstringMethod · 0.36
test_get_docstringMethod · 0.36
test_get_docstringMethod · 0.36
test_get_docstringMethod · 0.36
test_get_docstringMethod · 0.36