Add no-floating-promises for mssql extension (#16956)

This commit is contained in:
Charles Gagnon
2021-09-02 09:22:25 -07:00
committed by GitHub
parent f35576ae7f
commit 9516472f1b
22 changed files with 92 additions and 79 deletions

View File

@@ -54,7 +54,7 @@ export class SqlToolsServer {
statusView.hide();
}, 1500);
vscode.commands.registerCommand('mssql.loadCompletionExtension', (params: CompletionExtensionParams) => {
this.client.sendRequest(CompletionExtLoadRequest.type, params);
return this.client.sendRequest(CompletionExtLoadRequest.type, params);
});
Telemetry.sendTelemetryEvent('startup/LanguageClientStarted', {
installationTime: String(installationComplete - installationStart),
@@ -70,7 +70,7 @@ export class SqlToolsServer {
return this.client;
} catch (e) {
Telemetry.sendTelemetryEvent('ServiceInitializingFailed');
vscode.window.showErrorMessage(localize('failedToStartServiceErrorMsg', "Failed to start {0}", Constants.serviceName));
void vscode.window.showErrorMessage(localize('failedToStartServiceErrorMsg', "Failed to start {0}", Constants.serviceName));
throw e;
}
}
@@ -93,10 +93,10 @@ export class SqlToolsServer {
return Promise.all([credsStore.start(), resourceProvider.start()]).then();
}
dispose() {
async dispose(): Promise<void> {
this.disposables.forEach(d => d.dispose());
if (this.client) {
this.client.stop();
await this.client.stop();
}
}
}