From 4c0679891d7abf92d58a918b2f93665be223f583 Mon Sep 17 00:00:00 2001 From: nhtlongcs Date: Sat, 7 Oct 2023 21:36:13 +0000 Subject: [PATCH 1/2] fix class method overwritten --- src/codetext/codetext_cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/codetext/codetext_cli.py b/src/codetext/codetext_cli.py index 36e25ba..6ec53c9 100644 --- a/src/codetext/codetext_cli.py +++ b/src/codetext/codetext_cli.py @@ -53,8 +53,8 @@ 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) From 99ffe7dc473f2ee9bcb502d02330a410634aa301 Mon Sep 17 00:00:00 2001 From: nhtlongcs Date: Sat, 7 Oct 2023 21:47:01 +0000 Subject: [PATCH 2/2] fix class method overwritten --- src/codetext/codetext_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codetext/codetext_cli.py b/src/codetext/codetext_cli.py index 6ec53c9..43d8824 100644 --- a/src/codetext/codetext_cli.py +++ b/src/codetext/codetext_cli.py @@ -61,7 +61,7 @@ def parse_file(file_path: str, language: str = None, verbose: bool = False) -> L 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[:]: