-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: add --no-messages flag to ripgrep to suppress file access errors #6757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixes #6756 When ripgrep encounters file access errors (e.g., permission denied), it would cause the search_files tool to return empty results. Adding the --no-messages flag suppresses these error messages while still showing pattern syntax errors, allowing the search to continue and return valid results from accessible files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewing my own code is like debugging in a mirror - everything looks backwards but the bugs are still mine.
daniel-lxs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Source for this flag: https://manpages.ubuntu.com/manpages/focal/man1/rg.1.html
Fixes #6756
Summary
This PR adds the
--no-messagesflag to the ripgrep command arguments to suppress file access error messages (e.g., permission denied errors) that were causing the search_files tool to return empty results.Problem
When ripgrep encounters files it cannot access due to permission issues, it outputs error messages that interfere with the JSON parsing of search results, causing the entire search operation to fail and return no results.
Solution
Added the
--no-messagesflag to the ripgrep arguments. According to the ripgrep documentation, this flag:Changes
src/services/ripgrep/index.tsline 153 to include--no-messagesin the ripgrep arguments arrayTesting
Important
Adds
--no-messagesflag to ripgrep command inindex.tsto suppress file access error messages, allowing search to continue with accessible files.--no-messagesflag to ripgrep command inregexSearchFiles()inindex.tsto suppress file access error messages.This description was created by
for b48d892. You can customize this summary. It will automatically update as commits are pushed.