-
Notifications
You must be signed in to change notification settings - Fork 90
Support WSL for Windows #99
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
Comments
Please add this as a pull request, would be quite useful and essential |
I'm getting an error |
@dareTake Strange for me the file in question is extension.js and is located in this folder: Then For me, the solution provided by @Ciantic worked well. |
Can't work on WSL too. And the old HIE plugin move into this project. I can't use any language server now. OMG. |
These days there are better ways with WSL remoting that just works: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl I highly recommend using WSL remoting instead of the hack I gave above. Because WSL remoting uses the Linux environment in full to run the extensions, it works way better. I will close this issue, maybe some documentation would still be in order to add, but maybe a new issue for that? |
These features totally not working.
I'm sure I already install the brittany and it's in my |
Yes I'm using WSL remoting. |
This plugin works well. https://marketplace.visualstudio.com/items?itemName=MaxGabriel.brittany So my But isn't this plugin a all-in-one plugin? I don't want to install too many plugins. |
After switch to ormolu, formatter works. But |
The evaluate issue is broken on static binaries on Linux, it's tracked by this issue here haskell/haskell-language-server#221 |
HIE, Stack etc. compiles absolutely perfectly from a Windows Subsystem for Linux e.g. the Ubuntu.
I have come to conclusion that majority of Haskell tools will never support Windows adequately, the Stack for instance usually just gives weird errors with some libraries etc. Instead in WSL the Stack, HIE etc. compiles with the Linux instructions and works perfectly.
I have tried to make vscode-hie-server to work with the HIE running in WSL, but I think the only problem is that the HIE running in WSL has paths starting /mnt/C/ instead of C:. The change required is probably not very big.
It shouldn't require any changes to haskell-ide-engine, just some mangling in the vscode-hie-server.
The OCaml Language Server works like this, it just has bat files that starts the binaries in the WSL bash using
bash -c ...
it allows to translate paths from Windows to WSL format also.EDIT Yes!
I found a way, I hacked the
extension.js
source code directly, only thing that is required is to do this in theclientOptions
:Of course you need to set the VSCode settings to following:
Simplest hie-wsl-wrapper.bat can be following:
(One can't use
wsl
as an executing binary because the bashrc must be run, and bash -ci runs it.)However, if it doesn't work usually the ~/.local/bin/ is not put in the PATH at the WSL. Besides these it would be good to have few checks so that new users can be guided by the VSCode plugin how to install HIE correctly in the WSL.
I probably will do a pull request sometime for this, my plan is to add a new settings:
languageServerHaskell.useWslHieWrapperPath
andlanguageServerHaskell.useWslHieWrapper
and provide a defaulthie-wsl-wrapper.bat
.These could be checked against and the uriConverter could be turned on if they are set. The plugin must guide the Windows users more with clear setup instructions if something seems failing.
The text was updated successfully, but these errors were encountered: