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

Tweak HTML/XML related selectors in settings #189

Merged
merged 3 commits into from
Dec 9, 2024

Conversation

deathaxe
Copy link
Contributor

@deathaxe deathaxe commented Dec 9, 2024

Fixes #184
Fixes #188

This PR proposes to modify html/xml related selectors to properly enable Emmet, if HTML is embedded into source or used in template syntaxes such as Astro, Jinja2, Svelte or Twig.

This commit common indentation style to all settings.

According to .editorconfig `tabs` seem preferred indentation.
Fixes emmetio#188

Ensure to detect embedded HTML code, but exclude embedded source in HTML.

This commit enables Emmet in e.g. Astro templates of scope:
`source.astro text.html.astro`.

It however disables it within embedded sources of scope `text.html source`.

related with SublimeText/Astro#10
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`.
@sergeche sergeche merged commit 76c045c into emmetio:master Dec 9, 2024
@sergeche
Copy link
Member

sergeche commented Dec 9, 2024

Thanks, published as 2.4.5

@deathaxe deathaxe deleted the fix/settings branch December 9, 2024 19:50
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 this pull request may close these issues.

Add autocompletion for custom source Enable Emmet in Elixir's EEx and HEEx templates
2 participants