LanguageClient
LanguageClient copied to clipboard
Allow RestartingServer behavior to be configured
Would be nice to support behavior for how the RestartingServer
restarts.
Currently, there's a 5 second cooldown hardcoded in: https://github.com/ChimeHQ/LanguageClient/blob/253b8a0d2ea2a8c84cbd51dd6931ae0936b1f1f9/Sources/LanguageClient/RestartingServer.swift#L232
Possible idea:
enum RestartBehavior {
case nextRequest
case afterCooldown(seconds: Int)
}
This might be worthy of a separate issue, but it may also be helpful to allow a closure to be executed when the server restarts. you may want to send the server a didOpen notification or do some other work.
Can you elaborate on what you want to send the server? Its state should be transparently restored when it is started back up. For example, any open documents are automatically re-opened.
It seems like open docs are re-opened only when the server state is set to restartNeeded
but I don't see anywhere that it would reach this state. When calling connectionInvalidated()
the server state gets set to notStarted
after 5 seconds which doesn't reopen docs upon reconnecting.