Skip to content

Add inferred receiver message completion. - #19701

Open
omarabedelkader wants to merge 3 commits into
pharo-project:Pharo14from
omarabedelkader:inferred-receiver-message-completion
Open

Add inferred receiver message completion.#19701
omarabedelkader wants to merge 3 commits into
pharo-project:Pharo14from
omarabedelkader:inferred-receiver-message-completion

Conversation

@omarabedelkader

Copy link
Copy Markdown
Contributor

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:

`Point current degree`

In that case, the receiver of the current completion is Point current, not Point directly. 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 current or default, and keeps the behavior generic for any class-side factory/accessor method whose return type can be inferred.

@Ducasse

Ducasse commented May 18, 2026

Copy link
Copy Markdown
Member

I wonder why there is not just a list with new, default and current?

@omarabedelkader

Copy link
Copy Markdown
Contributor Author

I thought about that, but it won't work if the user have different naming conventions or different style.


fetcher := CoEmptyFetcher new.

receiverTypes do: [ :each |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not get this code. We do a loop and we store into a variables so basically we get the last oen

@Ducasse

Ducasse commented May 19, 2026

Copy link
Copy Markdown
Member

And we need to have tests.

@Ducasse

Ducasse commented May 19, 2026

Copy link
Copy Markdown
Member

So continue and make it for real

@Ducasse

Ducasse commented May 20, 2026

Copy link
Copy Markdown
Member

I wonder if we cannot improve an existing one instead of creating a new one.

@omarabedelkader

Copy link
Copy Markdown
Contributor Author

Ye si will investigate more, if we can improve existing one
thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants