microsoft / language-server-protocol

Defines a common protocol for language servers.
https://microsoft.github.io/language-server-protocol/
Creative Commons Attribution 4.0 International
10.91k stars 764 forks source link

Define/document the ways in which clients may/may not change custom-scheme URIs provided by the server #1879

Open DanTup opened 6 months ago

DanTup commented 6 months ago

If an LSP server sends a URI like "my-foo:///C:/foo/bar" to VS Code, it will come back as "my-foo:/c%3A/foo/bar". In particular:

To ensure LSP clients and servers are all on the same page, it would be beneficial to document the kinds of changes client/servers are allowed to make to custom scheme URIs. In particular, the change of casing for non-file URIs seemed unexpected to me and it would be very easy for a server to that's not being tested with VS Code specifically to not handle this correctly.

(I did raise this with VS Code in the hope it was a bug, but it's apparently by design: https://github.com/microsoft/vscode/issues/202071)