IssueRaiser

[proposal] Introducing TextMate grammar system for syntax highlighting ?

## Current problem The current syntax highlighting system is very slow, and there are noticeable lags when scrolling large C++ files which contain complex syntax elements. ## Issues of tree-sitter Previously, most people suggest something like nvim-treesitter which will analyze source code in a background treesitter process and render keywords in the foreground with text-property. But is it a good idea? I don't really think so, at least 4 disadvantages for treesitter solutions: - power consumption: an extra background job is required, causing less battery life and more carbon dioxide. - buffer sync: code must be written very carefully to guarantee that the source code in two processes (vim/treesitter) are the same, coc/nvim-treesitter sends the whole buffer to the background every time `changetick` increase to prevent such things, which is a little flaky. - reliability: an external program installed by the user is not reliable enough, they are plenty of issues in version compatibilities and environment misconfig, people need to take extra efforts to get syntax highlighting work. - poor parser quality: treesitter is a great project, but language parsers are contributed by people all over the world and their quality is not under control (performance issues or inaccurate results in certain languages). Background syntax highlighter is still immature, there are still many other strange [issues](https://github.com/nvim-treesitter/nvim-treesitter/issues) in nvim-treesitter:

Posted by skywind3000 on Nov 4, 2021, 5:23 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments

github (Software)

[proposal] Introducing TextMate grammar system for syntax highlighting ?

skywind3000Nov 4, 2021, 5:23 AM

## Current problem The current syntax highlighting system is very slow, and there are noticeable lags when scrolling large C++ files which contain complex syntax elements. ## Issues of tree-sitter Previously, most people suggest something like nvim-treesitter which will analyze source code in a background treesitter process and render keywords in the foreground with text-property. But is it a good idea? I don't really think so, at least 4 disadvantages for treesitter solutions: - power consumption: an extra background job is required, causing less battery life and more carbon dioxide. - buffer sync: code must be written very carefully to guarantee that the source code in two processes (vim/treesitter) are the same, coc/nvim-treesitter sends the whole buffer to the background every time `changetick` increase to prevent such things, which is a little flaky. - reliability: an external program installed by the user is not reliable enough, they are plenty of issues in version compatibilities and environment misconfig, people need to take extra efforts to get syntax highlighting work. - poor parser quality: treesitter is a great project, but language parsers are contributed by people all over the world and their quality is not under control (performance issues or inaccurate results in certain languages). Background syntax highlighter is still immature, there are still many other strange [issues](https://github.com/nvim-treesitter/nvim-treesitter/issues) in nvim-treesitter:

Comments (0)

No comments yet. Start the discussion.

Comment on this issue