Sitelet https://web.archive.org/web/20210727225320/https://github.com/JuliaLang/julia/issues/41652
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

Open
krrutkow opened this issue Jul 20, 2021 · 1 comment · May be fixed by #41679
Open

REPL lacks tab completion for non-struct types #41652

krrutkow opened this issue Jul 20, 2021 · 1 comment · May be fixed by #41679

Comments

@krrutkow
Copy link

@krrutkow krrutkow commented Jul 20, 2021

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

@JeffBezanson JeffBezanson commented Jul 21, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants