Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion client/src/common/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1832,8 +1832,11 @@ export abstract class BaseLanguageClient implements FeatureClient<Middleware, La
}
}
this._connection = undefined;
// `Stopping` counts as handled. The application asked for the close via `stop()`,
// and `closed()` was skipped above so the handler had no chance to set `handled`.
const handled = this.$state === ClientState.Stopping || handlerResult.handled === true;
if (handlerResult.action === CloseAction.DoNotRestart) {
this.error(handlerResult.message ?? 'Connection to server got closed. Server will not be restarted.', undefined, handlerResult.handled === true ? false : 'force');
this.error(handlerResult.message ?? 'Connection to server got closed. Server will not be restarted.', undefined, handled ? false : 'force');
this.cleanUp(ShutdownMode.Stop);
if (this.$state === ClientState.Starting) {
this.$state = ClientState.StartFailed;
Expand Down