elixir-lsp / elixir-lsp/elixir-ls

Feature request: Quick Fix for adding function

Open
#382 1 comment 1 reaction 0 assignees View on GitHub
enhancement help wanted
Dominant language
Elixir
Stars
1.8k
Forks
227
Avg merge
31m
Merged PRs (30d)
2

Description

One feature I miss from a previous life in Eclipse/Java is the ability to quick fix an "is undefined or private" error by adding the function at the end of the correct module. For example, if I am writing code and come across the need to get all users for a particular country, but that doesn't currently exist in the Accounts context, I might write:

```elixir
assign(socket, :users_in_country, Accounts.get_all_users_for_country(country))
```

and then ElixirLS would complain that `MyApp.Accounts.get_all_users_for_country/1 is undefined or private`.

The quick fix would insert the following to the end of the `MyApp.Accounts` module and jump over to that file:

```elixir
def get_all_users_for_country(country) do

end
end
```
with the cursor inside the function, ready to implement it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.