bytecodealliance/tree-sitter-wit

Tree Sitter grammar for Web Assembly Interface Types

23

stars

54

commits

JavaScript

primary language

Aug 1, 2026

updated

Browse cluster: Neovim Plugin Development & LuaRocks β†’

README

tree-sitter-wit

CI discord matrix

WebAssembly Interface Types (WIT) grammar for tree-sitter.

For an infographic of the WIT spec, please see the WIT Cheatsheet by Cosmonic.

Example

Example

Installation

Neovim

Neovim users can use the nvim-treesitter plugin to install the grammar.

Using Lazy.nvim package manager

  1. Add the following to your Lua configuration:

    return {
      "nvim-treesitter/nvim-treesitter",
      opts = {
          ensure_installed = {
              "wit",
          }
      }
    }
    

Manual Installation

  1. Add the following to your init.lua:

    local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
    parser_config.wit = {
      install_info = {
        url = "https://github.com/liamwh/tree-sitter-wit",
        files = { "src/parser.c" },
        maintainers = { "@liamwh" },
        branch = "main",
      }
    }
    
  2. Clone the repo

  3. Ensure you have just installed

  4. Then run just install-local from the root of the repo; this will copy the queries into the directory used by Neovim

  5. Then in Neovim run TSInstall wit

  6. And you should enjoy the syntax highlighting! Please let me know if this works for you 😊

Contributing

Please see the CONTRIBUTING.md file for more information.

Contributors

mkatychev

31 commits

liamwh

20 commits

avasich

1 commits

ribru17

1 commits

bytecodealliance/tree-sitter-wit

Tree Sitter grammar for Web Assembly Interface Types

23

stars

54

commits

JavaScript

primary language

Aug 1, 2026

updated

Browse cluster: Neovim Plugin Development & LuaRocks β†’

README

tree-sitter-wit

CI discord matrix

WebAssembly Interface Types (WIT) grammar for tree-sitter.

For an infographic of the WIT spec, please see the WIT Cheatsheet by Cosmonic.

Example

Example

Installation

Neovim

Neovim users can use the nvim-treesitter plugin to install the grammar.

Using Lazy.nvim package manager

  1. Add the following to your Lua configuration:

    return {
      "nvim-treesitter/nvim-treesitter",
      opts = {
          ensure_installed = {
              "wit",
          }
      }
    }
    

Manual Installation

  1. Add the following to your init.lua:

    local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
    parser_config.wit = {
      install_info = {
        url = "https://github.com/liamwh/tree-sitter-wit",
        files = { "src/parser.c" },
        maintainers = { "@liamwh" },
        branch = "main",
      }
    }
    
  2. Clone the repo

  3. Ensure you have just installed

  4. Then run just install-local from the root of the repo; this will copy the queries into the directory used by Neovim

  5. Then in Neovim run TSInstall wit

  6. And you should enjoy the syntax highlighting! Please let me know if this works for you 😊

Contributing

Please see the CONTRIBUTING.md file for more information.

Contributors

mkatychev

31 commits

liamwh

20 commits

avasich

1 commits

ribru17

1 commits

Languages

JavaScript

37.2%

C

21.3%

CMake

10.5%

Nix

8.4%

Tree-sitter Query

8.0%

Lua

6.3%

Just

4.7%

Shell

3.3%