Skip to content

Commit

Permalink
Change the status ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvmanila committed Sep 9, 2024
1 parent a5d69ef commit 88e424c
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/common/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,14 +439,6 @@ export async function startServer(
},
);
traceInfo(`Server: Start requested.`);
try {
await newLSClient.start();
updateStatus(undefined, LanguageStatusSeverity.Information, false);
} catch (ex) {
updateStatus(l10n.t("Server failed to start."), LanguageStatusSeverity.Error);
traceError(`Server: Start failed: ${ex}`);
return undefined;
}

_disposables.push(
newLSClient.onDidChangeState((e) => {
Expand Down Expand Up @@ -478,12 +470,25 @@ export async function startServer(
}),
);

try {
await newLSClient.start();
} catch (ex) {
updateStatus(l10n.t("Server failed to start."), LanguageStatusSeverity.Error);
traceError(`Server: Start failed: ${ex}`);
dispose();
return undefined;
}

return newLSClient;
}

export async function stopServer(lsClient: LanguageClient): Promise<void> {
traceInfo(`Server: Stop requested`);
await lsClient.stop();
dispose();
}

function dispose(): void {
_disposables.forEach((d) => d.dispose());
_disposables = [];
}

0 comments on commit 88e424c

Please sign in to comment.