elixir_sense
elixir_sense copied to clipboard
Better support for .eex files ~E and ~L
It seems that the following doesn't work when in a .eex
files, ~E
or ~L
:
- SIgnature
- Docs
- Suggestions for variables defined inside the template
I'm using ElixirSense via alchemist.vim and I opened an issue on its GitHub project related to this:
... but I didn't think it was possible, or feasible, given that the context in which an .eex template file is evaluated doesn't seem to be closely coupled to the file.
But I'm glad I seem to have been wrong!
@kenny-evitt regarding ~E
and ~L
it's totally doable. However, you're right about .eex
files. They can be "injected" in any file. Maybe, the best we could do would be to try to find the related view based on the folder/name of the template. But then it would not work when the developer does not follow the convention.
@axelson @lukaszsamson WDYT?
@msaraiva Maybe, for .eex files, the commands, or new similar commands, could accept both a line and column in the .eex file and a line and column in the relevant 'view' module file. The new commands could be named EexDoc
and EexDef
.
Yeah for plain ~E
and ~L
I think that they could be used in multiple contexts so it's impossible to know how it's going to be used. I do like what @kenny-evitt suggested, that seems like a practical compromise which will help in the majority of cases.
SIgnature and docs definitely work in (h)eex
Vars in templates tracked in https://github.com/elixir-lsp/vscode-elixir-ls/issues/279