Skip to content

Ordered evaluation in FileSystemGlobbing Matcher - #114720

Closed
kasperk81 wants to merge 0 commit into
dotnet:mainfrom
kasperk81:main
Closed

Ordered evaluation in FileSystemGlobbing Matcher#114720
kasperk81 wants to merge 0 commit into
dotnet:mainfrom
kasperk81:main

Conversation

@kasperk81

Copy link
Copy Markdown
Contributor

Recommend review with whitespace diffs off because converting ordered/unordered helpers to local functions caused indentation changes.

Resolve#109408

@ghost

Copy link
Copy Markdown

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

1 similar comment
@ghost

Copy link
Copy Markdown

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@kasperk81

Copy link
Copy Markdown
ContributorAuthor

@jeffhandley@ericstj@jozkee please take a look at this approved API implementation so it doesn't miss the .NET 10 release.

@ericstj
ericstj requested a review from CopilotMay 22, 2025 15:52

CopilotAI 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 adds support for ordered filter evaluation in the FileSystemGlobbing matcher by introducing a flag, updating the matching logic, and expanding tests accordingly.

  • Introduce preserveFilterOrder flag and overloads in Matcher
  • Implement ordered traversal in MatcherContext via MatchOrdered
  • Update existing tests to pass an IsOrdered flag and add OrderedPatternMatchingTests

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
FileSystemGlobbingTestContext.csConstructor now takes isOrdered and creates matcher accordingly
PatternMatchingTests.csUpdated to use IsOrdered instead of injecting a Matcher
OrderedPatternMatchingTests.csNew test class exercising ordered filter behavior
Matcher.csAdded preserveFilterOrder flag and switched execution paths
MatcherContext.csExtended to support ordered matching with local functions
InMemoryDirectoryInfo.csModernized collection initialization to use new array syntax
Microsoft.Extensions.FileSystemGlobbing.csprojAdded System.ValueTuple package reference for .NET Framework
Comments suppressed due to low confidence (1)

src/libraries/Microsoft.Extensions.FileSystemGlobbing/tests/PatternMatchingTests.cs:12

  • [nitpick] Fields in C# tests typically use camelCase or are declared as properties. Consider renaming IsOrdered to _isOrdered or exposing it as a protected property protected bool IsOrdered { get; set; } to follow naming conventions.
protected bool IsOrdered = false;

Comment threadsrc/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Matcher.cs Outdated
Comment threadsrc/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Matcher.cs Outdated
Comment threadsrc/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Matcher.cs Outdated
Comment threadsrc/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Matcher.cs Outdated
@kasperk81

Copy link
Copy Markdown
ContributorAuthor

@PranavSenthilnathan feel free to take over and adjust this as you see fit. The PR is functionally complete, and I addressed all your feedback a month ago but now you're requesting a complete overhaul?

@jkotas could I get an authoritative review here? I'd like to avoid going back and forth with shifting feedback.

@jkotas

Copy link
Copy Markdown
Member

@jkotas could I get an authoritative review here? I'd like to avoid going back and forth with shifting feedback.

You have the right people CCed here. I am not the right person to ask for an authoritative review on this one. https://github.com/dotnet/runtime/blob/main/docs/area-owners.md has the list of folks and aliases to tag for each area.

@PranavSenthilnathan

PranavSenthilnathan commented May 23, 2025

Copy link
Copy Markdown
Member

Not sure why pushing to kasperk81:main automatically closed this PR... I'll create a new PR with the changes I tried to push.

@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jun 23, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Extensions-FileSystemcommunity-contributionIndicates that the PR has been added by a community membernew-api-needs-documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ordered evaluation in FileSystemGlobbing Matcher

4 participants

@kasperk81@jkotas@PranavSenthilnathan