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

Use SHIFT-TAB to force showing method suggestions #45673

Merged
merged 1 commit into from
Jun 16, 2022

Conversation

Liozou
Copy link
Member

@Liozou Liozou commented Jun 14, 2022

Fix #45671

Before:

julia> convert(#TAB
convert( too many methods to show )

This PR:

julia> convert(#TAB
convert( too many methods, use SHIFT-TAB to show )

julia> convert(#SHIFT-TAB
convert(::Type{AbstractChar}, x::Number) in Base at char.jl:183
convert(::Type{T}, c::T) where T<:AbstractChar in Base at char.jl:187
convert(::Type{AbstractArray{T}}, a::AbstractArray) where T in Base at abstractarray.jl:17
# etc., all methods are shown

Someone should probably check that the small gf.c diff is legal.

@KristofferC
Copy link
Sponsor Member

Why not put it back as it was before? Did anyone complain about this?

@Liozou
Copy link
Member Author

Liozou commented Jun 14, 2022

I don't know, this was introduced as part of #43865.
Personally I prefer to keep the warning because I often try to TAB-complete stuff, and I'm not a big fan of having hundreds of lines blurting unexpectedly on my REPL. For the case of method completion here, I most often use it just to check at a glance whether there is a method for my argument types: if there are too many possible methods, I'd rather not see them and just try the method call. But having the possibility to see them is obviously useful in other setups, so I agree with the issue you opened, hence this PR.

@jakobnissen
Copy link
Contributor

I too, would prefer showing a limited amount of methods so the REPL doesn't get flooded, with an opt-in to showing all (that is, I like this PR). No strong opinions though.

@Liozou
Copy link
Member Author

Liozou commented Jun 16, 2022

CI errors look unrelated (although I didn't see the Profile error on tester_win32 elsewhere). Let me know if there is anything else I can do.

@KristofferC KristofferC merged commit fa2f304 into JuliaLang:master Jun 16, 2022
@Liozou Liozou deleted the forceshowmanymethods branch June 16, 2022 12:38
@Liozou
Copy link
Member Author

Liozou commented Jun 21, 2022

Do you want to backport this to v1.8-rc2? It might make sense if you consider #45671 to be a regression compared to v1.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REPL tab completion now stops showing methods when there are "too many"
3 participants