Closed MShahzaib closed 4 years ago
Hello @MShahzaib,
Thanks for reporting and sorry to hear about that. Could you please go to Preferences -> Language Servers -> Logs and enable the Solargraph entry? After you restart Eclipse, the Console view should display the messages exchanged between the server and the client, and hopefully shed a bit more light on the issue.
Hi, thank you for the quick reply, here are the logs.
[t=1601030930312] LSP4E to io.github.pyvesb.eclipse_solargraph:
Content-Length: 60
[t=1601030930312] LSP4E to io.github.pyvesb.eclipse_solargraph:
{"jsonrpc":"2.0","id":"2","method":"shutdown","params":null}
[t=1601030930312] LSP4E to io.github.pyvesb.eclipse_solargraph:
Content-Length: 47
[t=1601030930312] LSP4E to io.github.pyvesb.eclipse_solargraph:
{"jsonrpc":"2.0","method":"exit","params":null}
[t=1601030930325] LSP4E to io.github.pyvesb.eclipse_solargraph:
Content-Length: 1386
[t=1601030930325] LSP4E to io.github.pyvesb.eclipse_solargraph:
{"jsonrpc":"2.0","id":"1","method":"initialize","params":{"processId":9887,"rootPath":"/Users/mshahzaib/Desktop/dev/lansa-lax/ruby/","rootUri":"file:///Users/mshahzaib/Desktop/dev/lansa-lax/ruby/","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","delete","rename"],"failureHandling":"undo"},"symbol":{"dynamicRegistration":true},"executeCommand":{"dynamicRegistration":true},"workspaceFolders":true},"textDocument":{"synchronization":{"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"completionItem":{"snippetSupport":true,"documentationFormat":["markdown","plaintext"]}},"hover":{"contentFormat":["markdown","plaintext"]},"signatureHelp":{},"references":{},"documentHighlight":{},"documentSymbol":{"symbolKind":{"valueSet":[18,17,5,14,9,10,22,24,8,1,12,11,20,6,2,3,21,16,19,25,4,7,15,23,26,13]},"hierarchicalDocumentSymbolSupport":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{},"definition":{"linkSupport":true},"typeDefinition":{"linkSupport":true},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dynamicRegistration":true},"codeLens":{},"documentLink":{},"colorProvider":{},"rename":{}}},"clientName":"Eclipse IDE","trace":"off"}}
[t=1601030931040] LSP4E to io.github.pyvesb.eclipse_solargraph:
Content-Length: 60
[t=1601030931040] LSP4E to io.github.pyvesb.eclipse_solargraph:
{"jsonrpc":"2.0","id":"2","method":"shutdown","params":null}
[t=1601030931040] LSP4E to io.github.pyvesb.eclipse_solargraph:
Content-Length: 47
[t=1601030931040] LSP4E to io.github.pyvesb.eclipse_solargraph:
{"jsonrpc":"2.0","method":"exit","params":null}
[t=1601030931049] LSP4E to io.github.pyvesb.eclipse_solargraph:
Content-Length: 1386
[t=1601030931049] LSP4E to io.github.pyvesb.eclipse_solargraph:
{"jsonrpc":"2.0","id":"1","method":"initialize","params":{"processId":9887,"rootPath":"/Users/mshahzaib/Desktop/dev/lansa-lax/ruby/","rootUri":"file:///Users/mshahzaib/Desktop/dev/lansa-lax/ruby/","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","delete","rename"],"failureHandling":"undo"},"symbol":{"dynamicRegistration":true},"executeCommand":{"dynamicRegistration":true},"workspaceFolders":true},"textDocument":{"synchronization":{"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"completionItem":{"snippetSupport":true,"documentationFormat":["markdown","plaintext"]}},"hover":{"contentFormat":["markdown","plaintext"]},"signatureHelp":{},"references":{},"documentHighlight":{},"documentSymbol":{"symbolKind":{"valueSet":[18,17,5,14,9,10,22,24,8,1,12,11,20,6,2,3,21,16,19,25,4,7,15,23,26,13]},"hierarchicalDocumentSymbolSupport":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{},"definition":{"linkSupport":true},"typeDefinition":{"linkSupport":true},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dynamicRegistration":true},"codeLens":{},"documentLink":{},"colorProvider":{},"rename":{}}},"clientName":"Eclipse IDE","trace":"off"}}
[t=1601030940458] LSP4E to io.github.pyvesb.eclipse_solargraph:
Content-Length: 60
[t=1601030940458] LSP4E to io.github.pyvesb.eclipse_solargraph:
{"jsonrpc":"2.0","id":"2","method":"shutdown","params":null}
[t=1601030940459] LSP4E to io.github.pyvesb.eclipse_solargraph:
Content-Length: 47
[t=1601030940459] LSP4E to io.github.pyvesb.eclipse_solargraph:
{"jsonrpc":"2.0","method":"exit","params":null}
[t=1601030940474] LSP4E to io.github.pyvesb.eclipse_solargraph:
Content-Length: 1386
[t=1601030940474] LSP4E to io.github.pyvesb.eclipse_solargraph:
{"jsonrpc":"2.0","id":"1","method":"initialize","params":{"processId":9887,"rootPath":"/Users/mshahzaib/Desktop/dev/lansa-lax/ruby/","rootUri":"file:///Users/mshahzaib/Desktop/dev/lansa-lax/ruby/","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","delete","rename"],"failureHandling":"undo"},"symbol":{"dynamicRegistration":true},"executeCommand":{"dynamicRegistration":true},"workspaceFolders":true},"textDocument":{"synchronization":{"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"completionItem":{"snippetSupport":true,"documentationFormat":["markdown","plaintext"]}},"hover":{"contentFormat":["markdown","plaintext"]},"signatureHelp":{},"references":{},"documentHighlight":{},"documentSymbol":{"symbolKind":{"valueSet":[18,17,5,14,9,10,22,24,8,1,12,11,20,6,2,3,21,16,19,25,4,7,15,23,26,13]},"hierarchicalDocumentSymbolSupport":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{},"definition":{"linkSupport":true},"typeDefinition":{"linkSupport":true},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dynamicRegistration":true},"codeLens":{},"documentLink":{},"colorProvider":{},"rename":{}}},"clientName":"Eclipse IDE","trace":"off"}}
[t=1601030986898] LSP4E to io.github.pyvesb.eclipse_solargraph:
Content-Length: 60
[t=1601030986898] LSP4E to io.github.pyvesb.eclipse_solargraph:
{"jsonrpc":"2.0","id":"2","method":"shutdown","params":null}
[t=1601030986898] LSP4E to io.github.pyvesb.eclipse_solargraph:
Content-Length: 47
[t=1601030986898] LSP4E to io.github.pyvesb.eclipse_solargraph:
{"jsonrpc":"2.0","method":"exit","params":null}
[t=1601030986910] LSP4E to io.github.pyvesb.eclipse_solargraph:
Content-Length: 1386
[t=1601030986910] LSP4E to io.github.pyvesb.eclipse_solargraph:
{"jsonrpc":"2.0","id":"1","method":"initialize","params":{"processId":9887,"rootPath":"/Users/mshahzaib/Desktop/dev/lansa-lax/ruby/","rootUri":"file:///Users/mshahzaib/Desktop/dev/lansa-lax/ruby/","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","delete","rename"],"failureHandling":"undo"},"symbol":{"dynamicRegistration":true},"executeCommand":{"dynamicRegistration":true},"workspaceFolders":true},"textDocument":{"synchronization":{"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"completionItem":{"snippetSupport":true,"documentationFormat":["markdown","plaintext"]}},"hover":{"contentFormat":["markdown","plaintext"]},"signatureHelp":{},"references":{},"documentHighlight":{},"documentSymbol":{"symbolKind":{"valueSet":[18,17,5,14,9,10,22,24,8,1,12,11,20,6,2,3,21,16,19,25,4,7,15,23,26,13]},"hierarchicalDocumentSymbolSupport":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{},"definition":{"linkSupport":true},"typeDefinition":{"linkSupport":true},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dynamicRegistration":true},"codeLens":{},"documentLink":{},"colorProvider":{},"rename":{}}},"clientName":"Eclipse IDE","trace":"off"}}
[t=1601030988379] LSP4E to io.github.pyvesb.eclipse_solargraph:
Content-Length: 60
[t=1601030988379] LSP4E to io.github.pyvesb.eclipse_solargraph:
{"jsonrpc":"2.0","id":"2","method":"shutdown","params":null}
[t=1601030988379] LSP4E to io.github.pyvesb.eclipse_solargraph:
Content-Length: 47
[t=1601030988379] LSP4E to io.github.pyvesb.eclipse_solargraph:
{"jsonrpc":"2.0","method":"exit","params":null}
[t=1601030988389] LSP4E to io.github.pyvesb.eclipse_solargraph:
Content-Length: 1386
[t=1601030988389] LSP4E to io.github.pyvesb.eclipse_solargraph:
{"jsonrpc":"2.0","id":"1","method":"initialize","params":{"processId":9887,"rootPath":"/Users/mshahzaib/Desktop/dev/lansa-lax/ruby/","rootUri":"file:///Users/mshahzaib/Desktop/dev/lansa-lax/ruby/","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","delete","rename"],"failureHandling":"undo"},"symbol":{"dynamicRegistration":true},"executeCommand":{"dynamicRegistration":true},"workspaceFolders":true},"textDocument":{"synchronization":{"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"completionItem":{"snippetSupport":true,"documentationFormat":["markdown","plaintext"]}},"hover":{"contentFormat":["markdown","plaintext"]},"signatureHelp":{},"references":{},"documentHighlight":{},"documentSymbol":{"symbolKind":{"valueSet":[18,17,5,14,9,10,22,24,8,1,12,11,20,6,2,3,21,16,19,25,4,7,15,23,26,13]},"hierarchicalDocumentSymbolSupport":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{},"definition":{"linkSupport":true},"typeDefinition":{"linkSupport":true},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dynamicRegistration":true},"codeLens":{},"documentLink":{},"colorProvider":{},"rename":{}}},"clientName":"Eclipse IDE","trace":"off"}}
From what I can tell, Eclipse is correctly issuing the initialize
request, but there doesn't seem to be any response from the language server, so the IDE eventually gives up and shuts down the server. The times between initialisation and shutdown differ quite a bit, as they depend on what operations you're triggering and how the various timeouts in lsp4e are configured.
The annoying bit is that the above logs are simply the JSON messages exchanged between the server and the client, but we don't get the logs from the language server itself. These would indicate whether there's an exception or slowness at startup. This seems like a limitation in lsp4e, I'm wondering how easy if would be to fix.
If you're up for spending a bit more time on the investigation, you can still get the server's logs by launching the plugin in a developer environment. If you follow the instructions in the README, you'll be able to import the project in a suitable Eclipse distribution. By following the last bullet point in the README, you can then launch the project in a separate Eclipse Application and import some Ruby code in there. In the Console view of the first Eclipse instance (the one where you imported the project), you'll be able to see the Solargraph server logs! Let me know if this makes sense. :)
@MShahzaib did you get a chance to look into the above?
As an alternative for easier debugging, start Solargraph manually from the command line in socket mode (solargraph socket
) and in a separate terminal tab run the following command:
curl -X POST http://127.0.0.1:7658 -d '{"jsonrpc":"2.0","id":"1","method":"initialize","params":{"processId":9887,"rootPath":"/Users/mshahzaib/Desktop/dev/lansa-lax/ruby/","rootUri":"file:///Users/mshahzaib/Desktop/dev/lansa-lax/ruby/","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","delete","rename"],"failureHandling":"undo"},"symbol":{"dynamicRegistration":true},"executeCommand":{"dynamicRegistration":true},"workspaceFolders":true},"textDocument":{"synchronization":{"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"completionItem":{"snippetSupport":true,"documentationFormat":["markdown","plaintext"]}},"hover":{"contentFormat":["markdown","plaintext"]},"signatureHelp":{},"references":{},"documentHighlight":{},"documentSymbol":{"symbolKind":{"valueSet":[18,17,5,14,9,10,22,24,8,1,12,11,20,6,2,3,21,16,19,25,4,7,15,23,26,13]},"hierarchicalDocumentSymbolSupport":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{},"definition":{"linkSupport":true},"typeDefinition":{"linkSupport":true},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dynamicRegistration":true},"codeLens":{},"documentLink":{},"colorProvider":{},"rename":{}}},"clientName":"Eclipse IDE","trace":"on"}}'
Worth trying out with the latest version of the plugin, 0.5.0, there were some improvements there.
The plugin is not working, giving errors. The path for the solargraph is correct. No completion is being suggested.