Add targeted regex search tool for specific files#30
Open
Conversation
- Update README.md with search_regex tool documentation and examples - Tool is fully functional and tested with all edge cases covered - Maintains compatibility with existing tools and follows conventions Co-authored-by: eh-main-bot <171766998+eh-main-bot@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add tool for searching a regex pattern in a single file or across a specified list of files (with structured/truncated output)
Add targeted regex search tool for specific files
Jun 6, 2025
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #30 +/- ##
==========================================
+ Coverage 93.09% 93.12% +0.03%
==========================================
Files 33 34 +1
Lines 811 873 +62
==========================================
+ Hits 755 813 +58
- Misses 56 60 +4 ☔ View full report in Codecov by Sentry. |
EH-MLS
reviewed
Jun 6, 2025
| Args: | ||
| pattern: Regex pattern to match against file content | ||
| files: List of file paths to search (required) | ||
| context: Number of context lines to include before/after matches (optional) |
Collaborator
There was a problem hiding this comment.
Suggested change
| context: Number of context lines to include before/after matches (optional) |
no need for context param
Contributor
Author
There was a problem hiding this comment.
Removed the context parameter and simplified the implementation as requested. The tool now provides a cleaner, more focused regex search without context lines. All tests updated and passing. Changes in commit 1c6a77d.
Co-authored-by: eh-main-bot <171766998+eh-main-bot@users.noreply.github.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements a new
search_regextool that provides focused regex pattern searching in user-specified files, addressing the need for more targeted searches compared to the existing broadsearch_textfunctionality.Key Features
Implementation Details
New Tool:
search_regexKey Differences from
search_textsearch_textsearch_regexError Handling
The tool provides comprehensive error handling for:
Testing
Documentation
Updated README.md with:
This addresses the performance and usability concerns when users know exactly which files they want to search, providing a more efficient alternative to broad repository searches.
Fixes #29.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.