Skip to content

fix: match request uris to workspace folders case-insensitively on Windows - #418

Merged
razzmatazz merged 2 commits into
razzmatazz:mainfrom
pbednarcik:fix/windows-uri-casing
Aug 25, 2026
Merged

fix: match request uris to workspace folders case-insensitively on Windows#418
razzmatazz merged 2 commits into
razzmatazz:mainfrom
pbednarcik:fix/windows-uri-casing

Conversation

@pbednarcik

Copy link
Copy Markdown
Contributor

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.

…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
pbednarcik force-pushed the fix/windows-uri-casing branch from 63bd344 to 51a9749 Compare August 25, 2026 16:10
@razzmatazz
razzmatazz merged commit d2acf7e into razzmatazz:main Aug 25, 2026
3 checks passed
@razzmatazz

Copy link
Copy Markdown
Owner

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants