Developer Tools · Systems

Tree Sitter WIT

A tree-sitter grammar for WebAssembly Interface Types (WIT), bringing syntax-aware tooling to the Component Model.

Active · 2024

Rust · Tree-sitter · WebAssembly

Tree Sitter WIT

I originally created tree-sitter-wit to bring proper editor and tooling support to WebAssembly Interface Types, usually shortened to WIT.

WIT is the interface definition language used by the WebAssembly Component Model. It gives components a way to describe the functions, resources, records, variants, worlds, imports, and exports they expose. At the time I started this project, WIT was becoming increasingly important in the WebAssembly ecosystem, but the surrounding developer experience still felt early. In particular, editing .wit files lacked the kind of syntax-aware support that developers expect from modern tooling.

tree-sitter-wit is a Tree-sitter grammar for WIT. That means it can parse WIT source files into a structured syntax tree, enabling editor features such as syntax highlighting, folding, injections, and other syntax-aware behaviour. The original motivation was fairly practical: I wanted WIT files to feel first-class in my editor rather than like plain text with a few keywords coloured in.

The project grew into more than a small highlighting experiment. It includes the grammar itself, Tree-sitter query files, generated parser sources, tests, and bindings for multiple language ecosystems. It can be used from Neovim via nvim-treesitter, as a Rust crate, and as a general Tree-sitter grammar wherever WIT parsing is useful.

I later donated the project to the Bytecode Alliance so it could live closer to the WebAssembly ecosystem it was built for. That felt like the right home for it: WIT is not my language, and a parser for it is most useful when it is maintained as part of the broader open-source infrastructure around WebAssembly.

This is a small project in terms of code size, but it represents the kind of open-source work I enjoy: identifying a missing piece of developer infrastructure, building the practical tool, and then putting it where it can be maintained and reused by the wider community.

Open chat

Interested in working together? Reach out.

Strategy, architecture, and implementation — from workflow to production.

© 2026 Liam Woodleigh. All rights reserved.