neovim icon indicating copy to clipboard operation
neovim copied to clipboard

Add treesitter option

Open vigoux opened this issue 4 years ago • 5 comments

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

vigoux avatar Nov 26 '20 15:11 vigoux

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)?

clason avatar Jan 27 '22 09:01 clason

I personally prefer this approach, because it might be more useful when customizing how the tree-sitter C interface is used.

vigoux avatar Apr 03 '22 11:04 vigoux

We should revisit this as part of the "Lua highlighting in core" goal for 0.8.

(scope should be buffer-local, though?)

clason avatar Aug 28 '22 10:08 clason

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.

lewis6991 avatar Sep 01 '22 22:09 lewis6991

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.)

clason avatar Sep 04 '22 11:09 clason