镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Restore the pre-1.7 IsMatch, Filter and DoesMatchGlob signatures for older callers [patch] - #166

Merged
matt-edmondson merged 1 commit into
mainfrom
fix/155-restore-pre-1.7-signatures
Nov 4, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
fix/155-restore-pre-1.7-signatures

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #155

What was wrong

1.7 added a trailing optional caseSensitivity parameter to Filter (both), IsMatch (both), DoesMatchGlob, DoesMatchRegex, AnyTokenMatchesGlobFilter and AllTokensMatchGlobFilter. The compiler fills in optional parameters at the call site, so the old signatures were no longer in the binary. An assembly compiled against 1.6 or earlier, such as BlastMerge on 1.5.48, threw MissingMethodException the first time it filtered anything once 1.7 was the version that loaded.

Change

  • TextFilter/TextFilter.BinaryCompatibility.cs adds the eight pre-1.7 signatures back as overloads that forward with TextFilterCaseSensitivity.CaseSensitive, the pre-1.7 behaviour. They are [EditorBrowsable(Never)] and inherit their docs from the new overloads.
  • Their parameters are not optional, so existing source still compiles without ambiguity. A call that passes every pre-1.7 argument binds to the restored overload, because C# prefers a candidate that needs no default arguments, and it behaves the same. A call that omits a trailing argument or passes caseSensitivity binds to the 1.7 overload.

Tests

  • New tests use reflection to check that each pre-1.7 signature, including the out int score and generic Filter<TItem> ones, exists in the built assembly. They also check that invoking one is case-sensitive, and that source calls passing every pre-1.7 argument still compile alongside calls passing caseSensitivity.
  • I checked that the tests catch the bug: with the new file removed, 8 of them fail with "Expected value to not be null".
  • Full suite: 211/211 pass on net10.0. The library builds clean for net8.0, net9.0, net10.0, netstandard2.0 and netstandard2.1.

Not in this PR

The issue also suggests turning on EnablePackageValidation with a 1.6.x PackageValidationBaselineVersion, so CI catches the next break of this kind. I left it out: it makes every pack download the baseline package, and it interacts with the SDK's existing CompatibilitySuppressions.xml handling, so it belongs in its own change.


Generated by Claude Code

…older callers [patch]

1.7 added a trailing optional caseSensitivity parameter to Filter, IsMatch,
DoesMatchGlob, DoesMatchRegex, AnyTokenMatchesGlobFilter and
AllTokensMatchGlobFilter. Optional parameters are filled in at the call site, so
the old signatures disappeared from the binary, and an assembly compiled against
1.6 or earlier threw MissingMethodException on its first filter call once 1.7
was the version that loaded.

Add the old signatures back as non-optional overloads that forward with
CaseSensitive, hidden from IntelliSense. Because their parameters are not
optional, existing source still binds without ambiguity: a call that passes every
pre-1.7 argument picks the restored overload, which behaves the same, and any
call that names caseSensitivity or omits a trailing argument picks the new one.

Fixes #155

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW5Rpzmd2jmRcDCB7Ym
@sonarqubecloud

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit ce92ed1 into main Nov 4, 2026
15 checks passed
@matt-edmondson
matt-edmondson deleted the fix/155-restore-pre-1.7-signatures branch November 4, 2026 00:54
matt-edmondson pushed a commit that referenced this pull request Nov 4, 2026
…patch]

The README API test required every overload's same-named parameter to carry
the documented default. The binary-compatibility overloads from #166 have no
defaults by design, so main has been red since #178. They are marked
[EditorBrowsable(Never)] and are not what the README documents, so the default
check now skips them. A wrong default on a visible overload still fails.

Fixes #183

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW6FzBtSrY5LKUuDYce
(cherry picked from commit 9328e00)
matt-edmondson pushed a commit that referenced this pull request Nov 6, 2026
…patch]

The README API test required every overload's same-named parameter to carry
the documented default. The binary-compatibility overloads from #166 have no
defaults by design, so main has been red since #178. They are marked
[EditorBrowsable(Never)] and are not what the README documents, so the default
check now skips them. A wrong default on a visible overload still fails.

Fixes #183

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW6FzBtSrY5LKUuDYce
matt-edmondson pushed a commit that referenced this pull request Nov 9, 2026
…patch]

The README API test required every overload's same-named parameter to carry
the documented default. The binary-compatibility overloads from #166 have no
defaults by design, so main has been red since #178. They are marked
[EditorBrowsable(Never)] and are not what the README documents, so the default
check now skips them. A wrong default on a visible overload still fails.

Fixes #183

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW6FzBtSrY5LKUuDYce
(cherry picked from commit 9328e00)
matt-edmondson pushed a commit that referenced this pull request Nov 9, 2026
…patch]

