-
Notifications
You must be signed in to change notification settings - Fork 50
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
.eex formatting? #129
Comments
+1, having the same issue I get the following error message "There is no document formatter for 'HTML (Eex)'-files installed." |
In your vscode settings, add this line. This will make vscode treat eex files as html files. You should now be able to format them however you format html. |
but this will remove the |
That doesn't actually work since it will break the |
I found a solution that works for me quite well.
Then all my |
@fklement thanks for that solution. It works perfectly! |
@fklement - Beautify is turning this:
into this:
(note the newline in the Any known workarounds? Thanks. |
@leebenson I also found this problem. But so far I haven't found a working solution. I will post it here if I find something. |
@leebenson I finally had some time to fiddle around with the formatting problem. I'm using this config now and as far as I can tell (only used it the past hours) it works quite well for my purposes.
|
I think the issue is that the .html.eex syntax needs to be implemented as an "embedded language" rather than as it is? This way it's treated as an HTML file, but has embedded elixir in <% %> sections https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide |
As @ewildgoose suggests most formatting, intellisense, autocorrect and eex syntax highlighting seem to work with
However there's still a problem as Eex tags only seem to indent at one level.
and not
Maybe someone knows how to overcome this? Beautify settings? There is some discussion of it on ElixirForum. |
In settings.json, just add this
This will consider .eex/.leex files as ERB (Rails) and preserve formatting for |
I don't know if I am supposed to share a different formater specialized for Here is the link: https://marketplace.visualstudio.com/items?itemName=ouven.vscode-yab-for-eex-leex |
Does this exist? Nothing happens when I try to auto format a file with a
.eex
extension. Am I doing something wrong?The text was updated successfully, but these errors were encountered: