Tab completion in iex is instantaneous, but when I manually call 'someinput' |> Enum.reverse() |> IEx.Autocomplete.expand(), it takes several seconds to return completions. Any idea why, or how I can call this and get similarly instantaneous results? I do notice it takes an optional second argument that defaults to IEx.Broker.shell(); maybe that's something?
#IEx.Autocomplete.expand slow when called manually
24 messages · Page 1 of 1 (latest)
same thing happens for me. What are you trying to do?
Write a small filter for rlwrap. My reasons are pretty specific, just need a way to get those autocompletes at a similar speed to hitting tab in iex
the iex autocompleter assumes you're in an IEX session, it's very use-specific
Right. In this case though, I am in an IEx session, I'd just like to call the autocompleter directly
right, I'm saying that this won't work
That's why I'm kind of wondering if the second argument would do something
all the broker does is find your iex session.
you're using a lot of internal modules
I don't think they're supposed to do what you're using them to do.
I think expand is normally called from Erlang which passes in a pid. Maybe if I pass in the same pid Erlang does it'll be responsive. If that's the case, IEx.Broker.shell() isn't the right one
That's a lot of computering, I know dragons be here 😉
i'm wondering if you'll get more mileage out of something like elixir_sense.
If there's no way to call this function and get a quick return, maybe I can figure out how to use ElixirLS to give me what I need
Haven't heard of that one, I'll check it out
elixir_sense is used by elixir_ls
elixir_ls is also not very reusable.
trust me.
Gotcha
i'm deep in its code now
i guess the question I have is where does your shell context come from without a shell?
This pretty much does what I need. The first call is slow but subsequent calls are fast. I can live with that