Skip to content

fix(cmp): reduce blink-ripgrep freeze in complex directories#1575

Merged
ayamir merged 3 commits into
0.12from
fix/blink-ripgrep-freeze
May 13, 2026
Merged

fix(cmp): reduce blink-ripgrep freeze in complex directories#1575
ayamir merged 3 commits into
0.12from
fix/blink-ripgrep-freeze

Conversation

@ayamir
Copy link
Copy Markdown
Owner

@ayamir ayamir commented May 11, 2026

Summary

  • Increase prefix_min_len from 2 to 3, reducing how often ripgrep is triggered while typing
  • Move context_size to the correct backend scope (was silently ignored under backend.ripgrep) and set it to 0 to eliminate context-line parsing overhead
  • Add --max-count=5 to additional_rg_options so ripgrep exits each file after 5 matches instead of scanning the entire tree

Test plan

  • Open a file inside a large/complex directory
  • Enter insert mode and type 3+ characters
  • Verify completion suggestions appear without freezing
  • Verify ripgrep suggestions still show up in the completion menu

Fixes #1574

- 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
@ayamir
Copy link
Copy Markdown
Owner Author

ayamir commented May 11, 2026

@Cloud0310 Can you check this PR?

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_len from 2 → 3 to reduce how often ripgrep queries are triggered while typing.
  • Move context_size to the backend scope and set it to 0 to avoid context-line parsing overhead.
  • Add --max-count=5 to 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.

@ayamir ayamir requested a review from charliie-dev May 11, 2026 01:31
Copy link
Copy Markdown
Collaborator

@charliie-dev charliie-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Cloud0310
Copy link
Copy Markdown
Contributor

@Cloud0310 Can you check this PR?

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.

@Cloud0310
Copy link
Copy Markdown
Contributor

Cloud0310 commented May 11, 2026

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.
Here's my config:

			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.

Copy link
Copy Markdown
Collaborator

@charliie-dev charliie-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ayamir ayamir merged commit c12091b into 0.12 May 13, 2026
4 checks passed
@ayamir ayamir deleted the fix/blink-ripgrep-freeze branch May 13, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0.12 branch's blink-ripgrep is causing random freeze under complex directory

4 participants