-
Notifications
You must be signed in to change notification settings - Fork 483
[WIP] Erlang Intellisense #3121
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
base: main
Are you sure you want to change the base?
Conversation
1. Added Intellisense completion request handling for module items (syntax akin to: `MODULE:FUNC_PREFIX`). 2. Added skeleton code for other types of identifier completion This implementation relies heavily on functionality inside `Livebook.Intellisense.Elixir`, so a couple of private functions were made public. I would consider moving a lot of generic functionality from the Elixir specific modules into a separate one.
Variable completion just utilizes the current elixir infrastructure, and there's no ambiguity, as erlang variables always start with a capitalized letter. Also needed to use elixir to erlang variable name conversion from `lib/livebook/runtime/evaluator.ex`
A lot of these exports were always used in the same pipeline anyways, so I made them private and exported them as said pipeline
Erlang Intellisense: module Completion + variable Completion
Not sure whether the heuristic here is the optimal one, but it seems to work quite well.
Added function signature matching to erlang's intellisense
Erlang Intellisense docs
Erlang macros and directives completion
Atom (module), keyword and bitstring modifier completion
Erlang Intellisense signature info
Small fixes
|
Hey, thanks for the PR! I tried it locally and it is already looking great :) I found some rough edges, so I will focus on the functionality for now:
I would also suggest adding tests next, to cover various edge cases, including the list above. This way you can more confidently refactor/extend the code. |
That's totally fine. In Elixir there is |
Here is how ExDoc does it for Erlang: https://github.com/elixir-lang/ex_doc/blob/1b1fe51e479b9bcbf72802e7ef700ed3cedf53ac/lib/ex_doc/language/erlang.ex#L511-L523 |
This PR implements Intellisense functionality for erlang cells.
Status
The main functionality has been implemented, but the code needs
to be cleaned up & tests need to be added.
At the moment there is a lot of shared code between
Intellisense.ErlangandIntellisense.Elixir. We've optedfor the time being to make the functions we need public,
but we could maybe move them to a separate, shared module.
TODO:
* Builtin module attributes are currently hard-coded into
Intellisense.Erlang.IdentifierMatcher, as we haven't yet found a wayto integrate them cleanly.