emmetio / sublime-text-plugin

The essential toolkit for web-developers
https://emmet.io
MIT License
255 stars 30 forks source link

Add autocompletion for custom source #188

Open dylanfisher opened 3 months ago

dylanfisher commented 3 months ago

Hi, thanks for your work on this plugin, and apologies if this has already been brought up in another issue or documentation. I tried to research how to enable this functionality, but was unable to figure it out.

I want to enable emmet tab completion for .astro files (https://astro.build/) in the same way .html files are handled.

How would I configure emmet to register this source as a html scope?

Screenshot 2024-08-18 at 9 58 53 AM

sergeche commented 3 months ago

You need to open Emmet preferences and update syntax_scopes.html to make Emmet understand that given syntax should be treated as HTML, and add/update abbreviation_scopes so plugin can understand where to activate abbreviation

dylanfisher commented 3 months ago

Thank you, I was looking in these areas, but didn't get the config just right. Does the following seem appropriate? Here's what is working for me now, in case anyone else comes across this issue.

"syntax_scopes": {
  "html": "text.html - source - meta.attribute-with-value.style | source.astro",
},
"abbreviation_scopes": [
  "(text.html | text.xml) - source - meta - comment | source.astro",
]