Add inferred receiver message completion. - #19701
Open
omarabedelkader wants to merge 3 commits into
Open
Conversation
Member
|
I wonder why there is not just a list with new, default and current? |
Contributor
Author
|
I thought about that, but it won't work if the user have different naming conventions or different style. |
Ducasse
reviewed
May 19, 2026
|
|
||
| fetcher := CoEmptyFetcher new. | ||
|
|
||
| receiverTypes do: [ :each | |
Member
There was a problem hiding this comment.
I do not get this code. We do a loop and we store into a variables so basically we get the last oen
Member
|
And we need to have tests. |
Member
|
So continue and make it for real |
Member
|
I wonder if we cannot improve an existing one instead of creating a new one. |
Contributor
Author
|
Ye si will investigate more, if we can improve existing one |
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.
Add inferred receiver message completion.
Before this change, completion worked well for direct receivers, but lost precision when the receiver was itself a message expression, for example:
In that case, the receiver of the current completion is
Point current, notPointdirectly. The new heuristic infers the type of that receiver expression using the existing type inferencer, then proposes selectors from the inferred type hierarchy.This avoids hardcoding selectors such as
currentordefault, and keeps the behavior generic for any class-side factory/accessor method whose return type can be inferred.