Skip to content

Type to search extensions

Beast

v0.3.2

Syntax highlighting for Beast (.btsx) — indentation-first Octane TSRX

Updated 4 days ago
38 downloads 0 stars Repository ↗

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

  • .btsx file 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:vsix

Install 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

  1. Open Zed's Extensions view.
  2. Run Install Dev Extension.
  3. Select this repository.
  4. Open a .btsx file 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 check

The 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/beast

Until .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:wasm

The 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:

  1. Update the version in package.json and CHANGELOG.md.
  2. Run npm ci, npm test, and npm run package:vsix.
  3. Install and smoke-test the generated VSIX in VS Code.
  4. Authenticate vsce for the phtn publisher and run npx 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:

  1. Run npm ci, npm test, npm run test:fuzz, and npm run build:wasm.
  2. Commit the regenerated parser, tests, queries, and Wasm grammar.
  3. Update extension.toml's grammar rev to that commit and make a second commit for the pin.
  4. Publish the tested beast-language-server version and update the matching SERVER_VERSION in src/lib.rs.
  5. Bump the version in extension.toml, Cargo.toml, package.json, and tree-sitter.json.
  6. 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

ZedExt An unofficial community project. Not affiliated with Zed Industries.

Data from Zed’s extension registry and GitHub · updated