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

REPL.REPLCompletions BoundsError, "Error in the keymap" #51505

Closed
nsajko opened this issue Sep 29, 2023 · 2 comments · Fixed by #51522
Closed

REPL.REPLCompletions BoundsError, "Error in the keymap" #51505

nsajko opened this issue Sep 29, 2023 · 2 comments · Fixed by #51522
Labels
regression Regression in behavior compared to a previous version REPL Julia's REPL (Read Eval Print Loop)
Milestone

Comments

@nsajko
Copy link
Contributor

nsajko commented Sep 29, 2023

julia> const a = max
max (generic function with 12 methods)

julia> a(
         (),┌ Error: Error in the keymap
│   exception =
│    BoundsError: attempt to access 0-element Vector{Any} at index [0]
│    Stacktrace:
│      [1] getindex
│        @ ./essentials.jl:13 [inlined]
│      [2] repl_eval_ex(ex::Any, context_module::Module)
│        @ REPL.REPLCompletions ~/tmp/jl/jl/julia-d3fb3b6e48/share/julia/stdlib/v1.11/REPL/src/REPLCompletions.jl:571
│      [3] detect_args_kwargs(funargs::Vector{Any}, context_module::Module, default_any::Bool, broadcasting::Bool)
│        @ REPL.REPLCompletions ~/tmp/jl/jl/julia-d3fb3b6e48/share/julia/stdlib/v1.11/REPL/src/REPLCompletions.jl:729
│      [4] complete_methods_args
│        @ ~/tmp/jl/jl/julia-d3fb3b6e48/share/julia/stdlib/v1.11/REPL/src/REPLCompletions.jl:749 [inlined]
│      [5] _complete_methods(ex_org::Expr, context_module::Module, shift::Bool)
│        @ REPL.REPLCompletions ~/tmp/jl/jl/julia-d3fb3b6e48/share/julia/stdlib/v1.11/REPL/src/REPLCompletions.jl:625
│      [6] complete_methods
│        @ ~/tmp/jl/jl/julia-d3fb3b6e48/share/julia/stdlib/v1.11/REPL/src/REPLCompletions.jl:630 [inlined]
│      [7] completions(string::String, pos::Int64, context_module::Module, shift::Bool)
│        @ REPL.REPLCompletions ~/tmp/jl/jl/julia-d3fb3b6e48/share/julia/stdlib/v1.11/REPL/src/REPLCompletions.jl:1122
│      [8] complete_line(c::REPL.REPLCompletionProvider, s::REPL.LineEdit.PromptState, mod::Module)
│        @ REPL ~/tmp/jl/jl/julia-d3fb3b6e48/share/julia/stdlib/v1.11/REPL/src/REPL.jl:547
│      [9] check_for_hint(s::REPL.LineEdit.MIState)
│        @ REPL.LineEdit ~/tmp/jl/jl/julia-d3fb3b6e48/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:384
│     [10] (::REPL.LineEdit.var"#139#195")(s::REPL.LineEdit.MIState, data::Any, c::Union{Char, SubString{String}, String})
│        @ REPL.LineEdit ~/tmp/jl/jl/julia-d3fb3b6e48/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2486
│     [11] #invokelatest#2
│        @ Base ./essentials.jl:899 [inlined]
│     [12] invokelatest
│        @ Base ./essentials.jl:896 [inlined]
│     [13] (::REPL.LineEdit.var"#27#28"{REPL.LineEdit.var"#139#195", String})(s::Any, p::Any)
│        @ REPL.LineEdit ~/tmp/jl/jl/julia-d3fb3b6e48/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:1670
│     [14] prompt!(term::REPL.Terminals.TextTerminal, prompt::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
│        @ REPL.LineEdit ~/tmp/jl/jl/julia-d3fb3b6e48/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2807
│     [15] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
│        @ REPL.LineEdit ~/tmp/jl/jl/julia-d3fb3b6e48/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2709
│     [16] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
│        @ REPL ~/tmp/jl/jl/julia-d3fb3b6e48/share/julia/stdlib/v1.11/REPL/src/REPL.jl:1339
│     [17] (::REPL.var"#64#70"{REPL.LineEditREPL, REPL.REPLBackendRef})()
│        @ REPL ~/tmp/jl/jl/julia-d3fb3b6e48/share/julia/stdlib/v1.11/REPL/src/REPL.jl:388
└ @ REPL.LineEdit ~/tmp/jl/jl/julia-d3fb3b6e48/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2809
julia> 
julia> versioninfo()
Julia Version 1.11.0-DEV.568
Commit d3fb3b6e489 (2023-09-29 03:37 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × AMD Ryzen 3 5300U with Radeon Graphics
  WORD_SIZE: 64
  LLVM: libLLVM-15.0.7 (ORCJIT, znver2)
  Threads: 1 on 8 virtual cores
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS =

So the exception is thrown right after typing (),. This was a fresh REPL session.

@nsajko
Copy link
Contributor Author

nsajko commented Sep 29, 2023

Disabling completion hinting is a workaround: Base.active_repl.options.hint_tab_completes = false.

@vtjnash vtjnash added REPL Julia's REPL (Read Eval Print Loop) regression Regression in behavior compared to a previous version labels Sep 29, 2023
@vtjnash vtjnash added this to the 1.11 milestone Sep 29, 2023
@IanButterworth IanButterworth self-assigned this Sep 29, 2023
@IanButterworth
Copy link
Member

Appears to be happening to a line introduced in #51454 cc. @aviatesk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression Regression in behavior compared to a previous version REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants