Skip to content
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

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

Open
DanTup opened this issue Jan 9, 2024 · 0 comments

Comments

@DanTup
Copy link
Contributor

DanTup commented Jan 9, 2024

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:

  • the // before the authority have been removed (because the authority is empty)
  • the first character of the path has been lowercased (because despite not being a file URI, VS Code's URI class has decided it is a drive letter and normalises to lowercase drive letters)

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: microsoft/vscode#202071)

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

No branches or pull requests

1 participant