castwide / vscode-solargraph

A Visual Studio Code extension for Solargraph.
Other
425 stars 23 forks source link

Cannot start language server after 0.34.0 upgrade #128

Closed ijdickinson closed 5 years ago

ijdickinson commented 5 years ago

Solagraph has been working fine for me in VsCode, up to this morning when it installed the 0.34.0 update. Now, I get an error message Couldn't start client Ruby Language Server, and console output:

[Error - 10:46:29] Starting client failed
Could not locate Gemfile or .bundle/ directory

Developer tools has:

workbench.main.js:2379 Couldn't start client Ruby Language Server
onDidNotificationChange @ workbench.main.js:2379
workbench.main.js:238 [Extension Host] Error starting Solargraph socket provider Could not locate Gemfile or .bundle/ directory

workbench.main.js:2379 Failed to start Solargraph: Could not locate Gemfile or .bundle/ directory
onDidNotificationChange @ workbench.main.js:2379
workbench.main.js:238 [Extension Host] rejected promise not handled within 1 second: Could not locate Gemfile or .bundle/ directory

t.log @ workbench.main.js:238
workbench.main.js:1406   ERR Could not locate Gemfile or .bundle/ directory

Solargaph does seem to be installed OK, and working from the command line:

$ solargraph -v
0.34.0
$ solargraph socket
Solargraph is listening PORT=7658 PID=23744

Manually reverting to Solargraph 0.33.0 (and disabling the version check in VsCode settings) has got me back to a working version.

I'm running Ubuntu 19.04 with Ruby 2.5.5.

castwide commented 5 years ago

Do you have solargraph.useBundler set to true? That would cause the error if you open a folder that doesn't have a Gemfile. (Paradoxically, it might work if you open an individual file instead of a folder.)

ijdickinson commented 5 years ago

@castwide That setting was initially off, but I did try with it set to true. It didn't change the behaviour I was seeing.

castwide commented 5 years ago

Okay. I was able to reproduce the error by opening a file that contains either require 'bundler/require' or Bundler.require. That makes the server look for gem dependencies to add to the map. If it doesn't find a Gemfile, you get the error.

I'll release a patch later today.

ijdickinson commented 5 years ago

Great, thanks @castwide

castwide commented 5 years ago

Fix pushed in gem v0.34.1.

ijdickinson commented 5 years ago

Confirmed fixed. Thanks for the quick response!