// VSCODE-STRYKE — ENGINEERING REPORT

VS Code / VSCodium support for stryke · standalone TextMate grammar generated from the stryke binary (all 10,450 builtins) · LSP via stryke --lsp · verified with vscode-textmate

>_EXECUTIVE SUMMARY

vscode-stryke is the VS Code / VSCodium extension for stryke — a highly parallel Perl 5 superset interpreter written in Rust. It ships a declarative language contribution (filetype, grammar, editor config), an LSP client that launches stryke --lsp, and a TextMate grammar that is generated from the stryke binary's own reflection tables.

Design principle: the grammar is not a reskin of VS Code's built-in Perl grammar and not a hand-picked subset. scripts/gen_grammar.sh dumps %b (builtins), %k (keywords), and $c{parallel} from the live binary and emits a single source.stryke TextMate grammar carrying the complete language surface — all 10,450 builtins. Regenerate after a stryke upgrade and it stays in sync.

10,450
Builtins scoped
39
Parallel primitives
90
Keywords
12
Type names
1
TextMate grammar
2
Detection paths (ext + shebang)
10
Tokenizer assertions
~151
Grammar size (KB)

~COMPONENTS

FileResponsibility
package.jsonExtension manifest — contributes.languages (id stryke, *.stk, shebang firstLine), contributes.grammars (source.stryke), contributes.configuration (LSP settings), and the vscode-languageclient dependency.
language-configuration.jsonLine comment #, brackets, auto-closing / surrounding pairs, word pattern, and brace-based indentationRules.
extension.jsActivates on onLanguage:stryke and starts a LanguageClient running stryke --lsp over stdio. Missing binary → one non-fatal warning; highlighting still works.
syntaxes/stryke.tmLanguage.jsonGenerated TextMate grammar — comments / POD, shebang, strings / here-docs / regex, numbers, sigil variables, keyword categories, all 10,450 builtins, types, and operators / thread macros.
scripts/gen_grammar.shRegenerates the grammar from %b / %k / $c{parallel}. Builtin names are emitted longest-first so the alternation never matches a prefix of a longer name.
scripts/tokenize_test.jsLoads the grammar under vscode-textmate + vscode-oniguruma (the engine VS Code itself uses) and asserts the scope of 10 sample tokens.

$SCOPE MAP

Token groupTextMate scopeSample
Control flowkeyword.control.strykeif unless loop match when try defer
Concurrencykeyword.other.concurrent.strykeasync await spawn
Declarationsstorage.modifier.strykemy var val const typed use package
Fn / type introstorage.type.strykefn sub class trait struct enum impl
Phase hookskeyword.other.phase.strykeBEGIN END INIT CHECK UNITCHECK
Word operatorskeyword.operator.word.strykeand or not eq ne cmp x
Parallel builtins (39)support.function.parallel.strykepmap pgrep pfor pchannel preduce fan
Builtins (10,450)support.function.builtin.strykep say map reduce json_encode sha256 ai absorbance
Typessupport.type.strykeInt Str Float Bool Array Hash Map
Thread macroskeyword.operator.thread.stryke~> ~>> ->> |>
Literals & varsstring.* / constant.numeric / variable.*strings, here-docs, regex, sigils, $_, numbers

#VERIFICATION

The generated grammar is loaded under the exact engine VS Code uses at runtime — vscode-textmate driving vscode-oniguruma — and a sample is tokenized with the resulting scopes asserted. This proves the alternation (155 KB, 10,450 builtins) compiles under oniguruma and classifies tokens correctly, including builtins named after grammar reserved words such as contains and fold (a non-issue for TextMate regex, unlike Vim's :syntax keyword).

Sample tokenAsserted scope
fnstorage.type.stryke
saysupport.function.builtin.stryke
pmapsupport.function.parallel.stryke
absorbance (deep builtin)support.function.builtin.stryke
containssupport.function.builtin.stryke
~>keyword.operator.thread.stryke