Skip to content

Commit

Permalink
Merge pull request #7 from nhtlongcs/main
Browse files Browse the repository at this point in the history
Fix unintentionally overwritten `method_list`
  • Loading branch information
nmd2k authored Oct 11, 2023
2 parents bdacdc4 + 99ffe7d commit 49dae61
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/codetext/codetext_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ def parse_file(file_path: str, language: str = None, verbose: bool = False) -> L
cls_info["code"] = get_node_text(_cls)

cls_method = []
method_list = parser.get_function_list(_cls)
for method in method_list:
current_class_methods = parser.get_function_list(_cls)
for method in current_class_methods:
method_info = parser.get_function_metadata(method)
method_info['code'] = get_node_text(method)
cls_method.append(method_info)

cls_info["method"] = cls_method
cls_metadata.append(cls_info)
method_list.extend(method_list)
method_list.extend(current_class_methods)

fn_list: List = parser.get_function_list(root_node)
for node in fn_list[:]:
Expand Down

0 comments on commit 49dae61

Please sign in to comment.