Skip to content

Normalize client URIs once at the server boundary - #141

Merged
jdesrosiers merged 1 commit into
mainfrom
normalize-bug
Oct 9, 2026
Merged

jdesrosiers merged 1 commit into
mainfrom
normalize-bug

Conversation

@jdesrosiers

Copy link
Copy Markdown
Collaborator

We keep running into this windows URI normalization bug and it's coming up again in another task I'm working on. So, I'm trying this more aggressive approach to handle it.

Server now normalizes the text document URI and watched file URIs in the params of every handler it proxies, and the workspace folders in the initialize params. Code past the boundary can compare URIs without normalizing them again.

TestClient now encodes every URI it sends the way VS Code does in windows, and the test workspace folder contains an "@" so the encoded and normalized forms always differ.

URIs the server produces with @hyperjump/uri are always normalized, but
URIs from the client arrived raw. TextDocuments stored documents under
the raw URI while JsonDocument.uri was normalized, so looking up a
document by an internal URI failed whenever the client encoded it
differently, e.g. VS Code on Windows sends "file:///c%3A/...".

Server now normalizes the text document URI and watched file URIs in
the params of every handler it proxies, and the workspace folders in
the initialize params. Code past the boundary can compare URIs without
normalizing them again.

TestClient now encodes every URI it sends the way VS Code does, and the
test workspace folder contains an "@" so the encoded and normalized
forms always differ. TestClient keeps its own URIs in the form the
server sees them, which includes VS Code's lowercase drive letter on
Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jdesrosiers
jdesrosiers merged commit 672420b into main Oct 9, 2026
6 checks passed
@jdesrosiers
jdesrosiers deleted the normalize-bug branch October 9, 2026 20:25
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.

1 participant