0

Long-time emacs user (38 years or so, not kidding). I'm on Windows 10, running native emacs 26.1. I'm doing some Javascript/Typescript (vue.js) development, using WSL for that world, still with the native Windows Emacs. Works great for the most part, with a few path hassles now & then (/mnt/c/foo vs. c:/foo).

I just ran across the LSP idea (https://github.com/emacs-lsp/lsp-mode) -- brilliant! I want to try that to get nice intellisense. I'll need to run the LSP server on WSL though, presumably using TCP (because all my JS/npm/tslint setup is there); has anyone done that? Will it work? Will I run into path or socket issues? Am I insane? I don't want to spend a day on a fool's errand if I can help it.

(Yeah, I could set up an X server and run WSL emacs over X but that's an extra hassle I'd like to avoid -- I'm pretty comfy with Windows emacs.)

  • I did try it -- created c:/bin/typescript-language-server.cmd that uses bash to start the WSL typescript-language-server, and use that in emacs lsp, but it gives errors on startup because of the project root being "c:/tmp" which of course is not a valid Linux/WSL path. Not sure what to try next. – GaryO Apr 11 at 14:51
  • You can transform Windows paths into WSL paths with the command wslpath (see the corresponding release notes of WSL). Does work nicely with local paths. AFAIK it has problems with unc-paths. – Tobias Apr 11 at 23:56
  • I am working with the opposite setup. Running Emacs on WSL with X-server. Works very well. From the Windows-side you have to start any program through the WSL bash. From the WSL side you can just start Windows applications. mount -t drvfs does mount any Windows drives including Windows shares and so on (even mounting Bitlocker encrypted drives works). The selection of the X-server is crucial. I am currently using VcXsrv. That one just runs. Xming crashed too often. – Tobias Apr 12 at 0:04
  • I did some more work on it, transforming the paths going to the server. Not working yet, but some progress. Created an issue at github.com/emacs-lsp/lsp-mode/issues/761 to track it. – GaryO Apr 12 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.