The README API test required every overload's same-named parameter to carry
the documented default. The binary-compatibility overloads from #166 have no
defaults by design, so main has been red since #178. They are marked
[EditorBrowsable(Never)] and are not what the README documents, so the default
check now skips them. A wrong default on a visible overload still fails.

Fixes #183

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW6FzBtSrY5LKUuDYce
(cherry picked from commit 9328e00)
matt-edmondson pushed a commit that referenced this pull request Nov 10, 2026
…patch]

The README API test required every overload's same-named parameter to carry
the documented default. The binary-compatibility overloads from #166 have no
defaults by design, so main has been red since #178. They are marked
[EditorBrowsable(Never)] and are not what the README documents, so the default
check now skips them. A wrong default on a visible overload still fails.

Fixes #183

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW6FzBtSrY5LKUuDYce
(cherry picked from commit 9328e00)
matt-edmondson pushed a commit that referenced this pull request Nov 10, 2026
…patch]

The README API test required every overload's same-named parameter to carry
the documented default. The binary-compatibility overloads from #166 have no
defaults by design, so main has been red since #178. They are marked
[EditorBrowsable(Never)] and are not what the README documents, so the default
check now skips them. A wrong default on a visible overload still fails.

Fixes #183

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW6FzBtSrY5LKUuDYce
(cherry picked from commit 9328e00)
matt-edmondson added a commit that referenced this pull request Nov 11, 2026
…patch] (#186)

The README API test required every overload's same-named parameter to carry
the documented default. The binary-compatibility overloads from #166 have no
defaults by design, so main has been red since #178. They are marked
[EditorBrowsable(Never)] and are not what the README documents, so the default
check now skips them. A wrong default on a visible overload still fails.

Fixes #183


Claude-Session: https://claude.ai/code/session_017vfJW6FzBtSrY5LKUuDYce

Co-authored-by: Claude <noreply@anthropic.com>
matt-edmondson added a commit that referenced this pull request Nov 11, 2026
* Keep a **/ inside a glob class as literal members [patch]

ExpandGlobStarSegments dropped every "**/" that followed a separator,
including one inside a bracket class, where it is just the members "*"
and "/". For a negated class that removed characters from the excluded
set, so x[!/**/] matched "x*". A "**/" inside a closed class is now
skipped, using the same class boundaries as ExpandGlobClasses.

Fixes #201

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW3RphV1aRzPmhMhf5m

* Hold only the visible overloads to the README's documented defaults [patch]

The README API test required every overload's same-named parameter to carry
the documented default. The binary-compatibility overloads from #166 have no
defaults by design, so main has been red since #178. They are marked
[EditorBrowsable(Never)] and are not what the README documents, so the default
check now skips them. A wrong default on a visible overload still fails.

Fixes #183

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW6FzBtSrY5LKUuDYce
(cherry picked from commit 9328e00)

---------

Co-authored-by: Claude <noreply@anthropic.com>
matt-edmondson added a commit that referenced this pull request Nov 11, 2026
)

* Match a glob ** joined to other characters like a single * [patch]

DotNet.Glob only reads ** as a wildcard when it is a whole path segment.
Joined to other characters, as in **foo or a**b, it matched nothing, so a
doubled star emptied the list where * matches. ResolveGlob now collapses
each run of stars that is not a whole segment to a single *, leaving
whole-segment ** for ExpandGlobStarSegments and stars inside bracket
classes alone.

Fixes #135

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW3RphV1aRzPmhMhf5m

* Hold only the visible overloads to the README's documented defaults [patch]

The README API test required every overload's same-named parameter to carry
the documented default. The binary-compatibility overloads from #166 have no
defaults by design, so main has been red since #178. They are marked
[EditorBrowsable(Never)] and are not what the README documents, so the default
check now skips them. A wrong default on a visible overload still fails.

Fixes #183

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW6FzBtSrY5LKUuDYce
(cherry picked from commit 9328e00)

---------

Co-authored-by: Claude <noreply@anthropic.com>
matt-edmondson added a commit that referenced this pull request Nov 11, 2026
…patch] (#200)

* Let a backslash make a leading +, -, ! or ^ literal in a glob token [patch]

A glob token's first character was always read as a prefix, so an item
named +page.svelte or !important.txt could not be found by typing its
name. A backslash before a leading prefix character now makes it literal,
also after a + or - prefix. GetHint and the README list every prefix the
parser recognises and the escape.

Fixes #198

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW3WKJyQMZaWCcyzKVK

* Hold only the visible overloads to the README's documented defaults [patch]

The README API test required every overload's same-named parameter to carry
the documented default. The binary-compatibility overloads from #166 have no
defaults by design, so main has been red since #178. They are marked
[EditorBrowsable(Never)] and are not what the README documents, so the default
check now skips them. A wrong default on a visible overload still fails.

Fixes #183

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW6FzBtSrY5LKUuDYce
(cherry picked from commit 9328e00)

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants