-
Notifications
You must be signed in to change notification settings - Fork 179
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
Support methods invoked on self #1195
Conversation
@@ -82,7 +85,7 @@ def markdown_from_index_entries(title, entries) | |||
markdown_title = "```ruby\n#{title}\n```" | |||
definitions = [] | |||
content = +"" | |||
entries.each do |entry| | |||
Array(entries).each do |entry| |
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.
Interesting. This wasn't caught by Sorbet before?
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.
Oh, it might be a mistake I made splitting the commits. I think I included the signature change for this method in the wrong commit, separate from the code changes. Sorbet did identify that Array
required Kernel
.
d425972
to
1b640a2
Compare
1b640a2
to
63823e7
Compare
63823e7
to
d45ab4a
Compare
Motivation
Big step towards #899
I got frustrated that we keep getting feedback about missing method support and powered through some basic implementations.
This PR adds support for
self
(since the receiver is known)We are not taking inheritance into account yet, this is just a first step. The same ideas from this PR can be applied to singleton methods once #1113 is merged.
Then we'll just be missing inheritance and methods with unknown receivers.
Implementation
I recommend reviewing per commit. For the most part, all implementations just use
resolve_method
or check method owners when necessary.The only exception is workspace symbol. We were just not supporting the method kind, which completely implements the functionality.
Automated Tests
Added tests for all of these.