castwide / vscode-solargraph

A Visual Studio Code extension for Solargraph.
Other
424 stars 25 forks source link

A few external server/docker improvements #255

Closed Earlopain closed 2 years ago

Earlopain commented 2 years ago

Meant to address parts of #197. This improves the handling of the external server a bit.

The first commit fixes the restart command not working after the startup of the language server failed because the external server was not yet available. This is more of a bandaid fix, the actual issue is addressed in the second commit.

The second commit fixes the actual hangup of the extension. This was caused by the extension sending a shutdown command to the external server. But since the external server isn't available anymore this hangs. Indefinitely it seems. Work around this by only stopping the client when it is not stopped already. This is achieved by just calling the dispose method, which checks the current state of the client and calls stop accordingly. This now happens asynchronously, which I don't believe is a problem. If is is though, feel free to remove this commit entierly. The trigger of this issue is already fixed with the first commit.

The third commit adds a handy notification asking the user if they want to try connecting again if the connection fails on startup. image I did not add automatic retrying, and it only works for the inital aquisition of the socket. I have no idea how to gracefully handle a connection loss after the inital connection has already been established, but it should certainly be an improvement to how it is currently.

Thanks for creating such an useful extension, I really appreciate it!

castwide commented 2 years ago

Thanks! I made one minor change to resolve a conflict with another commit.

Earlopain commented 2 years ago

Thank you, much appreciated!