purescript-language-server icon indicating copy to clipboard operation
purescript-language-server copied to clipboard

Retries when restarting ide server.

Open wclr opened this issue 1 year ago • 3 comments
trafficstars

@nwolverson

Can you explain the reason for these retries?

https://github.com/nwolverson/purescript-language-server/blob/ceee3d5ff4cb5beb62a134088502523bc8afb73c/src/LanguageServer/IdePurescript/Main.purs#L280

wclr avatar Nov 16 '24 01:11 wclr

I see now it tries to to reapeat the command on the start if server happens to be not ready just ater start. I happen to get often errors that lead to losing connections to the server when starting IDE (sometimes rarelly during the work), seem due to that is that if connection is lost during the command executing is it thrown. https://github.com/nwolverson/purescript-language-server/blob/ceee3d5ff4cb5beb62a134088502523bc8afb73c/src/IdePurescript/Build.purs#L170

Anyway, going to refactor it a bit.

wclr avatar Nov 21 '24 11:11 wclr

Yes, it turns out that for some people the server starts really slowly, I think that's part of the explanation for how this ended up

nwolverson avatar Nov 21 '24 12:11 nwolverson

I encountered an interesting issue, two instances running in different folders generated the same port for purs-ide, the second instance didn't start in this case (as it found running purs-ide with incorrect path on the port, ans says to correct it manually). I believe in this case it is quite safe to start server on another port. Also port availability (after request to ide) should be checked with other methods.

wclr avatar Nov 22 '24 16:11 wclr