diff options
author | Riley Bruins <ribru17@hotmail.com> | 2025-01-01 11:33:45 -0800 |
---|---|---|
committer | Christian Clason <ch.clason+github@icloud.com> | 2025-01-07 16:43:45 +0100 |
commit | d9ee0d2984e5fc30cb032785d32f42c72c7e64e1 (patch) | |
tree | e4f3c6e9be47fb20dcef3cfa0253da7699e50ce7 /runtime/lua/vim/lsp/util.lua | |
parent | b67fcd0488746b079a3b721ae4800af94cd126e1 (diff) | |
download | rneovim-d9ee0d2984e5fc30cb032785d32f42c72c7e64e1.tar.gz rneovim-d9ee0d2984e5fc30cb032785d32f42c72c7e64e1.tar.bz2 rneovim-d9ee0d2984e5fc30cb032785d32f42c72c7e64e1.zip |
perf(treesitter): don't fetch parser for each fold line
**Problem:** The treesitter `foldexpr` calls `get_parser()` for each
line in the buffer when calculating folds. This can be incredibly slow
for buffers where a parser cannot be found (because the result is not
cached), and exponentially more so when the user has many
`runtimepath`s.
**Solution:** Only fetch the parser when it is needed; that is, only
when initializing fold data for a buffer.
Co-authored-by: Jongwook Choi <wookayin@gmail.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
0 files changed, 0 insertions, 0 deletions