A number of calls to change the language have been justified in part by argument…s for better tab completion. It seems time to separate these issues by improving discoverability in a way that integrates with multiple dispatch. With this PR, `?(x, y)TAB` completes methods that can be called with `(x, y)`, and `?(x, yTAB` (without the closing `)`) completes methods called with `(x, y, ...)`. There is also limited module-scoping available (only one layer deep).
An alternative to `?` would be to have the cursor positioned where the function name should be supplied.
I'm happy to discuss changes to this, but depending on whether a couple of other deadlines evaporate I might not have time to make any substantive changes here for a while...so let me say at the outset that I'd be just fine with someone taking this over if desired. Or, it can sit until I get time.
Demos:
```julia
julia> InteractiveUtils.?("hello")[TAB]
apropos(string) in REPL at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.7/REPL/src/docview.jl:727
clipboard(x) in InteractiveUtils at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.7/InteractiveUtils/src/clipboard.jl:60
code_llvm(f) in InteractiveUtils at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.7/InteractiveUtils/src/codeview.jl:178
code_native(f) in InteractiveUtils at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.7/InteractiveUtils/src/codeview.jl:199
edit(path::AbstractString) in InteractiveUtils at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.7/InteractiveUtils/src/editless.jl:195
edit(f) in InteractiveUtils at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.7/InteractiveUtils/src/editless.jl:223
eval(x) in InteractiveUtils at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.7/InteractiveUtils/src/InteractiveUtils.jl:3
include(x) in InteractiveUtils at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.7/InteractiveUtils/src/InteractiveUtils.jl:3
less(file::AbstractString) in InteractiveUtils at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.7/InteractiveUtils/src/editless.jl:256
less(f) in InteractiveUtils at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.7/InteractiveUtils/src/editless.jl:264
report_bug(kind) in InteractiveUtils at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.7/InteractiveUtils/src/InteractiveUtils.jl:385
separate_kwargs(args...; kwargs...) in InteractiveUtils at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.7/InteractiveUtils/src/macros.jl:7
julia> InteractiveUtils.?("hello")[SHIFT-TAB] # this excludes duck-typed methods
edit(path::AbstractString) in InteractiveUtils at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.7/InteractiveUtils/src/editless.jl:195
less(file::AbstractString) in InteractiveUtils at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.7/InteractiveUtils/src/editless.jl:256
julia> ?([1 2; 3 4], 1, 1)[SHIFT-TAB]
LinRange(start, stop, len::Integer) in Base at range.jl:427
StepRangeLen(ref::R, step::S, len::Integer) where {R, S} in Base at range.jl:366
broadcast(f, x::Number...) in Base.Broadcast at broadcast.jl:824
broadcast(f, avs::Union{Number, LinearAlgebra.Adjoint{T, var"#s828"} where var"#s828"<:(AbstractVector{T} where T) where T}...) in LinearAlgebra at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.7/LinearAlgebra/src/adjtrans.jl:281
broadcast(f, tvs::Union{Number, LinearAlgebra.Transpose{T, var"#s828"} where var"#s828"<:(AbstractVector{T} where T) where T}...) in LinearAlgebra at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.7/LinearAlgebra/src/adjtrans.jl:282
broadcast(f::Tf, As...) where Tf in Base.Broadcast at broadcast.jl:821
broadcast!(f::Tf, dest, As::Vararg{Any, N}) where {Tf, N} in Base.Broadcast at broadcast.jl:860
checkbounds(A::AbstractArray, I...) in Base at abstractarray.jl:608
circshift!(dest::AbstractArray, src, shiftamt) in Base at multidimensional.jl:1116
clamp(x::X, lo::L, hi::H) where {X, L, H} in Base.Math at math.jl:65
clamp!(x::AbstractArray, lo, hi) in Base.Math at math.jl:93
copyto!(dest::AbstractArray, dstart::Integer, src) in Base at abstractarray.jl:846
error(s::Vararg{Any, N}) where N in Base at error.jl:40
fill(v, dims::Union{Integer, AbstractUnitRange}...) in Base at array.jl:449
get(A::AbstractArray, i::Integer, default) in Base at abstractarray.jl:1411
getindex(A::Array, i1::Int64, i2::Int64, I::Int64...) in Base at array.jl:788
getindex(A::Array, i1::Integer, I::Integer...) in Base at abstractarray.jl:1167
getindex(A::Array, i1::Union{Integer, CartesianIndex}, I::Union{Integer, CartesianIndex}...) in Base at multidimensional.jl:637
getindex(A::AbstractArray, I...) in Base at abstractarray.jl:1161
isassigned(a::Array, i::Int64...) in Base at array.jl:201
isassigned(a::AbstractArray, i::Integer...) in Base at abstractarray.jl:505
map(f, x::Number, ys::Number...) in Base at number.jl:238
mapreduce(f, op, a::Number) in Base at reduce.jl:419
rand(X, d::Integer, dims::Integer...) in Random at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.7/Random/src/Random.jl:283
repeat(A::AbstractArray, counts...) in Base at abstractarraymath.jl:223
reshape(parent::AbstractArray, dims::Int64...) in Base at reshapedarray.jl:116
reshape(parent::AbstractArray, dims::Union{Int64, AbstractUnitRange}...) in Base at reshapedarray.jl:110
reshape(parent::AbstractArray, dims::Union{Colon, Int64}...) in Base at reshapedarray.jl:117
selectdim(A::AbstractArray, d::Integer, i) in Base at abstractarraymath.jl:122
setindex!(A::Array{T, N} where N, x, i1::Int64) where T in Base at array.jl:825
setindex!(A::Array, v, i1::Union{Integer, CartesianIndex}, I::Union{Integer, CartesianIndex}...) in Base at multidimensional.jl:639
setindex!(A::AbstractArray, v, I...) in Base at abstractarray.jl:1258
similar(a::AbstractArray{T, N} where N, dims::Union{Integer, AbstractUnitRange}...) where T in Base at abstractarray.jl:735
view(A::AbstractArray, I::Vararg{Any, N}) where N in Base at subarray.jl:164
```
Closes #30052
xref #38704
xref #37993