-
Notifications
You must be signed in to change notification settings - Fork 40
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
Syntax with_prototype recursion issue #6555
Comments
Docs are out-dated. This strategy to extend existing syntax definitions is out-dated and has been replaced by syntax inheritance (via The way To learn more about that, check out packages like Astro, Jinja2, Laravel Blade Highlighter, Liquid/Jeykyll, MDX, Mustache, Ngx HTML, Twig, Svelte, Vue all of which using syntax inheritance. Even builtin syntax definitions such as ASP, ERB, Go Templates, JSP, PHP have been updated to use inheritance. Other examples are Less, SCSS (Sass package) and PostCSS, all of which extend ST's CSS. |
Otherwise duplicate of #4061. |
With regards to Djaneiro: Jinja2 and Django syntax definitions should be covered by Jinja2 package. Same applies for Django Syntax package. |
Took a look at those packages and still struggling with how to override previous contexts without Reference file is here: https://github.com/squ1b3r/Djaneiro/blob/304a85adcf9320c54b121623784b3a576f4ec4b3/Syntaxes/HTML%20(Django).sublime-syntax |
One major difference between
Extending HTML just puts those patterns into the extended syntax, but not in one of its "children" recursively. Each such child syntax needs to be extended from its base to add desired additions (template tags). Unfortunatelly this requires a bunch of boilerplate code at the moment. See HTML (Jinja) for instance. We still bet and hope for #3787 to be able to avoid that by just providing some scope variable to be replaced by extending syntaxes. That said, ... as Jinj2 package already provides good and up-to-date syntax definitions, I wonder why re-invent the wheel? What does Djaneiro's syntax offer beyound Jinja2? I had a look at Django Syntax, which doesn't do except for the Wouldn't it be more effective to maintain a single syntax definition and re-use it? |
I've been running into this issue with LoneBoco/razor-sublime#3. It looks like the recursion protection introduced in build 4075 had a regression in build 4181. The last working build was 4178. |
@deathaxe Should I create a new issue for the regression in the recursion protection? It seems this issue is focusing more on documentation. |
That's not a regression of ST. We just hit the limits of its original recursion protection capabilities by adding HTML syntax highlighting support to JavaScript template strings. The way how HTML is extended using ST seems to be not able to detect recursions of such converted statements. However, even if it was, the way It would at least require I can only recommend to follow the already long list of template syntaxes by extending HTML. It requires a bit more boilerblate, sure, but it has various other advantages. We've for instance reduced PHP's size by about 70-75% and significantly reduced its compile time and increased parsing performance heavily using that new approach. |
The problem is that I can't use |
Thanks for your help @deathaxe The Djaneiro package goes beyond just the django templating language and include python snippets that I've memorized the shortcuts for, as well as a URL indexer that autocompletes {% url %} view names that is a giant productivity booster. |
Sure, I saw its extends. The question was about how to avoid duplicate Jinja syntax definitions. |
Description of the bug
Using
as recommended in the docs is now throwing a
Apparent recursion within a with_prototype action: 25000 context sanity limit hit
error.Steps to reproduce
Start Sublime
Use Djaneiro Plugin
Error appears in html file.
Expected behavior
No error
Actual behavior
Apparent recursion within a with_prototype action: 25000 context sanity limit hit
error.Sublime Text build number
4186
Operating system & version
macOS 14.7.1
(Linux) Desktop environment and/or window manager
No response
Additional information
No response
OpenGL context information
No response
The text was updated successfully, but these errors were encountered: