Skip to content

[REPL] Autocompletion of kwargs for some common functions no longer works #57836

Closed
@mbauman

Description

@mbauman

In 1.10.7 and 1.11.2, one could autocomplete, for example, using DataFrames; show(df, allrTAB and get show(df, allrows=. This no longer works on 1.10.9 and 1.11.4.

Kwarg completions on functions with more than 40 methods was subsequently disabled due to #54131. But that case is quite extreme! An MWE here that emulates what PyCall is doing is:

struct F; end
Base.getproperty(::F, ::Symbol) = Any[cos, sin][rand(1:2)]
f = F()
f.bar(<TAB>

In short, this asks for tab completion on (::Any)(...) — that is, every method in the system! All 30k+ of them. So, yeah, that's gonna be sluggish.

The fix in #56963 used MAX_METHOD_COMPLETIONS to limit this. That's set to 40, based upon a display limitation. I think it'd be reasonable to increase this to something like 500, which would cover nearly all functions. In the examples above, finding the allrows kwarg for show — which has 304 methods with DF.jl loaded on 1.11.2 — has no noticeable latency.

Could we increase the limit here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    REPLJulia's REPL (Read Eval Print Loop)completionsTab and autocompletion in the repl

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions