Skip to content
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

Fix ?(#TAB method search name exploration #52555

Merged
merged 2 commits into from
Dec 20, 2023

Conversation

Liozou
Copy link
Member

@Liozou Liozou commented Dec 15, 2023

Fix #52551.

This PR ensures that a SomeModule.?(...#TAB completion can only suggests method foo such that SomeModule.foo exists (by checking isdefined(SomeModule, :foo)). This is equivalent, I believe, to the initial implementation of #38791, less the bug.

Now that we have #51345, we may want to relax the above condition somewhat to include public names present in modules loaded into SomeModule, so that, for instance, a direct completion of ?( would include @assume_effects. This could be good for method exploration because even though typing @assume_effects with no qualification in Main will error, the error now includes the helpful message

Hint: a global variable of this name also exists in Base.

But that can wait for a later PR anyway, this one is just the bugfix.

The bug mentioned at #52551 (comment) dates from the initial #38791 so this could be backported as far back as v1.8.

@Liozou Liozou added REPL Julia's REPL (Read Eval Print Loop) bugfix This change fixes an existing bug labels Dec 15, 2023
@aviatesk aviatesk self-requested a review December 20, 2023 05:46
Co-authored-by: Shuhei Kadowaki <aviatesk@gmail.com>
@aviatesk
Copy link
Sponsor Member

Thanks for fixing this!

@aviatesk aviatesk merged commit a987f56 into JuliaLang:master Dec 20, 2023
4 of 7 checks passed
@Liozou Liozou deleted the fixmethodsearchnameexploration branch December 20, 2023 11:05
@Liozou
Copy link
Member Author

Liozou commented Dec 20, 2023

With pleasure! Should it be backported to 1.10?

@aviatesk
Copy link
Sponsor Member

Yeah, I think this is eligible for backport. Still, it might be wise to proceed in a manner that doesn't hold up the release, like aiming for 1.10.1 instead of 1.10.0.

@KristofferC KristofferC added the backport 1.10 Change should be backported to the 1.10 release label Dec 20, 2023
KristofferC pushed a commit that referenced this pull request Dec 23, 2023
Fix #52551.

This PR ensures that a `SomeModule.?(...#TAB` completion can only
suggests method `foo` such that `SomeModule.foo` exists (by checking
`isdefined(SomeModule, :foo)`). This is equivalent, I believe, to the
initial implementation of #38791,
less the bug.

Now that we have #51345, we may want to relax the above condition
somewhat to include public names present in modules loaded into
`SomeModule`, so that, for instance, a direct completion of `?(` would
include `@assume_effects`. This could be good for method exploration
because even though typing `@assume_effects` with no qualification in
`Main` will error, the error now includes the helpful message
```
Hint: a global variable of this name also exists in Base.
```
But that can wait for a later PR anyway, this one is just the bugfix.

The bug mentioned at
#52551 (comment)
dates from the initial #38791 so this could be backported as far back as
v1.8.

---------

Co-authored-by: Shuhei Kadowaki <aviatesk@gmail.com>
(cherry picked from commit a987f56)
@aviatesk
Copy link
Sponsor Member

Removing the backport label.

@aviatesk aviatesk removed the backport 1.10 Change should be backported to the 1.10 release label Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typing ?( in REPL help mode causes exception
3 participants