-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Colons in windows drive letters are over-encoded in file URIs #1280
Comments
If I remember the discussion we had about this correctly there is no specification how this should be done when encoding drive letters and having Since I know this can be difficult for server the VS Code client offers a way to intercept all URI -> string conversions and vice versa. So if you want to change how they are send over the wire the best I can suggest is to use that capability. See
|
@dbaeumer that's what I've ended up doing for now - but that is VS Code specific and the goal is for the LSP server to work with all clients (and similarly, clients to work with all servers). Is your opinion that a) all servers should handle encoded colons, or b) that clients should not send encoded colons (and VS Code extensions should fix up the URI)? I think it would be beneficial to note this one way or the other in the spec so it's clear who should fix any incompatibilities that arise from this. I'm happy to send a PR that adds a note somewhere if you can confirm which direction you'd prefer it went. Thanks! |
IMO a server needs to handle all valid encoded URLs. I am not a fan of specing how URLs should be encoded in LSP. Add a note to the specification makes total sense to me. |
Thanks - I opened microsoft/language-server-protocol#1786 - happy to tweak/rewrite as you'd prefer! |
* Add an explicit note about drive letter colons See microsoft/vscode-languageserver-node#1280 * Tweak text * Add a note about drive letter casing --------- Co-authored-by: Dirk Bäumer <dirkb@microsoft.com>
The LSP client appears to send file URIs with over-encoded colons:
I think this happens because VS Code's own URI class is doing this and it's just being used here:
https://github.com/microsoft/vscode-languageserver-node/blob/f2ff7d55464a1f58f978cb6635bd8865f050553c/client/src/common/codeConverter.ts#L154C62-L154C62
In Dart, I found that some first-party libraries handle this, and some do not. I've been trying to figure out whether it's valid or not (eg. whether the bug is VS Code/here, or in Dart) but the closest I've found to anything definitive is here:
https://url.spec.whatwg.org/#windows-drive-letter
It also does not include a colon in the "path percent encode set" (only in the userinfo encode set), although it's not to me whether that forbids encoding it.
The text was updated successfully, but these errors were encountered: