neovim
neovim copied to clipboard
Add treesitter option
This option can be used to enable treesitter features for a given buffer / globally.
For now the bare minimum is done, and is still very wip.
The roadmap is the following :
- [X] Create option
- [X] Setup highlighting when
set treesitter=hl
is done - [ ] Remove highlighting when
set treesitter=
is done
Is this something we want to revisit? Or is it superseded by nvim-treesitter's module system (i.e., this is the approach that should eventually come into core, when stable)?
I personally prefer this approach, because it might be more useful when customizing how the tree-sitter C interface is used.
We should revisit this as part of the "Lua highlighting in core" goal for 0.8.
(scope should be buffer-local, though?)
We should revisit this as part of the "Lua highlighting in core" goal for 0.8.
(scope should be buffer-local, though?)
It can only be buffer-local since extmarks are buffer local.
An alternative would be to mirror the vim.lsp.start({...})
pattern, where the table could contain options like whether regex syntax is still run, the location of the parser and the queries, etc. (with reasonable defaults) that people can put in a manual FileType
autocommand for 0.8.
(Later, we can set these up automatically.)