Skip to content

Treesitter

Highlight dart function calls in neovim

Made the following edit to highlights.scm file and pasted in ~/.config/nvim/queries/dart/highlights.scm:

1724947722.png

Test that it works by opening this file in neovim.

Building grammar files

After mods to the grammar.js files, do:

tree-sitter generate
tree-sitter parse test.dart

Or if you want to try the result in neovim:

tree-sitter generate
tree-sitter build
nvim
:lua vim.treesitter.language.add('dart', { path = '/home/vector/development/tree-sitter-dart/dart.so' })

tree-sitter build will generate .so file that neovim needs.


Comments