You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Document URIs are currently passed as bare string throughout the codebase — e.g. DocumentManager::get(string $uri), the uri field on the new TextDocumentPositionParams value object (#352), and every handler that extracts textDocument.uri. This is stringly-typed: a document URI, a class name, and an arbitrary string are indistinguishable to the type system, and nothing prevents an unrelated string from being passed where a URI is expected.
Proposal
Introduce a DocumentUri value object (likely in src/Protocol/ or src/Document/) and thread it through the URI-handling surface:
DocumentManager::get() / storage keys
TextDocumentPositionParams::$uri
Handler param extraction and any TextDocumentSyncHandler open/change/close paths
Location/definition results that carry a URI back to the client
Worth deciding up front whether DocumentUri should validate/normalize (file:// scheme, percent-encoding) or remain a thin wrapper, and whether it should be introduced incrementally (one boundary at a time) to keep diffs reviewable.
This issue body was written by AI (Claude Code) at the request of the maintainer.
Document URIs are currently passed as bare
stringthroughout the codebase — e.g.DocumentManager::get(string $uri), theurifield on the newTextDocumentPositionParamsvalue object (#352), and every handler that extractstextDocument.uri. This is stringly-typed: a document URI, a class name, and an arbitrary string are indistinguishable to the type system, and nothing prevents an unrelated string from being passed where a URI is expected.Proposal
Introduce a
DocumentUrivalue object (likely insrc/Protocol/orsrc/Document/) and thread it through the URI-handling surface:DocumentManager::get()/ storage keysTextDocumentPositionParams::$uriTextDocumentSyncHandleropen/change/close pathsNotes
stringtype to stay in scope.DocumentUrishould validate/normalize (file://scheme, percent-encoding) or remain a thin wrapper, and whether it should be introduced incrementally (one boundary at a time) to keep diffs reviewable.This issue body was written by AI (Claude Code) at the request of the maintainer.