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 lacks tab completion for non-struct types #41652

Closed
krrutkow opened this issue Jul 20, 2021 · 1 comment · Fixed by #41679
Closed

REPL lacks tab completion for non-struct types #41652

krrutkow opened this issue Jul 20, 2021 · 1 comment · Fixed by #41679
Labels
good first issue Indicates a good issue for first-time contributors to Julia REPL Julia's REPL (Read Eval Print Loop)

Comments

@krrutkow
Copy link

Defining propertynames for non-struct types is not enough to enable tab completion in the REPL, as is being done with Cptr (analytech-solutions/CBinding.jl#77) and eventually with Ptr (JuliaInterop/Clang.jl#316). It appears to be prevented because of the following isstructtype check:

elseif Base.isstructtype(typeof(b))

And indeed, defining something like Base.isstructtype(::Type{<:Cptr}) = true gets tab completion working, but is fairly a cringe-worthy workaround. Is this a bug in (or feature request for) the REPL? Or is there another approach besides the isstructtype workaround?

@JeffBezanson
Copy link
Member

It looks to me like the call to isstructtype can just be removed; calling propertynames on a primitive type returns () by default so there is no harm.

@JeffBezanson JeffBezanson added REPL Julia's REPL (Read Eval Print Loop) good first issue Indicates a good issue for first-time contributors to Julia labels Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Indicates a good issue for first-time contributors to Julia REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants