Syntax highlighting for spintax templates in Visual Studio Code —
engine-accurate against the @spintax/core
contract and verified headlessly with vscode-tmgrammar-test. Applies to .spintax and
.gtw files.
Construct
Example
Enumeration
{a\|b\|c}
Permutation
[<minsize=2;maxsize=3;sep=", ">a\|b\|c]
Variable
%name%
Local set
#set %name% = value
Include
#include "slug-or-id"
Conditional
{?VAR?then\|else} · {?!VAR?…}
Plural
{plural %n%: one\|few\|many}
Comment
/# … #/
Example
/# hero block #/
#set %product% = Acme
{Welcome to|Meet} %product% — %tagline%, trusted since {2019|2020}.
Ships with [<minsize=2;maxsize=3;sep=", ";lastsep=" and ">SSO|audit logs|alerts]{?free? — free tier available|}.
You have %n% {plural %n%: message|messages}.
Install
Marketplace: open the Extensions view (Ctrl/Cmd+Shift+X),
search Spintax, and install — or run code --install-extension 301st.spintax.
From VSIX: download the .vsix from the latest release
and run Extensions: Install from VSIX….
Features
Full, engine-accurate tokenization of every spintax construct, including nested spintax
inside conditional branches and enumerations.
Correct permutation config:<minsize=…;sep=…> is config, while HTML inside items
([<li>a</li>|b], [<a href="/x">…</a>|b]) is content — not mis-highlighted as config.
Genuine separators ([<and>a|b], [a<, >|b]) are highlighted.
Strict conditional / plural openers — {??x} and {plural noun} are not mis-highlighted.
Block-comment toggle (/# … #/) and auto-closing of {}, [], %%, "".