Skip to content

Match extensions case insensitively - #801

Merged
SimonCropp merged 1 commit into
mainfrom
fix-extension-case-sensitivity
Aug 22, 2026
Merged

Match extensions case insensitively#801
SimonCropp merged 1 commit into
mainfrom
fix-extension-case-sensitivity

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

ExtensionLookup, PathLookup and BinaryExtensions all compared ordinally, while
every registration is lowercase. The file systems that produce these strings are
not case sensitive on Windows or macOS, so .PNG, .JPG and .Docx matched nothing:
the tool resolved for foo.png and not for foo.PNG, and the same file could get a
diff tool or not depending on how it happened to be named.

BinaryExtensions decides whether a pair is treated as binary, so the same
mismatch also picks the wrong argument builder for a tool that has both.

Viewer/ImageExtensions already uses OrdinalIgnoreCase for exactly this kind of
lookup, so this makes the two agree rather than introducing a new rule.

ExtensionLookup, PathLookup and BinaryExtensions all compared ordinally, while
every registration is lowercase. The file systems that produce these strings are
not case sensitive on Windows or macOS, so .PNG, .JPG and .Docx matched nothing:
the tool resolved for foo.png and not for foo.PNG, and the same file could get a
diff tool or not depending on how it happened to be named.

BinaryExtensions decides whether a pair is treated as binary, so the same
mismatch also picks the wrong argument builder for a tool that has both.

Viewer/ImageExtensions already uses OrdinalIgnoreCase for exactly this kind of
lookup, so this makes the two agree rather than introducing a new rule.
@SimonCropp SimonCropp added this to the 20.0.0 milestone Aug 22, 2026
@SimonCropp
SimonCropp merged commit 246155f into main Aug 22, 2026
10 checks passed
@SimonCropp
SimonCropp deleted the fix-extension-case-sensitivity branch August 22, 2026 03:01
This was referenced Aug 26, 2026
This was referenced Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant