When wiring up an LSP, it would be nice to have a clean way to restart language servers. You can’t just start up another instance, because that leads to errors.
You also can’t use a promise, at least not without some extra games, because stop() doesn’t return a promise you can wait for.
So if you want to restart the server, you wind up with some pretty ugly code in the onDidStop() thing, that you set up just to restart.
What would be nice is a simpler solution. Either a synchronous solution (maybe a version of restart() that takes the old client object, and the arguments that you pass to start today), or an easier way to wait on the current stop() function (maybe it could return a waitable Promise?)
I’ve struggled mightily getting server restarts to work well, because e.g. a user can configure a different language server, or different arguments, etc. The experience is less than ideal, IMO.