sublime-text-plugin icon indicating copy to clipboard operation
sublime-text-plugin copied to clipboard

Add autocompletion for custom source

Open dylanfisher opened this issue 1 year ago • 2 comments

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

dylanfisher avatar Aug 18 '24 17:08 dylanfisher

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

sergeche avatar Aug 19 '24 08:08 sergeche

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",
]

dylanfisher avatar Aug 19 '24 16:08 dylanfisher