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

Suggestions: Enable autocomplete when using Application.compile_env/3 and similar for dependency injection #541

Closed
gugahoa opened this issue May 14, 2021 · 1 comment · Fixed by #543

Comments

@gugahoa
Copy link

gugahoa commented May 14, 2021

Hi all,
I just noticed that Dialyzer can successfully output warnings and errors when we use Application.compile_env/3 for dependency injection. I was quite happy and though that maybe the language server would also give me autocomplete, but it didn't.

It seems like a great thing to have. When I looked up compile_env in this repo, I didn't find anything mentioning this, so I created a new issue.

If this seems like a good contribution to have, could you give me pointers on how to implement it?

@lukaszsamson
Copy link
Collaborator

The main difference is that dialyzer works on compiled beam files and our suggestions engine mostly work with AST. It would be quite easy to parse AST and get the env but to get the value you would need to read client configuration. The apps are theoretically loaded but I'm not sure if the config is. If you want to give it a try look into elixir_sense library. Especially

lukaszsamson added a commit to lukaszsamson/elixir-ls-1 that referenced this issue May 22, 2021
axelson pushed a commit that referenced this issue May 23, 2021
* Bump elixir_sense

Fixes #242
Fixes #541
Fixes #466

* fix test
vanjabucic pushed a commit to vanjabucic/elixir-ls that referenced this issue Jul 5, 2021
* Bump elixir_sense

Fixes elixir-lsp#242
Fixes elixir-lsp#541
Fixes elixir-lsp#466

* fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants