Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 49dae61

Browse files
authored
Merge pull request #7 from nhtlongcs/main
Fix unintentionally overwritten `method_list`
2 parents bdacdc4 + 99ffe7d commit 49dae61

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/codetext/codetext_cli.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ def parse_file(file_path: str, language: str = None, verbose: bool = False) -> L
5353
cls_info["code"] = get_node_text(_cls)
5454

5555
cls_method = []
56-
method_list = parser.get_function_list(_cls)
57-
for method in method_list:
56+
current_class_methods = parser.get_function_list(_cls)
57+
for method in current_class_methods:
5858
method_info = parser.get_function_metadata(method)
5959
method_info['code'] = get_node_text(method)
6060
cls_method.append(method_info)
6161

6262
cls_info["method"] = cls_method
6363
cls_metadata.append(cls_info)
64-
method_list.extend(method_list)
64+
method_list.extend(current_class_methods)
6565

6666
fn_list: List = parser.get_function_list(root_node)
6767
for node in fn_list[:]:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /