Skip to content

Error: Error in the keymap in autocompleting properties involving copy of adjoint matrices #55856

Closed
@jishnub

Description

@jishnub

This is triggered by the copy(A'). line in the following (might need to wait for a few seconds after the dot):

julia> A = zeros(2,2)
2×2 Matrix{Float64}:
 0.0  0.0
 0.0  0.0

julia> copy(A').┌ Error: Error in the keymap
│   exception =
│    BoundsError: attempt to access 0-element UnitRange{Int64} at index [1]
│    Stacktrace:
│      [1] throw_boundserror(A::UnitRange{Int64}, I::Int64)
│        @ Base ./essentials.jl:14
│      [2] _getindex
│        @ ./range.jl:946 [inlined]
│      [3] getindex
│        @ ./array.jl:3082 [inlined]
│      [4] complete_identifiers!(suggestions::Vector{REPL.REPLCompletions.Completion}, context_module::Module, string::String, name::String, pos::Int64, separatorpos::Int64, startpos::Int64; comp_keywords::Bool, complete_modules_only::Bool, shift::Bool)
│        @ REPL.REPLCompletions ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/REPL/src/REPLCompletions.jl:1200
│      [5] complete_identifiers!
│        @ ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/REPL/src/REPLCompletions.jl:1113 [inlined]
│      [6] completions(string::String, pos::Int64, context_module::Module, shift::Bool, hint::Bool)
│        @ REPL.REPLCompletions ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/REPL/src/REPLCompletions.jl:1475
│      [7] complete_line(c::REPL.REPLCompletionProvider, s::REPL.LineEdit.PromptState, mod::Module; hint::Bool)
│        @ REPL ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/REPL/src/REPL.jl:774
│      [8] check_for_hint(s::REPL.LineEdit.MIState)
│        @ REPL.LineEdit ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:385
│      [9] (::REPL.LineEdit.var"#186#187")(s::REPL.LineEdit.MIState, data::Any, c::Union{Char, SubString{String}, String})
│        @ REPL.LineEdit ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:2538
│     [10] #invokelatest#1
│        @ ./essentials.jl:1048 [inlined]
│     [11] invokelatest
│        @ ./essentials.jl:1045 [inlined]
│     [12] (::REPL.LineEdit.var"#match_input##0#match_input##1"{REPL.LineEdit.var"#186#187", String})(s::Any, p::Any)
│        @ REPL.LineEdit ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:1722
│     [13] macro expansion
│        @ ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:2872 [inlined]
│     [14] macro expansion
│        @ ./lock.jl:287 [inlined]
│     [15] (::REPL.LineEdit.var"#prompt!##2#prompt!##3"{REPL.Terminals.TTYTerminal, REPL.LineEdit.ModalInterface, REPL.LineEdit.MIState, ReentrantLock, REPL.LineEdit.Prompt})()
│        @ REPL.LineEdit ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:2862
└ @ REPL.LineEdit ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:2874

julia> versioninfo()
Julia Version 1.12.0-DEV.1242
Commit c3af4fc2456 (2024-09-24 09:48 UTC)
Build Info:
  Official https://julialang.org release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × Intel(R) Core(TM) i5-10310U CPU @ 1.70GHz
  WORD_SIZE: 64
  LLVM: libLLVM-18.1.7 (ORCJIT, skylake)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)
Environment:
  JULIA_EDITOR = subl

Julia nightly installed using juliaup. I can replicate this on v"1.10.5" and v"1.11.0-rc3" as well. On v1.10, I needed to press TAB after the dot to trigger the error, whereas on v1.11 and nightly, this happens right after the dot if I wait for a few seconds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorcompletionsTab and autocompletion in the repl

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions