neoclide / coc-rls

Rust language server support for coc.nvim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rls doesnt start under cygwin vim

ducklin5 opened this issue · comments

Tried using this extension under cygwin, but I always get:

 The "rust-client" server crashed 5 times in the last 3 minutes. The server will not be restarted.
CocLog
[Info  - 3:43:50 PM] Connection to server got closed. Server will restart.
Setting sysroot toC:\Users\???\.rustup\toolchains\stable-x86_64-pc-windows-gnu
running: rustup run stable-x86_64-pc-windows-gnu rls, at \cygdrive\c\Users\???\dev\rustPractice\hello_world
thread 'main' panicked at 'Could not convert URI to path: ()', src\tools\rls\rls/src\server\mod.rs:472:32
stack backtrace:
   0:         
0x63628c1b - expect100
   1:         0x636548bc - expect100
   2:         0x6361a2b9 - expect100
   3:         0x6362d450 - expect100
   4:         0x6362d0d9 - 
expect100
   5:         0x6362db8d - expect100
   6:   
      0x6362d7a4 - expect100
   7:      
   0x63651200 - expect100
  
 8:         0x63650e63 - expect100
   9
:           0x44bf4f - rls::server::get_root_path::hd6f8413d51764e9d
  10:           
0x4b7945 - rls::server::<impl rls::server::message::BlockingRequestAction
 for lsp_types::request::Initialize>::handle::h8b1835051cd091d9
  
11:           0x445966 - rls::server::LsService<O
>::dispatch_message::h33f477fb3f9fe183
  12:        
   0x440b44 - rls::server::run_server::h45a173e7223ef9eb
  13:           0x
4043e0 - rls::main_inner::h26d784ba7442cbc4
  14:    
       0x403fb9 - rls::main::h28cbc2a0e0176c6b
  
15:           0x4032e6 - std::rt::lang_start::
{{closure}}::h1f30ab790b8f71db
  16:       
  0x6362de4c - expect100
  17:        
   0x4047b8 - main
  18:     
      0x4013f8 - _tmainCRTStartup
  
19:           0x40151b - mainCRTStartup
  20: 
    0x7ffd96e26fd4 - expect100
  21:   
  0x7ffd9749cec1 - expect100
[Error  - 3:43:50 PM] Connection to server got closed. Server will not be restarted.

## Output channel: Rust Analyzer Language Server Trace

There seems to be a path error somewhere. Possibly related to / or \.
The only lead I've got is here: emacs-lsp/lsp-mode#624

** I had to make a \cygdrive\c <==> C:\ junction to get to this point.

Might be related: :CocCommand rls.run results in a zsh: command not found: cargo
But it works if I running cargo run manually in a new vim terminal.
I did some searching and turns out the issue starts somewhere here:

env: process.env

After removing that line :CocCommand rls.run works as expected

alternative way to achieve this is to delete and re-install.

rustup self uninstall
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Unfortunately, that doesn't work on Cygwin. I'm going to close this issue since it has been dormant for a while and I'm content with my VM set up.