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

Tab completion on remote console #4

Closed
ConnorRigby opened this issue Feb 11, 2020 · 4 comments
Closed

Tab completion on remote console #4

ConnorRigby opened this issue Feb 11, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@ConnorRigby
Copy link
Contributor

IO servers can have their own tab expansion handlers:

fun = fn(str) ->
  {:yes, 'aa', ['aa1', 'aab', 'aac']}
end
:io.setopts(:expand_fun, fun)

We can use this to tunnel tab completion for the remote console

@ConnorRigby
Copy link
Contributor Author

and here is the Elixir implementation. It should be easy to take this exact code for the remote console, then it's just a matter of capturing the tab event from javascript

@ConnorRigby ConnorRigby added the enhancement New feature or request label Feb 11, 2020
@jjcarstens
Copy link
Collaborator

Going this route will mean we'll need to get more specific in how we handle IO in the channel because we currently ignore all setopts functions.

But, I'm pretty sure we can set this before reassigning group leader. In fact, I'm also fairly sure this is already set for us by using IEx.Server.run.

Also, I believe another issue to overcome here is that using IEx.Server.run starts a loop with IO.gets, which in turn calls to :io.get_line - The get_line is always expecting a full line at a time and evaluates the input as a whole so we can't really get tab events into it to run the evaluator. I don't have a solution, but I'm really confident that is part of the problem

@jjcarstens
Copy link
Collaborator

Also adding a note to consider IEx history (responding to up/down keys from web) here as well since that is likely very related. If it ends up being a different path, we can split out the issue

@fhunleth
Copy link
Contributor

Tab completion works on the new console!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants