Skip to content

Fix case-insensitive aggregated basename glob matching - #316387

Merged
Dmitriy Vasyura (dmitrivMS) merged 8 commits into
microsoft:mainfrom
danyalahmed1995:fix/glob-aggregate-basename-ignorecase
Aug 19, 2026
Merged

Fix case-insensitive aggregated basename glob matching#316387
Dmitriy Vasyura (dmitrivMS) merged 8 commits into
microsoft:mainfrom
danyalahmed1995:fix/glob-aggregate-basename-ignorecase

Conversation

@danyalahmed1995

Copy link
Copy Markdown
Contributor

Summary

Fixes a glob matching edge case where basename-only glob expressions did not honor ignoreCase: true after being combined by the basename aggregation fast path.

For example, matching multiple basename-only patterns such as **/BAR and **/BAZ against bar with ignoreCase: true returned null, while the equivalent single-pattern case honored ignoreCase.

The aggregate path now preserves case-insensitive matching semantics while keeping case-sensitive behavior unchanged.

Validation

Added regression coverage for aggregated basename-only glob expressions with ignoreCase: true.

Ran:

  • git diff --check
  • npm run compile-check-ts-native - failed before typechecking because tsgo is unavailable in this checkout
Copilot AI review requested due to automatic review settings May 14, 2026 09:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes case-insensitive matching for aggregated basename-only glob expressions in the base glob matcher, preserving expected ignoreCase behavior when multiple basename patterns are combined into the fast path.

Changes:

  • Passes ignoreCase into basename aggregation for both brace-expanded string patterns and expression patterns.
  • Uses case-insensitive basename comparison in the aggregate matcher when requested.
  • Adds regression coverage for multiple basename-only expression patterns with ignoreCase: true.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/vs/base/common/glob.ts Updates aggregated basename matching to honor ignoreCase.
src/vs/base/test/common/glob.test.ts Adds a regression test for case-insensitive aggregated basename expression matching.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced
Comment thread src/vs/base/common/glob.ts

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please add requested test

auto-merge was automatically disabled August 17, 2026 04:46

Head branch was pushed to by a user without write access

@danyalahmed1995

Copy link
Copy Markdown
Contributor Author
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) requested a balanced review from Copilot August 17, 2026 05:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced
@dmitrivMS

Copy link
Copy Markdown
Collaborator
Comment thread src/vs/base/common/glob.ts
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) marked this pull request as draft August 17, 2026 08:52
@danyalahmed1995

Copy link
Copy Markdown
Contributor Author

Dmitriy Vasyura (@dmitrivMS) done , preserved the expression glob casing with cached patterns

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced
Comment thread src/vs/base/common/glob.ts Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

See Copilot's comment.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@danyalahmed1995

Copy link
Copy Markdown
Contributor Author

Dmitriy Vasyura (@dmitrivMS) applied the co pilot suggestion.

@dmitrivMS

Copy link
Copy Markdown
Collaborator

Dmitriy Vasyura (Dmitriy Vasyura (@dmitrivMS)) applied the co pilot suggestion.

Is there a way to add a test for this change?

@danyalahmed1995

Copy link
Copy Markdown
Contributor Author

Dmitriy Vasyura (@dmitrivMS) Added a test for this change. It covers the reverse cache order and confirms that the matcher returns the key from the current expression. All 52 glob tests are passing.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit b29a9b3 into microsoft:main Aug 19, 2026
27 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.135.0 milestone Aug 19, 2026
Dileep Yavanmandha (dileepyavan) pushed a commit that referenced this pull request Aug 19, 2026
* Fix case-insensitive aggregated basename glob matching

* Added the requested review test

* Preserve expression glob casing with cached patterns

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Add reverse cache collision regression test

---------

Co-authored-by: Dmitriy Vasyura <dmitriv@microsoft.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

file-glob File glob engine

6 participants