Syntax highlighting for the Warrant
authorization rule language.
Features
Highlighting for standalone .warrant files.
Highlighting inside PHP for heredocs/nowdocs labelled WARRANT:
$rules = WarrantRuleSet::fromSyntax('timesheets', <<<'WARRANT'
# only the author may edit their own draft
if is_self
they can edit, view
they cannot approve
WARRANT);
The label is the trigger — name the heredoc WARRANT and the body lights up.
Any other label is treated as a plain PHP string.
Highlighted tokens
Keywords (if they can cannot and or not), string literals with \' / \\
escapes, numbers, true/false/null, @context, :named bindings,
positional ?, the * wildcard, and # line comments.
Before publishing
Set publisher in package.json to your VS Code Marketplace publisher id
(it is currently REPLACE_WITH_YOUR_PUBLISHER_ID).
Publishing
npm i -g @vscode/vsce
vsce package # -> warrant-dsl-<version>.vsix (share or drag-install)
vsce login <publisher>
vsce publish # publish to the Marketplace