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

Unicode entering mode within square brackets broken #24705

Closed
Jutho opened this issue Nov 22, 2017 · 4 comments · Fixed by #31499
Closed

Unicode entering mode within square brackets broken #24705

Jutho opened this issue Nov 22, 2017 · 4 comments · Fixed by #31499
Labels
REPL Julia's REPL (Read Eval Print Loop)

Comments

@Jutho
Copy link
Contributor

Jutho commented Nov 22, 2017

Within square brackets that follow a variable (i.e. a getindex operation), tab completion for entering Unicode is broken, unless the variable in front is a Dict or an Array. I tried to trace down the error in REPLCompletetions.

I think the problem is that dict_identifier_key returns (true,nothing,nothing) for any variable (which is not a dict), such that the function completions returns early with this line:
https://github.com/JuliaLang/julia/blob/master/base/repl/REPLCompletions.jl#L493

The only exception are Arrays, since they are special cased in dict_identifier_key to return (nothing,nothing,nothing) in line
https://github.com/JuliaLang/julia/blob/master/base/repl/REPLCompletions.jl#L459

Is it my understanding that something is wrong here. I don't know much about the whole REPL module, but the name dict_identifier_key seems to suggest that it should only pick out Dicts, and should therefore return (nothing,nothing,nothing) for anything that is not a Dict.

@Jutho
Copy link
Contributor Author

Jutho commented Nov 22, 2017

Also, minimal example:

a=randn(2,2);
f=qrfact(a)
a[\+TAB]  #=> all possible Unicode completions
f[\+TAB] #=> nothing

@stevengj stevengj added the REPL Julia's REPL (Read Eval Print Loop) label Nov 22, 2017
@Jutho
Copy link
Contributor Author

Jutho commented Nov 24, 2017

If somebody could give some pointers as to the correct fix, I could try to prepare a PR.

@IlyaOrson
Copy link

I also found this recently:

# X is undefined
X["\Delta<TAB>"] # X["Δ"]
X["\Delta<TAB><TAB>"] # X["Δ"]

X = Dict("Δ" => 1)
X["\Delta<TAB>"] # X["Δ"]
X["\Delta<TAB><TAB>"] # UnicodeError

X = 1
X["\Delta<TAB>"] # no completion

@StefanKarpinski StefanKarpinski added this to the 1.0.x milestone Feb 25, 2018
@CarloLucibello
Copy link
Contributor

CarloLucibello commented Oct 30, 2018

actually for me on 1.0.1 general completion within indexing is broken, e.g.:

jualia> using DataFrames

julia> df = DataFrame(ciao=rand(3))
3×1 DataFrame
│ Row │ ciao      │
│     │ Float64   │
├─────┼───────────┤
│ 10.175749  │
│ 20.0407557 │
│ 30.0945494 │

julia> df[df.ci<Tab>            # NOT COMPLETING

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
5 participants