Skip to content

datwaft/tree-sitter-corpus

Repository files navigation

Tree-sitter grammar for tree-sitter test files (corpus files)

Hello!

I created this grammar as a learning exercise and because I wanted to have highlighting when creating tests for tree-sitter grammars. I have a previous version of this using vim regex parsing here, if you want to see it (it is now archived as this works a lot better).

This grammar is supposed to be usable out of the box so if you have any issues or enhancements feel free to open an issue or a PR.

How do I install this grammar?

I may create a PR into the nvim-treesitter repository in the future but meanwhile you can install it like this (example for lazy.nvim):

{
  "datwaft/tree-sitter-corpus",
  dependencies = { "nvim-treesitter/nvim-treesitter" },
  build = ":TSUpdate corpus",
}

The grammar contains its own queries and configures itself, so you don't need to do anything else.

Screenshots?

Here are some screenshots (my colorscheme is catppuccin, my terminal is Wezterm and my font is Iosevka):