MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeText-parser / get_docstring

Method get_docstring

src/codetext/parser/cpp_parser.py:16–30  ·  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=None)

Source from the content-addressed store, hash-verified

14
15 @staticmethod
16 def get_docstring(node, blob=None):
17 """
18 Get docstring description for node
19
20 Args:
21 node (tree_sitter.Node)
22 blob (str): original source code which parse the `node`
23 Returns:
24 str: docstring
25 """
26 if blob:
27 logger.info('From version `0.0.6` this function will update argument in the API')
28 docstring_node = CppParser.get_docstring_node(node)
29 docstring = '\n'.join(get_node_text(s) for s in docstring_node)
30 return docstring
31
32 @staticmethod
33 def get_docstring_node(node):

Callers

nothing calls this directly

Calls 2

get_node_textFunction · 0.85
get_docstring_nodeMethod · 0.45

Tested by

no test coverage detected