-
Notifications
You must be signed in to change notification settings - Fork 22
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
Better autocomplete support #70
Comments
Hi @garazdawi ! It's an interesting idea. I think we can split the discussion in two parts:
Here things get a bit trickier. ELP is mainly implemented in Rust and, even if it comes with an Erlang side-car where we can run Erlang code, performing actions natively has its advantages. Furthermore, ELP mostly acts on source code, while I quickly went through the Did you ever consider having, instead, the shell itself acting as a LSP language client? As an example, a "TAB" in the shell would trigger a textDocument/completion request to the server, which would then take care of the rest and return a number of completion results to the client, for printing. After all, the language server works very similarly to
I don't know if there are any other languages doing this, but it would be a fun experiment to do. |
You will have to decide where you want to draw that line. When working in the shell I find that getting the type data as autocompletions greatly decreases the amount of times I need to switch to the docs. Maybe eqwalizer has some data that you can use if you don't want to use edlin?
While we could do that we would always need some bare minumum of things to work as a language server is not always available. Anyway, I opened this issue in order to make you aware that this API exists and also to see if you could use it and if any changes would be needed. |
From what I see
Yes, and it's really appreciated! I will hopefully play with this soon, most likely after the Christmas break. |
Describe the bug
I would like to have better auto-complete support, such as what is available in the Erlang shell.
Expected behavior
Today you can call this in an Erlang system:
You get a list of all the different options that gen_tcp accepts, and then if you do:
you get only the things allowed as
{active,
option. The data by this is triven by the function specs found in the system. The return format is documented here: https://www.erlang.org/doc/apps/stdlib/edlin_expand.htmlI would like ELP to either use the output from edlin_expand directly to provide autocomplete results, or that we create a new API in Erlang/OTP that ELP can use. Elixir has something call Code.Fragment
which works similarly to what I have in mind.
What do you think?
/cc @frazze-jobb
The text was updated successfully, but these errors were encountered: