SublimeText / ScopeNamingGuidelines

Collection of documents for scope naming guidelines in Sublime Text syntax definitions
Creative Commons Zero v1.0 Universal
12 stars 0 forks source link

[SNG-001] Remove `embedding` base scope #6

Closed deathaxe closed 7 months ago

deathaxe commented 3 years ago

Remove embedding base scope

Reasons:

  1. PHP is the only Default Syntax which uses embedding.php as top-level scope.

  2. PHP should better use text.html.php as it is more likely a dialect or templating extension of text.html.basic

    This is what ASP package does. It uses text.html.asp as top-level scope to denote the mix of html and basic syntax.

  3. The current description expresses exactly the opposite of how this scope is used by PHP.

FichteFoll commented 3 years ago

I think this makes sense, especially seeing how Php is the only syntax I know of even outside of the default packages that uses it and the ASP package already does it differently. However, we should get the upstream Php base scope to change first as a form of acknowledgement of this guideline. Afaik, Jon himself proposed the usage of embedding, so hearing his opinion on this suggestion would be helpful.

deathaxe commented 3 years ago

An issue to discuss it is opened at https://github.com/sublimehq/Packages/issues/2687

FichteFoll commented 3 years ago

Thanks. There seems to be some support on the issue, but let's wait a bit for more until we go forward with #7.

FichteFoll commented 3 years ago

FYI, there is an open PR to remove the embedding scope for the PHP synta at https://github.com/sublimehq/Packages/pull/2789, but it's currenlty on-hold because it's a significant change, I believe.

FichteFoll commented 1 year ago

Via https://github.com/sublimehq/Packages/issues/2687#issuecomment-1141242678, @deathaxe concluded that changing the base scope of Php wouldn't be worth breaking a lot of setups and the proposal was ultimately rejected (or retracted).

However, I still agree that the embedding scope should not actually be a part of the guideline and instead be mentioned as the sole exception along with a comment on how it would have been done instead if backwards-compatibility wasn't a concern, e.g. for new syntax definitions.