Conversation
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @bpaseroMatched files:
|
|
NOTE: I have file search working locally with this and other changes, but prefer to split the changes into multiple PRs for ease of review and/or discussions/feedback. |
There was a problem hiding this comment.
Pull Request Overview
This PR adds case-insensitive glob pattern matching support to the VS Code glob utility. The implementation includes a new ignoreCase option for glob patterns and introduces several string comparison utility functions.
Key changes:
- Added
equals(),endsWithIgnoreCase()functions to the strings module and refactoredstartsWithIgnoreCase()for consistency - Extended glob matching API to support an
ignoreCaseoption viaIGlobOptions - Updated internal glob implementation to use case-insensitive comparison functions when
ignoreCaseis enabled - Added comprehensive test coverage for new string functions and case-insensitive glob matching
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/vs/base/common/strings.ts | Adds equals() and endsWithIgnoreCase() functions, refactors startsWithIgnoreCase(), replaces deprecated substr() with substring() |
| src/vs/base/test/common/strings.test.ts | Adds comprehensive tests for equals() and endsWithIgnoreCase() functions |
| src/vs/base/common/glob.ts | Implements case-insensitive glob matching by adding ignoreCase option, updates internal functions to use comparison utilities, replaces substr() with substring() |
| src/vs/base/test/common/glob.test.ts | Adds test coverage for case-insensitive glob matching with various patterns |
|
FYI - second PR dependent on this (in draft): |
bpasero
left a comment
There was a problem hiding this comment.
This is overall a well engineered PR as far as I can tell. Only 1 comment about how we could simplify the match method. See below.
bpasero
left a comment
There was a problem hiding this comment.
@dmitrivMS can we do a follow up PR then to adopt a few places where we seem to be doing some toLowercase magic to get case insensitive matching today:
|
@bpasero Yep, absolutely, I had the same idea and started on it, but wanted to have it as a separate PR. |
* Support case-insensitive glob * PR feedback * PR feedback
|
Follow up PR: #273837 |
First step towards fixing #10633 and many related duplicates.
This PR adds an option to enable case-insensitive glob expressions and matching.
The new option is not used here and default behavior is the same as before.
The option will be used by follow up PRs to enable case-insensitive behavior in various features.