-
Notifications
You must be signed in to change notification settings - Fork 138
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
Modify YardDoc
listener to create RBS signatures
#2218
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.
Shoudn't we also change the Yard listener to not create a comment?
I'm not sure if we want to have both listeners tbh, maybe just one that create either a RBI::Comment
or a RBSSig
?
btw, maybe RBI::SigComment
would be better? Not sure.
I opted for skipping it in RBI::Printer instead. Also we have separation of concerns.
YARD listener is doing quite a bit, I like having 2 separate. But it's slower since we go through the comments again. If we want performance we can combine them. |
RBSSigbnatures
listenerYardDoc
listener to create RBS signatures
if line.strip.start_with?(RBS_SIGNATURE_PREFIX) | ||
RBI::RBSSig.new(line[1..]) |
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.
Considering #: -> void
, we already ignore the #
fine, we also skip the :
, but we should strip the result before passing it to RBSSig.new
.
It identifies RBS signatures from method comments exported by gems.
Relies on Shopify/rbi#420
Motivation
This listener is responsible for identifying RBS signatures from method comments exported from gems.
Implementation
Duplicated YARD comment retrieval and then small processing
Tests
Added