Skip to content

Update search tool to include filename matches#873

Draft
codegen-sh[bot] wants to merge 2 commits intodevelopfrom
gen/56a71c62-9a54-4106-ac87-64b9534e4c32
Draft

Update search tool to include filename matches#873
codegen-sh[bot] wants to merge 2 commits intodevelopfrom
gen/56a71c62-9a54-4106-ac87-64b9534e4c32

Conversation

@codegen-sh
Copy link
Contributor

@codegen-sh codegen-sh bot commented Mar 17, 2025

This PR updates the search tool to include filenames in search results, addressing the issue where searching for a specific filename would return no results even if the file exists.

Changes:

  • Added a filename_match field to the SearchFileResult class to indicate when a filename matches the search query
  • Updated the ripgrep implementation to use find command to search for matching filenames
  • Updated the Python implementation to check filenames against the search query
  • Added visual indication in the search results when a filename matches the query
  • Updated documentation to mention that search includes filenames

Testing:

The updated search tool will now return files whose names match the search query, even if the file content doesn't contain the query. This makes it easier to find specific files in the codebase.

For example, searching for "search.py" will now return the file even if the content doesn't contain that exact string.

Fixes the issue where the search tool was not taking into account filenames.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


codegen-bot seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

1 participant