-
Notifications
You must be signed in to change notification settings - Fork 4
Provide support for top_const_ref nodes #2
Provide support for top_const_ref nodes #2
Conversation
Came across these nodes when using sigs that contain ::Klass syntax to represent user defined types.
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! Could I trouble you to add tests for each node type?
lib/yard-sorbet/sig_to_yard.rb
Outdated
# A top-level constant reference, such as ::Klass | ||
# It contains a child node of type :const | ||
convert(children.first) | ||
when :const |
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.
let's add this to when :const_path_ref
above
Sure, were you thinking of extending |
@KaanOzkan I'd recommend just extending the |
@@ -56,7 +56,7 @@ def self.convert_type(node) | |||
else | |||
[node.source] | |||
end | |||
when :const_path_ref | |||
when :const_path_ref, :const | |||
[node.source] | |||
when :hash, :list |
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 wasn't sure what a list
node is and did not test it.
Looks good! However, I just realized this is under the In the meantime, I'll see if I can get someone at Stripe to hide this repo, add a disclaimer, or take ownership of the gem. |
Came across these nodes when using sigs that contain
::Klass
syntax to represent user defined types.