Skip to content

REPL Completion throws a keymap error - expected MethodCompletion, got TextCompletion #57159

@astrozot

Description

@astrozot

In a fresh Julia 1.10.8 session, if I type map(a followed by a TAB key (for completion), I get the following error message

julia> map(a┌ Error: Error in the keymap
│   exception =
│    TypeError: in typeassert, expected REPL.REPLCompletions.MethodCompletion, got a value of type REPL.REPLCompletions.TextCompletion
│    Stacktrace:
│      [1] complete_keyword_argument(partial::String, last_idx::Int64, context_module::Module)
│        @ REPL.REPLCompletions ~/.julia/juliaup/julia-1.10.8+0.x64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPLCompletions.jl:964
│      [2] completions(string::String, pos::Int64, context_module::Module, shift::Bool)
│        @ REPL.REPLCompletions ~/.julia/juliaup/julia-1.10.8+0.x64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPLCompletions.jl:1261
│      [3] complete_line(c::REPL.REPLCompletionProvider, s::REPL.LineEdit.PromptState, mod::Module)
│        @ REPL ~/.julia/juliaup/julia-1.10.8+0.x64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:545
│      [4] complete_line(s::REPL.LineEdit.PromptState, repeats::Int64, mod::Module)
│        @ REPL.LineEdit ~/.julia/juliaup/julia-1.10.8+0.x64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/LineEdit.jl:376
│      [5] complete_line(s::REPL.LineEdit.MIState)
│        @ REPL.LineEdit ~/.julia/juliaup/julia-1.10.8+0.x64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/LineEdit.jl:367
│      [6] edit_tab(s::REPL.LineEdit.MIState, jump_spaces::Bool, delete_trailing::Bool)
│        @ REPL.LineEdit ~/.julia/juliaup/julia-1.10.8+0.x64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/LineEdit.jl:2320
│      [7] edit_tab
│        @ ~/.julia/juliaup/julia-1.10.8+0.x64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/LineEdit.jl:2320 [inlined]
│      [8] (::REPL.LineEdit.var"#114#170")(::REPL.LineEdit.MIState, ::Any, ::Vararg{Any})
│        @ REPL.LineEdit ~/.julia/juliaup/julia-1.10.8+0.x64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/LineEdit.jl:2366
│      [9] #invokelatest#2
│        @ ./essentials.jl:892 [inlined]
│     [10] invokelatest
│        @ ./essentials.jl:889 [inlined]
│     [11] (::REPL.LineEdit.var"#27#28"{REPL.LineEdit.var"#114#170", String})(s::Any, p::Any)
│        @ REPL.LineEdit ~/.julia/juliaup/julia-1.10.8+0.x64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/LineEdit.jl:1612
│     [12] prompt!(term::REPL.Terminals.TextTerminal, prompt::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
│        @ REPL.LineEdit ~/.julia/juliaup/julia-1.10.8+0.x64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/LineEdit.jl:2749
│     [13] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
│        @ REPL.LineEdit ~/.julia/juliaup/julia-1.10.8+0.x64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/LineEdit.jl:2651
│     [14] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
│        @ REPL ~/.julia/juliaup/julia-1.10.8+0.x64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:1312
│     [15] (::REPL.var"#62#68"{REPL.LineEditREPL, REPL.REPLBackendRef})()
│        @ REPL ~/.julia/juliaup/julia-1.10.8+0.x64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:386
└ @ REPL.LineEdit ~/.julia/juliaup/julia-1.10.8+0.x64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/LineEdit.jl:2751
julia> 

The same problem appears in version 1.11.3; it was not apparent in 1.10.7 or 1.11.2.

I am running Julia on a Intel MacBook Pro.

Metadata

Metadata

Assignees

No one assigned

    Labels

    REPLJulia's REPL (Read Eval Print Loop)completionsTab and autocompletion in the replfixed on master

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions