diff options
author | Lewis Russell <lewis6991@gmail.com> | 2023-08-10 14:21:56 +0100 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2023-08-12 16:11:36 +0100 |
commit | 2ca076e45fb3f1c08f6a1a374834df0701b8d778 (patch) | |
tree | 3338df585168c4e6455137757519ca0bcd211c8c /runtime/lua/vim/treesitter/query.lua | |
parent | 5a25dcc5a4c73f50902432e32335ab073950cceb (diff) | |
download | rneovim-2ca076e45fb3f1c08f6a1a374834df0701b8d778.tar.gz rneovim-2ca076e45fb3f1c08f6a1a374834df0701b8d778.tar.bz2 rneovim-2ca076e45fb3f1c08f6a1a374834df0701b8d778.zip |
feat(treesitter)!: incremental injection parsing
Problem:
Treesitter highlighting is slow for large files with lots of injections.
Solution:
Only parse injections we are going to render during a redraw cycle.
---
- `LanguageTree:parse()` will no longer parse injections by default and
now requires an explicit range argument to be passed.
- `TSHighlighter` now parses injections incrementally during on_win
callbacks for the line range being rendered.
- Plugins which require certain injections to be parsed must run
`parser:parse({ start_row, end_row })` before using the tree.
Diffstat (limited to 'runtime/lua/vim/treesitter/query.lua')
-rw-r--r-- | runtime/lua/vim/treesitter/query.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/runtime/lua/vim/treesitter/query.lua b/runtime/lua/vim/treesitter/query.lua index c3213e0192..3093657313 100644 --- a/runtime/lua/vim/treesitter/query.lua +++ b/runtime/lua/vim/treesitter/query.lua @@ -435,6 +435,7 @@ predicate_handlers['vim-match?'] = predicate_handlers['match?'] ---@class TSMetadata ---@field range? Range +---@field conceal? string ---@field [integer] TSMetadata ---@field [string] integer|string |