Closed a1ro closed 5 months ago
Sorry for the late response on this one. I do have a working version of refactoring the syntax using Inheritance (that follows the same changes as this branch), but I just haven't gotten around to completing it yet, due to work. It's also on lower priority for me since Inheritance is much better, maintenance & cache size wise, but the highlighting still remains the same.
Here's the issue that's tracking V2.0.0
release https://github.com/Sublime-Instincts/BetterJinja/issues/13. I do plan to get to it sometime late December to early next year, hopefully🤞
Hi! Is there anything an outsider can do to help get either this PR or v2.0.0 out?
Actually a templating syntax should always be extended from its base syntax (e.g.: HTML, JSON, YAML, ...) with contexts from the template (jinja) being added to proper contexts.
Examples are:
Closing as superseeded by #22
Hi,
This PR fixes Issue #7 and aims to replace PR #10, this time using the much simpler approach of Syntax inheritance, available since Sublime Text build
4075
(released on July 10, 2020).Here are a few key points of this pull request:
HTML
, plainJinja
orHTML (Jinja)
syntax for their files..sls
extension), but not for Playbooks (which use the generic.yml
extension).For a quick explanation, syntax variants can be added by following those steps:
<Your language> (Jinja).sublime-syntax
.name
,file_extensions
andscope
keys.extends
key to inherit the variables and contexts from the parent syntax.main
context of the parent syntax, matching both the source language and Jinja.To make sure the parent syntax can be updated without touching the variants, I added a
base
context with in turn includes the relevant contexts.Let me know if you would like to change things before merging.