You could add a color scheme rule to match that meta scope only when it appears in the syntax of your choosing, and then the color would only apply to that specific color scheme. If you swap color schemes that requires more setup work though. If you’re doing something that you intend to share with others, that adds more complications as well.
If you want to do an outline or underline of the text then I think the only way to pull that off is with regions, though, and for that you’d need a plugin. Trivially you’d write a function that applies a region to the scope you want and then invoke it from an on_load_async
and on_modified_async
event handler.
As long as text is edited inside of the region, the boundaries will adjust automatically (and they’ll move if the text around them is shifted). However wholesale replacement or additions to the beginning or the end won’t be included automatically.
I don’t think you can use the -ish
colors in the view.add_regions()
call though; I think you can only use scopes in that position. Assuming I’m remembering that correctly that adds its own wrinkle for determining what scope has the color you want.