Skip to content

Conversation

@bryanchen-d
Copy link
Contributor

@bryanchen-d bryanchen-d commented Nov 8, 2025

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.

@bryanchen-d bryanchen-d self-assigned this Nov 8, 2025
Copy link
Contributor

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 adds support for including ignored files in the findTextInFiles tool by introducing a new optional includeIgnoredFiles parameter.

  • Adds includeIgnoredFiles boolean 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 useExcludeSettings and useIgnoreFiles options 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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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 ';').
Copy link
Member

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?

Copy link
Member

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

Copy link
Member

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

Copy link
Contributor Author

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.

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.

make textSearch search files even in .gitignore

3 participants