fix: match request uris to workspace folders case-insensitively on Windows - #418
Merged
Merged
Conversation
…ively on Windows A request uri resolves to a workspace folder by string-prefix comparison against the folder root uri, which used StringComparison.Ordinal. Windows filesystems are case-insensitive, so a client that cases a uri differently than the announced workspace root (for example a lowercase drive letter, or an all-lowercase path) still names the same file, but the comparison missed and the request silently fell through: position requests answered null and didOpen was dropped without effect. The document lookup below the routing already compares case-insensitively on every platform, so routing was the only case-sensitive link. Compare with OrdinalIgnoreCase on Windows only; other platforms keep Ordinal since their filesystems are case-sensitive.
pbednarcik
force-pushed
the
fix/windows-uri-casing
branch
from
August 25, 2026 16:10
63bd344 to
51a9749
Compare
Owner
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A request uri resolves to a workspace folder by string-prefix comparison
against the folder root uri, and that comparison used
StringComparison.Ordinal. Windows filesystems are case-insensitive, so a
client that cases a uri differently than the announced workspace root (a
lowercase drive letter, or an all-lowercase path) still names the same
file, but the comparison missed and the request silently fell through:
position requests answered null and didOpen was dropped without effect.
The document lookup below the routing already compares case-insensitively
on every platform, so routing was the only case-sensitive link.
This PR compares with OrdinalIgnoreCase on Windows only; other platforms
keep Ordinal since their filesystems are case-sensitive.
Two tests: a routing unit test with a differently cased uri
(platform-branched: resolves on Windows, stays unmatched elsewhere), and
an integration test proving a didOpen plus hover through a
lowercased-drive uri answers full contents. CHANGELOG.md entry included.