onivim / oni

Oni: Modern Modal Editing - powered by Neovim
https://www.onivim.io
MIT License
11.35k stars 299 forks source link

WSL LSP integration. #676

Open jordwalke opened 7 years ago

jordwalke commented 7 years ago

Oni would be a good opportunity to build a bridge to WSL in order to run LSP servers inside of WSL. I believe that this shouldn't be terribly difficult. The benefit is that you can build Linux projects, using Linux development tools (LSPs) inside of a Windows subsystem. Oni would simply proxy all LSP requests into the WSL somehow. Is this possible/difficult?

bryphe commented 7 years ago

For sure, that's exciting! One roadblock I hit with Reason is that I couldn't get the full dev experience on my primary machine (Windows), but I see there's been a ton of progress there. I just saw this project which allows access to the tools: https://github.com/fhelwanger/ocaml-on-windows, and it looks like https://github.com/freebroccolo/ocaml-language-server/pull/29 will make that work on Windows.

And according to the WSL - Interopability document, you can pretty much run any Linux command like bash -c "ls -la", so with all those pieces in place, it really doesn't seem like there are any blockers... just maybe minor modifications to Oni's API to use bash in our spawn call (and some robustness to fail gracefully).

I guess the only unknown is how Windows pipes the output from the LSP, but I know that the ocaml-language-server supports a variety of connection options (ipc, socket, stdio) - I'm sure at least one of those will work, if not all out of of the box.

TL;DR It might even be as simple as setting the ocaml.langServerCommand' option to some variant likebash -c "ocaml-language-server"(default is justocaml-language-server`)... but if not that easy, definitely still possible.