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

LSP Uris causes headache in Windows Subsystem for Linux #554

Open
TimWhiting opened this issue Feb 7, 2024 · 2 comments
Open

LSP Uris causes headache in Windows Subsystem for Linux #554

TimWhiting opened this issue Feb 7, 2024 · 2 comments

Comments

@TimWhiting
Copy link
Contributor

Ran into this with our Koka language server

Here is Daan's comments in our workaround, which should provide a basic understanding of the issue:

-- work around lsp bugs :-(  (we should report this but it seems there are multiple wrong assumptions in both normalization and in uriToFilePath)
-- on Windows, a file path like "\\wsl.localhost\Ubuntu\home\koka\samples\basic\fibonacci.kk"
-- becomes a J.Uri as           "file://wsl.localhost/Ubuntu/home/koka/samples/basic/fibonacci.kk" (note the lost \\ start)
-- and a J.NormalizedUri  as    "file:///wsl.localhostUbuntu/home/koka/samples/basic/fibonacci.kk" (note the lost / before Ubuntu, and added / start)
--
-- here we try to correct that for this specific case so we can at least open
-- files in a WSL file system on Windows
-- (which is important as build on wsl2 is very slow outside the wsl mounted file system)

https://github.com/koka-lang/koka/blob/f48555f1e2ba211f3e86524a15668597cad19118/src/Main/langserver/LanguageServer/Conversions.hs#L151

@TimWhiting TimWhiting changed the title File Path Normalization causes headache in Windows Subsystem for Linux LSP Uris causes headache in Windows Subsystem for Linux Feb 7, 2024
@michaelpj
Copy link
Collaborator

I'm... surprised that it's that broken. I thought people used HLS on windows okay, so I would have thought we would have run into this.

I'm not totally sure how this is supposed to work and I don't have a windows machine to test on, so a PR would be very welcome!

@TimWhiting
Copy link
Contributor Author

It looks like this is something specific to a configuration where the files are in the WSL filesystem, but vscode is not used in a client(windows)-server(wsl) configuration, instead opening just the windows version of vscode in that folder. I probably don't have the time to look into it soon, but just wanted to write this down as additional information if anyone wonders how to reproduce this.

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

2 participants