elixir_sense icon indicating copy to clipboard operation
elixir_sense copied to clipboard

Better support for .eex files ~E and ~L

Open msaraiva opened this issue 5 years ago • 4 comments

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

msaraiva avatar Aug 07 '19 21:08 msaraiva

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 avatar Aug 08 '19 16:08 kenny-evitt

@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 avatar Sep 05 '19 18:09 msaraiva

@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.

kenny-evitt avatar Sep 06 '19 15:09 kenny-evitt

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.

axelson avatar Sep 06 '19 18:09 axelson

SIgnature and docs definitely work in (h)eex

lukaszsamson avatar Oct 30 '22 06:10 lukaszsamson

Vars in templates tracked in https://github.com/elixir-lsp/vscode-elixir-ls/issues/279

lukaszsamson avatar Nov 06 '22 23:11 lukaszsamson