rstfilter icon indicating copy to clipboard operation
rstfilter copied to clipboard

couldn't create connection to server in VS Code

Open nflorentin opened this issue 3 years ago • 7 comments

Hi,

I was going to try the vscode extension but I got the following error :

rstfilter extension client: couldn't create connection to server.
Launching server using command rstfilter-lsp failed. Error: spawn rstfilter-lsp ENOENT

I did that:

  • installed the extension
  • installed the gem
  • restart vscode and rails server

ruby version: 2.6.9 rails version: 5.2.7

Thanks in advance for your help

nflorentin avatar Jul 22 '22 07:07 nflorentin

Thank you to trying it. Did you install rstfilter by gem install or bundle install? The latter can install rstfilter in the local directory and rstfilter-lsp command is not installed into your system. Could you try rstfilter-lsp on the terminal?

ko1 avatar Jul 25 '22 07:07 ko1

rstfilter-lsp seems to work in my terminal :

nicolas@mbp-nicolas echosciences % rstfilter-lsp
warning: parser/current is loading parser/ruby26, which recognizes2.6.10-compliant syntax, but you are running 2.6.9.
Please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
wait from #<IO:<STDIN>

It seems strange that I can't quit it, I have to kill my terminal tab.

nflorentin avatar Jul 25 '22 07:07 nflorentin

I see. rstfilter-lsp keeps connection with STDIN/OUT. It's strange that it should be quit with Ctrl-C because it's waiting with STDIN.gets.

https://github.com/ko1/rstfilter/blob/main/lib/rstfilter/lsp/handler.rb#L64

and original problem I couldn't solve... One assumption is

  • You are using rbenv
  • VSCode was launched from desktop (mac?) and VSCode launches rstfilter on non-rbenv environment.

To check the situation, you can launch VSCode from rbenv enabled terminal (like code app_dir/).

ko1 avatar Jul 25 '22 07:07 ko1

Ah,

https://github.com/ko1/rstfilter/blob/main/lib/rstfilter/lsp/handler.rb#L37

Interrupt was rescued.

ko1 avatar Jul 25 '22 08:07 ko1

I'm using rvm.

I have the same problem if I lunch vscode from the terminal on the project with code ..

nflorentin avatar Jul 25 '22 08:07 nflorentin

I see, so I have no idea more...

ko1 avatar Jul 25 '22 08:07 ko1

No problem, anyway thanks for your help

Maybe someone will find and resolve ths issue :)

Have a nice day

nflorentin avatar Jul 25 '22 08:07 nflorentin