-
Notifications
You must be signed in to change notification settings - Fork 8
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
Switch to new embed
feature once 3153 is stable
#50
Comments
I just successfully implemented this, but unfortunately the Notice how everything goes to crap after the interpolation ends. The way we are currently doing it with |
I’m not sure there’s any way around this — even if the nested context could be retained after leaving the interpolated sequence, it could easily be invalid on account of whatever got "black boxed" by the interpolation. That is, if I have a grammar that expects X Y Z, but considers X Z unintelligible, and the interpolation is like X ${ 'Y' } Z, there would be no recovery regardless of context. I ran into this when I did the StyledJSX stuff: the built-in CSS syntax definition freaked out every time a property value was interpolated. To deal with it I ended up implementing a light, purely (or nearly purely) lexical grammar for CSS within ES Sublime: https://github.com/bathos/Ecmascript-Sublime/blob/master/ecmascript.sublime-syntax#L5379-L5480 This approach happened to work well with CSS because it’s easy to reduce to small lexical constructs and its structure has little impact on producing good highlighting. It likely wouldn’t be as effective with most languages, which would end up loosing detail/correctness in more noticeable ways. |
'Fixed' in 646e0e4 |
The
embed
feature allows nesting syntaxes by naming their scope rather than their syntax definition file. It also overcomes bugs introduced by sub-syntaxes eating up the escape tokens by allowing a specified regex to always supersede the sub-syntax's context rules.https://forum.sublimetext.com/t/dev-build-3153/33014/8
The text was updated successfully, but these errors were encountered: