-
Notifications
You must be signed in to change notification settings - Fork 230
Fully integrated Sublime 3.1 syntax changes. #140
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
Conversation
I've undone #124 now that the Sublime bug it was intended for has been fixed. As of this PR, |
@Thom1729 this seems to work really well, thank you for a pretty comprehensive and much cleaner implementation. From testing it with Sublime 3.1, everything worked fine. However, when I compiled the syntax with yaml macros, I got a diff in the output syntax file diff --git a/Vue Component.sublime-syntax b/Vue Component.sublime-syntax
index d412a0d..a2448a8 100644
--- a/Vue Component.sublime-syntax
+++ b/Vue Component.sublime-syntax
@@ -708,7 +708,7 @@ contexts:
scope: punctuation.definition.tag.end.html
set:
- include: style-close-tag
- - match: (?=\S)
+ - match: ''
embed_scope: source.sass.embedded.html
embed: scope:source.sass
escape: (?i)(?=(?:-->\s*)?</style)
@@ -722,7 +722,7 @@ contexts:
scope: punctuation.definition.tag.end.html
set:
- include: style-close-tag
- - match: (?=\S)
+ - match: ''
embed_scope: source.scss.embedded.html
embed: scope:source.scss
escape: (?i)(?=(?:-->\s*)?</style)
@@ -736,7 +736,7 @@ contexts:
scope: punctuation.definition.tag.end.html
set:
- include: style-close-tag
- - match: (?=\S)
+ - match: ''
embed_scope: source.stylus.embedded.html
embed: scope:source.stylus
escape: (?i)(?=(?:-->\s*)?</style)
(snipped for brevity) No other file has been changed. I'm using YAML Macros 3.0.4. Please do clarify the exact behaviour and aside from this looked good to me. I'll check a few more things One nice thing to note is that the new HTML implementation seems to have fixed #134 as well. |
That change should have been checked in. I'll recompile it and commit tomorrow morning. |
I've fixed the problem. The root cause was an issue with dynamically reloading macros, which I'm looking into a fix for. |
That doesn't affect this pull request right? It should be an issue with the yaml Macros. |
@yyx990803 I can confirm that everything seems to work as expected, and there's no issue I could see in the code at this time. You can tag a new release from the @Thom1729 Thanks again! Merging the PR now. |
Updates the
HTML.yaml
base syntax to the latest version from core. The core syntax has been updated substantially since 3.0.The most noteworthy change is a new way of parsing
<script>
and<style>
type
attributes. The old way (which this package extended) was based on regexp lookaheads, and it was not very reliable. The new way is much more robust, and this PR uses the new approach for thelang
attribute of<script>
,<style>
, and<template>
tags. To implement the new approach in this PR, I offloaded most of the boilerplate to a new macro.Hopefully, this should solve any remaining problems with language detection.
Example of code that should now be correctly highlighted: