When using cmp.config.compare.scopes on large files with : and /, this will freeze neovim for several seconds. I believe this is probably because the "scope" in treesitter somehow gets broadened to the entire file.
If I disable compare.scopes for : and /, then then there is no freezing.
Below is an demonstrative gif, using the above minimal config. With compare.scopes enabled at all times, going into command mode causes a very long delay. Commenting out compare.scopes from the config of just : and / fixes the issue.
Note the gif only demonstrates the issue with : for time-sake, but the exact same effect is observed with /
Steps to reproduce
Open a large file while having compare.scopes enabled for : and/or /
Enter search or cmdline mode via : and /, respectively
See neovim freeze for awhile.
Expected behavior
don't freeze
Actual behavior
freezes
Additional context
I'm not sure if it's possible async calls to treesitter, but that'd be an obvious solution here. Otherwise possibly disable scopes when in : and / mode, as if it's treating the entire file as "in scope", then it's not that useful of a comparator.
FAQ
Announcement
Minimal reproducible full config
Description
When using
cmp.config.compare.scopes
on large files with:
and/
, this will freeze neovim for several seconds. I believe this is probably because the "scope" in treesitter somehow gets broadened to the entire file.If I disable
compare.scopes
for:
and/
, then then there is no freezing.Below is an demonstrative gif, using the above minimal config. With
compare.scopes
enabled at all times, going into command mode causes a very long delay. Commenting outcompare.scopes
from the config of just:
and/
fixes the issue.Note the gif only demonstrates the issue with
:
for time-sake, but the exact same effect is observed with/
Steps to reproduce
compare.scopes
enabled for:
and/or/
:
and/
, respectivelyExpected behavior
don't freeze
Actual behavior
freezes
Additional context
I'm not sure if it's possible async calls to treesitter, but that'd be an obvious solution here. Otherwise possibly disable
scopes
when in:
and/
mode, as if it's treating the entire file as "in scope", then it's not that useful of a comparator.