Skip to content
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

Enable Emmet in Elixir's EEx and HEEx templates #184

Closed
distefam opened this issue May 29, 2023 · 2 comments · Fixed by #189
Closed

Enable Emmet in Elixir's EEx and HEEx templates #184

distefam opened this issue May 29, 2023 · 2 comments · Fixed by #189

Comments

@distefam
Copy link

Would it be possible to add support for Elixir files with embedded HTML? They are supported in VSCode using Emmet so it should be possible I think.

@sergeche
Copy link
Member

sergeche commented May 31, 2023

I think you can add support via preferences by passing proper scope selectors for your syntax.
You should check syntax_scopes and abbreviation_scopes options.

@distefam
Copy link
Author

distefam commented Jul 4, 2023

You are correct, thank you. I was able to append "source.elixir text.html.heex", to the abbreviation_scopes list.

deathaxe added a commit to deathaxe/Emmet that referenced this issue Dec 9, 2024
Fixes emmetio#184
Fixes Sublime-Instincts/BetterTwig#40

This commit fixes abbreviations being disabled in various template syntaxes
such as Jinja2 or Twig, which use common `text.html meta.template` scope to
enable template related snippets and completions in all sub-syntaxes with
easy/short selectors.

Instead of excluding all meta scopes by `- meta`, only relevant ones are,
which indicate embedded or interpolated templating code or html tags.

`text.html.cfml - meta.tag` is removed as it is coverd by
`text.html - text.html meta.tag`.

Note each negative selector is prefixed with `text.html` to make sure to match
only parts within HTML/XML, even if it is embedded in another source code.
That's required to keep abbreviations working in e.g. `source.astro text.html`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants