-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Support includeIgnoredFiles option in search results #1868
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR adds support for including ignored files in the findTextInFiles tool by introducing a new optional includeIgnoredFiles parameter.
- Adds
includeIgnoredFilesboolean parameter to control whether files that are normally ignored (by.gitignore, ignore files, and VS Code exclude settings) should be included in search results - Updates the search implementation to properly configure
useExcludeSettingsanduseIgnoreFilesoptions based on this parameter - Exposes the parameter through the tool's JSON schema for AI model consumption
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/extension/tools/node/findTextInFilesTool.tsx | Adds includeIgnoredFiles parameter to the tool interface and implements logic to disable exclusion settings and ignore files when the parameter is true |
| package.json | Updates the tool schema to expose the new includeIgnoredFiles parameter with appropriate description |
| } | ||
| } | ||
|
|
||
| noMatchInstructions = `Your search pattern might be excluded completedly by either the search.exclude settings or .*ignore 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.
| noMatchInstructions = `Your search pattern might be excluded completedly by either the search.exclude settings or .*ignore files. | |
| noMatchInstructions = `Your search pattern might be excluded completely by either the search.exclude settings or .*ignore files. |
| } | ||
|
|
||
| noMatchInstructions = `Your search pattern might be excluded completedly by either the search.exclude settings or .*ignore files. | ||
| If you believe that it should have results, you can check into the .*ignore files and the exclude setting (here are some excluded patterns for reference:[${excludePaths.join(';')}] separated by ';'). |
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.
Does this seem necessary, or can it figure out how to fall back to use this parameter without the extra hint?
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.
If so, how about just a comma-separated list? Feels like you shouldn't have to explain how the list is formatted
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.
These deep indents will be in the string
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.
The extra hint will make it more stable from my tests. Let me try shorten it by using comma.
Fixes microsoft/vscode#270857
Introduce a new option to include files that are normally ignored according to .gitignore and other exclusion settings in search results.