@@ -56,6 +56,7 @@ def parse_file(file_path: str, language: str = None, verbose: bool = False) -> L
56
56
method_list = parser .get_function_list (_cls )
57
57
for method in method_list :
58
58
method_info = parser .get_function_metadata (method )
59
+ method_info ['code' ] = get_node_text (method )
59
60
cls_method .append (method_info )
60
61
61
62
cls_info ["method" ] = cls_method
@@ -88,7 +89,8 @@ def print_result(res: Dict, file_name: str = "no_name_file"):
88
89
89
90
# ========= Print class & method =========
90
91
cls_headers = ["#" , "Class" , "Arguments" ]
91
- cls_method_headers = ["#" , "Method name" , "Paramters" , "Type" , "Return type" ]
92
+ cls_method_headers = ["#" , "Method name" , "Paramters" ,
93
+ "Type" , "Return type" , "Throws" ]
92
94
cls_info = []
93
95
method_info = {}
94
96
for cls_idx , _cls in enumerate (res ["class" ]):
@@ -116,6 +118,11 @@ def print_result(res: Dict, file_name: str = "no_name_file"):
116
118
if i <= 1 and method ["return_type" ] != "<not_specific>"
117
119
else ""
118
120
)
121
+ sublist [5 ] = (
122
+ method ["throws" ]
123
+ if i <= 1 and "throws" in method .keys ()
124
+ else ""
125
+ )
119
126
_method_info .append (sublist )
120
127
121
128
method_info [file_name ] = [_cls ["identifier" ], _method_info ]
0 commit comments