Fix case-insensitive aggregated basename glob matching - #316387
Conversation
There was a problem hiding this comment.
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
ignoreCaseinto 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. |
Dmitriy Vasyura (dmitrivMS)
left a comment
There was a problem hiding this comment.
Please add requested test
Head branch was pushed to by a user without write access
|
Danyal Ahmed (@danyalahmed1995) Thank you! |
66e5be7
|
Dmitriy Vasyura (@dmitrivMS) done , preserved the expression glob casing with cached patterns |
Dmitriy Vasyura (dmitrivMS)
left a comment
There was a problem hiding this comment.
See Copilot's comment.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Dmitriy Vasyura (@dmitrivMS) applied the co pilot suggestion. |
Is there a way to add a test for this change? |
|
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. |
* 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>
Summary
Fixes a glob matching edge case where basename-only glob expressions did not honor
ignoreCase: trueafter being combined by the basename aggregation fast path.For example, matching multiple basename-only patterns such as
**/BARand**/BAZagainstbarwithignoreCase: truereturnednull, while the equivalent single-pattern case honoredignoreCase.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 --checknpm run compile-check-ts-native- failed before typechecking becausetsgois unavailable in this checkout