Skip to content

ST4114 incompatibility #213

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

Closed
deathaxe opened this issue Sep 3, 2021 · 1 comment
Closed

ST4114 incompatibility #213

deathaxe opened this issue Sep 3, 2021 · 1 comment

Comments

@deathaxe
Copy link

deathaxe commented Sep 3, 2021

ST's HTML syntax had to change the way how CSS/JS syntax definitions are embedded within style and script tags in order to fix a core bug. It also requires changes to how those syntaxes are to be embedded. This change unfortunatelly effects all syntaxes, which inherit HTML.

Related PR: sublimehq/Packages#2831

This broke VUE syntax.

A short look at this package revealed the following lines to be obsolete or not needed at all.

script-javascript-content:
- match: (?=\S)
embed: scope:source.js
embed_scope: source.js.embedded.html
escape: '{{script_close_lookahead}}'

A backward compatible fix was to remove the context.

An inherited syntax needs to override script-javascript-content or style-css-content only, if it wants to embed a custom CSS/JS syntax (or scope), which is not the case here.


I'd suggest to take a look at...

https://github.com/sublimehq/Packages/blob/c70117be6402c54ccf860ab8edfcba8aade46c9e/ASP/HTML%20(ASP).sublime-syntax#L37-L67

This approach might be needed for all kinds of embedded script syntaxes to ensure toggle comment is working on the first and last line properly.

rchl added a commit to rchl/vue-syntax-highlight that referenced this issue Sep 4, 2021
A non-backward compatible change was introduced in updated HTML syntax
that breaks loading of Vue syntax.

This removes context that references removed variable `script_close_lookahead`.
There is supposedly no point to overriding it in the first places since
there is no custom syntax introduced here.

Fixes vuejs#213
skyronic pushed a commit that referenced this issue Sep 9, 2021
Fixes #213

This commit applies the required patch of ST4114's HTML.sublime-syntax
in order to fix VUE's incompatibility with most recent ST, while
maintaining backward compatibility with older builds.

The relevant contexts are overridden and variables are copied over
from HTML.sublime-syntax.

Note: The `style-close-tag` was probably not needed, as it hasn't
      changed, but it is copied to maintain formal consistency with
      script tags.
@rchl
Copy link

rchl commented Sep 9, 2021

Can be closed now?

Thanks for fixing it @deathaxe btw!

@deathaxe deathaxe closed this as completed Sep 9, 2021
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

No branches or pull requests

2 participants