-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
handle method definitions with constants #26
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking this on, @joshmn! 🤗
@modules << existing | ||
@namespace << existing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't add it to the @modules
or @namesapce
since we are not going to traverse it's children, so we don't need to set setup it up to be part of the namespace, since we would also need to pop them again
elsif existing = @analyzer.classes.detect { |name| name.qualified_name == target } | ||
return prev if @classes.find { |klass| klass.qualified_name == existing.qualified_name } | ||
|
||
@classes << existing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
# rubocop:disable Lint/AssignmentInCondition | ||
def inferred_context_for(target) | ||
if existing = @analyzer.modules.detect { |name| name.qualified_name == target } | ||
return prev if @modules.find { |mod| mod.qualified_name == existing.qualified_name } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is prev
coming from? 🤔
I'm afraid this one needs quite some rework after #41. Sorry about that! |
closes #20
Not in love with
#inferred_context_for
but it seems to work.