Skip to content

REPL: Handle message from complete_methods! when max methods is hit#57138

Merged
IanButterworth merged 1 commit intoJuliaLang:masterfrom
IanButterworth:ib/repl_completion_fix
Jan 23, 2025
Merged

REPL: Handle message from complete_methods! when max methods is hit#57138
IanButterworth merged 1 commit intoJuliaLang:masterfrom
IanButterworth:ib/repl_completion_fix

Conversation

@IanButterworth
Copy link
Copy Markdown
Member

It appears #56963 wasn't a proper fix (although curiously it did appear to work #56963 (comment))

Reported on 1.11.3 https://discourse.julialang.org/t/sympy-makes-repl-to-stuck/124814/11

julia> using SymPy
Precompiling SymPy...
  19 dependencies successfully precompiled in 11 seconds. 33 already precompiled.

julia> sympy.apart(33/4)
8.25000000000000

julia> @syms n
(n,)

julia> ex = 1/(n*(n+3))
    1    
─────────
n⋅(n + 3)

julia> sympy.apart(e┌ 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
│        @ ~/.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#14
│        @ ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:428
│      [5] complete_line
│        @ ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:427
│      [6] complete_line
│        @ ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:369
│      [7] edit_tab (repeats 2 times)
│        @ ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2419
│      [8] #118
│        @ ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2465
│      [9] #invokelatest#2
│        @ ./essentials.jl:1055 [inlined]
│     [10] invokelatest
│        @ ./essentials.jl:1052 [inlined]
│     [11] #30
│        @ ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:1711
│     [12] macro expansion
│        @ ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2861 [inlined]
│     [13] macro expansion
│        @ ./lock.jl:273 [inlined]
│     [14] #282
│        @ ~/.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 IanButterworth added the REPL Julia's REPL (Read Eval Print Loop) label Jan 23, 2025
@newptcai
Copy link
Copy Markdown

I got this problem on 1.11.3 when I type

sympy.apart(e┌ Error: Error in the keymap

and hit tab.

This PR fixed it.

@IanButterworth IanButterworth added backport 1.10 Change should be backported to the 1.10 release backport 1.11 Change should be backported to release-1.11 labels Jan 23, 2025
@IanButterworth IanButterworth merged commit 88c71dd into JuliaLang:master Jan 23, 2025
@danielwe
Copy link
Copy Markdown
Contributor

Looks like this might also fix #57127? I'm not able to verify myself at the moment, but it's the same error.

@giordano
Copy link
Copy Markdown
Member

giordano commented Mar 3, 2025

Do we have a regression test for this already?

@IanButterworth
Copy link
Copy Markdown
Member Author

No, I didn't immediately see a way to. It may not be complicated.

@giordano
Copy link
Copy Markdown
Member

giordano commented Mar 3, 2025

A systematic reproducer for me is for example rand(Fl<TAB>, #57127 used write(x<TAB>

@KristofferC KristofferC mentioned this pull request Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

REPL Julia's REPL (Read Eval Print Loop)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants