Beast
Language support for Beast (.btsx), the indentation-first component language
that compiles to Octane-native TSRX.
This repository ships extensions for both Visual Studio Code and Zed.
Features
.btsxfile detection- Syntax highlighting for source declarations, selectors, attributes, text, Octane control flow, comments, embedded TypeScript, and scoped CSS
- Indentation-aware folding, editor indentation, comments, and bracket pairs
- Compiler diagnostics, completion, navigation, hover details, document links,
symbols, and workspace component references through
beast-language-server - A Beast: Restart Language Server command for troubleshooting
The VS Code package bundles the language server, so users do not need to install Node.js or a global npm package.
VS Code development
Install dependencies and create a local VSIX:
npm ci
npm test
npm run package:vsixInstall the generated beastjs-<version>.vsix with Extensions: Install from
VSIX..., or open this repository in VS Code and press F5 to launch an
Extension Development Host.
The Beast Language Server output channel contains server logs. Set
beast.trace.server to messages or verbose when protocol tracing is
needed.
Zed development
- Open Zed's Extensions view.
- Run Install Dev Extension.
- Select this repository.
- Open a
.btsxfile and confirm the language selector shows Beast.
After changing grammar.js or src/scanner.c, regenerate and verify the
parser before reinstalling the development extension:
npm ci
npm test
npm run build:wasm
cargo checkThe Zed extension prefers beast-language-server from the worktree
environment. Otherwise, it installs beast-language-server@0.2.2, pinned in
src/lib.rs, through Zed's npm runtime. This server uses Beast/Octane 0.12.1
and includes the required @tsrx/oxc@0.20.0 Node compiler parser.
For a release smoke test, use a project with Beast/Octane 0.12.1. Confirm
syntax highlighting, a mapped compiler error, TypeScript member completion,
and go-to-definition. Check zed: open log for installation or server-start
errors.
Neovim development
The grammar is shared with Zed. Neovim reference queries live in
queries/beast; they use Neovim captures and combined TypeScript/CSS
injection ranges. CI tests the generated parser on Linux, macOS, and Windows
and validates these queries with ts_query_ls.
Build and validate the reference queries locally:
npx tree-sitter build -o beast.so
ts_query_ls check -f queries/beastUntil .btsx detection is included in Neovim, register the filetype in your
configuration:
vim.filetype.add({ extension = { btsx = "beast" } })Grammar development
npm test validates both editor distributions. For Zed it validates TOML,
regenerates the parser, runs the corpus, parses feature-complete fixtures,
compiles every query, and compiles the C parser and scanner with warnings
treated as errors. For VS Code it type-checks the client, bundles the client
and language server, and inspects the final package contents.
Additional checks:
npm run test:fuzz
npm run build:wasmThe tree-sitter grammar is in grammar.js; indentation and
JavaScript/TypeScript expression boundaries are handled by src/scanner.c.
Zed queries and language configuration are under languages/beast. VS Code's
TextMate grammar and language configuration are in syntaxes and
language-configuration.json.
Publishing to VS Code Marketplace
The Marketplace extension identifier is phtn.beastjs. Before the first
release, create or gain access to the phtn publisher in the Visual Studio
Marketplace. Then:
- Update the version in
package.jsonandCHANGELOG.md. - Run
npm ci,npm test, andnpm run package:vsix. - Install and smoke-test the generated VSIX in VS Code.
- Authenticate
vscefor thephtnpublisher and runnpx vsce publish.
The package task runs vscode:prepublish, so the checked VSIX always contains
fresh client and server bundles.
Publishing to Zed
The Zed extension manifest pins the grammar to an immutable commit. For every release:
- Run
npm ci,npm test,npm run test:fuzz, andnpm run build:wasm. - Commit the regenerated parser, tests, queries, and Wasm grammar.
- Update
extension.toml's grammarrevto that commit and make a second commit for the pin. - Publish the tested
beast-language-serverversion and update the matchingSERVER_VERSIONinsrc/lib.rs. - Bump the version in
extension.toml,Cargo.toml,package.json, andtree-sitter.json. - Update the extension's submodule and matching version in
zed-industries/extensions.
The extension repository and grammar URL must remain publicly accessible over HTTPS, and the pinned grammar revision must remain reachable.
Publishing for nvim-treesitter
No npm package is needed: nvim-treesitter downloads this repository at a
pinned commit and builds the C parser. Update its Beast parser revision, copy
the reference queries to runtime/queries/beast, regenerate its supported
language list, and test installation both with the checked-in parser and
with parser generation enabled.
Before submitting upstream, follow its contribution requirements, including Neovim core filetype detection. Changes to core filetype detection go to Vim first, then are ported to Neovim.
Support
See SUPPORT.md for issue-reporting guidance.
License
MIT