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 Completion throws a keymap error - expected MethodCompletion, got TextCompletion #57159

Open
astrozot opened this issue Jan 24, 2025 · 6 comments
Labels
fixed on master REPL Julia's REPL (Read Eval Print Loop)

Comments

@astrozot
Copy link

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.

@astrozot astrozot changed the title REPL Completion throw a keymap error REPL Completion throws a keymap error Jan 24, 2025
@adienes
Copy link
Contributor

adienes commented Jan 25, 2025

I think this is fixed on master

@giordano giordano added REPL Julia's REPL (Read Eval Print Loop) bisect wanted fixed on master labels Jan 25, 2025
@adienes
Copy link
Contributor

adienes commented Jan 25, 2025

it's #57138

@IanButterworth IanButterworth changed the title REPL Completion throws a keymap error REPL Completion throws a keymap error - expected MethodCompletion, got TextCompletion Jan 25, 2025
@IanButterworth
Copy link
Member

Indeed, and that's marked for backport.
I'll leave this open until it's out on a backport release, as a few of these issues have been opened.

@astrozot
Copy link
Author

Thank you for your quick replies. I will wait for the next release and stick to 1.10.7 / 1.11.2 in the meantime.

@sumiya11
Copy link
Contributor

sumiya11 commented Feb 1, 2025

I am getting similar error in 1.11.3

julia> map(t┌ 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.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/REPLCompletions.jl:1040
│      [2] completions(string::String, pos::Int64, context_module::Module, shift::Bool, hint::Bool)
│        @ REPL.REPLCompletions ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/REPLCompletions.jl:1379
│      [3] complete_line(c::REPL.REPLCompletionProvider, s::REPL.LineEdit.PromptState, mod::Module; hint::Bool)
│        @ REPL ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/REPL.jl:637
│      [4] complete_line(s::REPL.LineEdit.PromptState, repeats::Int64, mod::Module; hint::Bool)
│        @ REPL.LineEdit ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:428
│      [5] complete_line(s::REPL.LineEdit.PromptState, repeats::Int64, mod::Module)
│        @ REPL.LineEdit ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:427
│      [6] complete_line(s::REPL.LineEdit.MIState)
│        @ REPL.LineEdit ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:369
│      [7] edit_tab(s::REPL.LineEdit.MIState, jump_spaces::Bool, delete_trailing::Bool)
│        @ REPL.LineEdit ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2419
│      [8] edit_tab
│        @ ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2419 [inlined]
│      [9] (::REPL.LineEdit.var"#118#174")(::REPL.LineEdit.MIState, ::Any, ::Vararg{Any})
│        @ REPL.LineEdit ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2465
│     [10] #invokelatest#2
│        @ ./essentials.jl:1055 [inlined]
│     [11] invokelatest
│        @ ./essentials.jl:1052 [inlined]
│     [12] (::REPL.LineEdit.var"#30#31"{REPL.LineEdit.var"#118#174", String})(s::Any, p::Any)
│        @ REPL.LineEdit ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:1711
│     [13] macro expansion
│        @ ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2861 [inlined]
│     [14] macro expansion
│        @ ./lock.jl:273 [inlined]
│     [15] (::REPL.LineEdit.var"#282#284"{REPL.Terminals.TTYTerminal, REPL.LineEdit.ModalInterface, REPL.LineEdit.MIState, ReentrantLock, REPL.LineEdit.Prompt})()
│        @ REPL.LineEdit ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2851
└ @ REPL.LineEdit ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2863

@IanButterworth
Copy link
Member

It will be fixed in the next 1.10 and 1.11 releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed on master REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

No branches or pull requests

5 participants