Closed huangxg closed 6 years ago
Are there any messages in the developer console?
What happens when you run solargraph socket
from a terminal?
Dev console messages,
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:268 [Extension Host] nvm is not compatible with the npm config "prefix" option: currently set to "/usr/local"
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:268 [Extension Host] Run `npm config delete prefix` or `nvm use --delete-prefix v8.11.3 --silent` to unset it.
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:268 [Extension Host] Solargraph is listening PORT=51133 PID=41536
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:268 [Extension Host] Checking gem version
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:268 [Extension Host] Solargraph gem version is current
Terminal message,
Solargraph is listening PORT=7658 PID=44535
Do you have 127.0.0.1 set to localhost in your hosts file? (Reference: #67)
No, my 127.0.0.1 was set to another domain name. Changing it back to localhost did fix the problem. solargraph was working even when 127.0.0.1 was set to that domain, util something (not sure it's ruby, macOS, or vscode) updated recently.
Thank you, @castwide
Just FYI: If anybody comes to this page because of the same problem and google and the hosts is correct, restart VS Code (if needed multiple times), sometimes (not often) it seems to freeze. Maybe it's happening when switching branches while it's starting? At least I did that the last time when I had this problem.
OS: macOS 10.13.5 ruby: 2.3.3 (set by .ruby-version) solargraph gem: 0.22.0 vscode: 1.24.1 Ruby Solargraph: 0.17.4
When loading a ruby file in vscode, there is a message
Starting the Solargraph language server...
at the bottom blue bar, and two repeated errors in the OUTPUT tab,[Error - 14:43:51] Connection to server is erroring. Shutting down server.