Skip to content

Conversation

@dmitrivMS
Copy link
Contributor

@dmitrivMS dmitrivMS commented Oct 31, 2025

Add ignoreCase option to constructor and use case-insensitive glob API to support it. Added some unit-tests as well.

Contributes towards fixing #10633.

Copilot AI review requested due to automatic review settings October 31, 2025 00:51
@dmitrivMS dmitrivMS enabled auto-merge (squash) October 31, 2025 00:51
@dmitrivMS dmitrivMS self-assigned this Oct 31, 2025
@vs-code-engineering vs-code-engineering bot added this to the October 2025 milestone Oct 31, 2025
@dmitrivMS dmitrivMS added the file-glob File glob engine label Oct 31, 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 case-insensitive matching support to the IgnoreFile class for handling ignore files (like .gitignore). This allows paths to be matched against ignore patterns regardless of case when the ignoreCase flag is enabled.

Key changes:

  • Added an ignoreCase parameter to the IgnoreFile constructor and propagated it through the matching logic
  • Updated string comparison to use startsWithIgnoreCase when case-insensitive matching is enabled
  • Added comprehensive test coverage for case-insensitive ignore file matching
  • Fixed several spelling errors in comments ("Preservering" → "Preserving", "expectred" → "expected", "ouside" → "outside", "naieve" → "naive")

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/vs/workbench/services/search/common/ignoreFile.ts Added ignoreCase parameter to constructor, imported startsWithIgnoreCase utility, updated path matching logic to support case-insensitive comparisons, and fixed spelling errors in comments
src/vs/workbench/services/search/test/common/ignoreFile.test.ts Updated test helper functions to accept ignoreCase parameter and added new test suite for case-insensitive matching scenarios
Comments suppressed due to low confidence (1)

src/vs/workbench/services/search/common/ignoreFile.ts:32

  • The updateContents method doesn't preserve the ignoreCase setting when re-parsing the ignore file. This could cause the ignore file to switch from case-insensitive to case-sensitive (or vice versa) after an update. The parseIgnoreFile call should pass this.ignoreCase to maintain consistency, or the internal isPathIgnored function should close over this.ignoreCase properly.
	updateContents(contents: string) {
		this.isPathIgnored = this.parseIgnoreFile(contents, this.location, this.parent);

@dmitrivMS dmitrivMS merged commit cd52822 into main Nov 2, 2025
28 checks passed
@dmitrivMS dmitrivMS deleted the dev/dmitriv/glob-ignore-file branch November 2, 2025 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

file-glob File glob engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IgnoreFile compares file paths in a case-sensitive way on windows/macOS

3 participants