Fix unintentionally overwritten method_list - #7
Merged
Conversation
Contributor
Author
|
Hi @nmd2k, Could you please review my PR for a bug that could affect the dependent project? I'd really appreciate it. |
Collaborator
|
Thank you, my silly mistake there. I will try to check other language and release a new version of this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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_listvariable is overwritten on line 56. This means that themethod_listvariable 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_listvariable, 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_methodsvariable to themethod_listlist safely (line 64). This ensures that themethod_listlist contains all of the methods for all of the classes in themethod_listlist.Here is the corrected code,