elixir-lsp / elixir-lsp/elixir_sense
Expansion of Application.compile_env/3 doesn't work with paths
- Dominant language
- Elixir
- Stars
- 340
- Forks
- 43
- PR merge metrics
- No merged PRs in 30d
Description
First, thank you so much for the amazing ElixirLS and the underlying ElixirSense. ❤️
I really like the feature of inference of application env variables when using modules attributes, which was introduced by #133. The only thing I miss is the support for expressions like `Application.compile_env(:my_app, [:key, :foo, :bar])` (see `Application.compile_env/3` docs). The PR treats `compile_env/3` and `get_env/3` the same (and similarly the bang versions) but the functions differ in whether they support paths/list in the second argument (`get_env` does not). Thus, the inference for expression like the one mentioned does not work.
As `compile_env` is a macro, it cannot be called with `apply`. But maybe in case we get `compile_env` with a path, we can call `get_env` with the first element of the path and then traverse the returned expression on our own (similarly to how it is done in the `compile_env` macro itself).
Would a PR be welcomed?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.