fix(cmp): reduce blink-ripgrep freeze in complex directories#1575
Conversation
- Increase prefix_min_len from 2 to 3 to reduce trigger frequency - Move context_size to correct backend scope and set to 0 - Add --max-count=5 to limit rg output per file Fixes #1574
|
@Cloud0310 Can you check this PR? |
There was a problem hiding this comment.
Pull request overview
This PR adjusts the blink-ripgrep completion provider configuration to reduce UI freezes when editing within large/complex directory trees, addressing issue #1574.
Changes:
- Increase
prefix_min_lenfrom 2 → 3 to reduce how often ripgrep queries are triggered while typing. - Move
context_sizeto thebackendscope and set it to0to avoid context-line parsing overhead. - Add
--max-count=5to ripgrep options so it stops scanning each file after a small number of matches.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Yeap, my fix is the same idea here, just 3 prefix, and max 200K file size is enough on my situation. For now, just two of those is enough for me. |
|
I suggest we remove the extra option for ripgrep, and just use prefix 3 and max size as 200K. I would love to test further. ripgrep = {
module = "blink-ripgrep",
name = "Ripgrep",
opts = {
prefix_min_len = 3,
backend = {
use = "gitgrep-or-ripgrep",
ripgrep = {
context_size = 3,
max_filesize = "200K",
},
},
},
score_offset = -15,
max_items = 3,
},Here, according the docs of blink-ripgrep, I added gitgrep as backend, ref as it may have better performance with git tracked files. |
Summary
prefix_min_lenfrom 2 to 3, reducing how often ripgrep is triggered while typingcontext_sizeto the correctbackendscope (was silently ignored underbackend.ripgrep) and set it to 0 to eliminate context-line parsing overhead--max-count=5toadditional_rg_optionsso ripgrep exits each file after 5 matches instead of scanning the entire treeTest plan
Fixes #1574