Fix unintentionally overwritten method_list
#7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I would like to thank the authors of this repository for their work on this project, which has been invaluable for AI4code projects. However, I found a bug in the code that should not be present.
The error is that the
method_list
variable is overwritten on line 56. This means that themethod_list
variable will only contain the methods of the last extend time.CodeText-parser/src/codetext/codetext_cli.py
Lines 49 to 64 in bdacdc4
To fix this error, instead of overwriting the
method_list
variable, I created a new variable,current_class_methods
, to store the methods of the current class (check out my PR). Then, I extend thecurrent_class_methods
variable to themethod_list
list safely (line 64). This ensures that themethod_list
list contains all of the methods for all of the classes in themethod_list
list.Here is the corrected code,