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

.<TAB> autocomplete fails in 1.10+ for variables ending with a Unicode character #51540

Closed
pablosanjose opened this issue Oct 2, 2023 · 0 comments · Fixed by #51541
Closed

Comments

@pablosanjose
Copy link
Contributor

In v1.10+, using .<TAB> to find a variable's field names errors if the variable name ends in a Unicode character.

Demo

julia> struct T; x::Int; end

julia> β = T(1)

julia> β.<TAB>┌ Error: Error in the keymap
│   exception =
│    StringIndexError: invalid index [2], valid nearby indices [1]=>'α', [3]=>'.'
│    Stacktrace:
│      [1] string_index_err(s::String, i::Int64)
│        @ Base ./strings/string.jl:12
│      [2] getindex
│        @ Base ./strings/string.jl:470 [inlined]
│      [3] complete_identifiers!(suggestions::Vector{REPL.REPLCompletions.Completion}, ffunc::Function, context_module::Module, string::String, name::String, pos::Int64, dotpos::Int64, startpos::Int64, comp_keywords::Bool)
│        @ REPL.REPLCompletions /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/REPL/src/REPLCompletions.jl:946
│      [4] completions(string::String, pos::Int64, context_module::Module, shift::Bool)
│        @ REPL.REPLCompletions /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/REPL/src/REPLCompletions.jl:1166
│      [5] complete_line(c::REPL.REPLCompletionProvider, s::REPL.LineEdit.PromptState, mod::Module)
...

With β2 = T(2) the .<TAB> correctly autocompletes to β2.x, as in 1.9.

@pablosanjose pablosanjose changed the title β.<TAB> fails in 1.10+ for variables ending with a Unicode character .<TAB> autocomplete fails in 1.10+ for variables ending with a Unicode character Oct 2, 2023
KristofferC pushed a commit that referenced this issue Oct 3, 2023
nalimilan pushed a commit that referenced this issue Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant