LSP Uris causes headache in Windows Subsystem for Linux
- Dominant language
- Haskell
- Stars
- 423
- Forks
- 105
- PR merge metrics
- No merged PRs in 30d
Description
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:
```haskell
-- 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
Contributor guide
Assessment
This issue has not been assessed yet.