nour

nour

It all depends on the plugin.
As youknow,all these plugins are developped by simple independant developpers so it’s normal to find bugs.
No plugin is proviedby Microsoft.

0
Post #11
OvermindDL1

OvermindDL1

That is if they are to handle sub-context support manually, but that is something that should be handled by the editor backend itself though.

1
Post #12
jayjun

jayjun

Atom ships with Tree-sitter now, which understands your code semantically rather than pretend to with regex (TextMate grammar). Syntax highlighting and auto-formatting embedded languages would theoretically be far superior.

There are no Tree-sitter parsers implemented for Elixir or EEx yet. But since VS Code hasn’t indicated support, developer experience on Atom may pull ahead once a parser is made.

2
Post #13
fklement

fklement

That’s not really directly related to auto formatting, but I think here is a good place to publish this.
When you use vscode-elixir it really drove me crazy how commenting on interpolated elixir tags inside an .html.eex file broke through the complete syntax code.
So I just opened a PR to vscode-elixir that solves that problem by simple using the normal html multiline comment tags.
https://github.com/fr1zle/vscode-elixir/pull/146

2
Post #14
arijoon

arijoon

VS Code does support embedded languages: Syntax Highlight Guide | Visual Studio Code Extension API

1
Post #15
OvermindDL1

OvermindDL1

Ooo nice! It’s about time it does! I hope extensions take advantage of it without users needing to do manual configuration like that! :slight_smile:

0
Post #16
arijoon

arijoon

I’ve been trying to modify the vscode-elixir-ls to use it all night, but no luck so far, if anyone knows of other extensions that take advantage of that feature let us know it’ll be helpful to see some examples. (I tried to mimic what Ruby extension does but didn’t work out very well)

1
Post #17
edwildgoose

edwildgoose

ping…

Yes, this is also driving me mad about the EEX formatting in VSCode.

I also found the embedded language support instructions and tried to figure out what was needed to support vscode-elixir-ls, but couldn’t figure it out…

Did you raise a bug on this with vscode-elixir-ls? Perhaps someone there has more idea?

2
Post #18
tme_317

tme_317

For VSCode, I use the Prettier plugin for most filetypes but as stated earlier in this thread that breaks .html.eex files.

What I found works great is to install the Beautify plugin and configure it to only affect EEx:

  "beautify.language": {
    "js": [],
    "css": [],
    "html": [
      "HTML (EEx)"
    ]
  }

If you are using ST3 you’ll want to use the HTML-CSS-JS Prettify plugin.

I still haven’t figured out how to get syntax highlighting or auto-formatting to apply to inline LiveView as the ~L sigil is treated as a normal heredoc string.

Hope this helps someone!

4
Post #19
arijoon

arijoon

I have created this pull request:
https://github.com/JakeBecker/vscode-elixir-ls/pull/136

But it does not work just as you expect, the beautify solution should be the best option available at the moment

0
Post #20