Enable no-floating-promises for azurecore (#16946)

* Enable no-floating-promises for azurecore

* few more

* fix compile
This commit is contained in:
Charles Gagnon
2021-09-02 09:20:32 -07:00
committed by GitHub
parent b27bdb0027
commit f35576ae7f
19 changed files with 71 additions and 48 deletions

View File

@@ -22,8 +22,8 @@ export class AzureResourceCacheService implements IAzureResourceCacheService {
return this._context.workspaceState.get(key);
}
public update<T>(key: string, value: T): void {
this._context.workspaceState.update(key, value);
public async update<T>(key: string, value: T): Promise<void> {
await this._context.workspaceState.update(key, value);
}
private _context: ExtensionContext = undefined;

View File

@@ -45,7 +45,7 @@ export class AzureResourceSubscriptionFilterService implements IAzureResourceSub
selectedSubscriptionsCache[account.key.accountId] = selectedSubscriptions;
this._cacheService.update<AzureResourceSelectedSubscriptionsCache>(this._cacheKey, { selectedSubscriptions: selectedSubscriptionsCache });
await this._cacheService.update<AzureResourceSelectedSubscriptionsCache>(this._cacheKey, { selectedSubscriptions: selectedSubscriptionsCache });
const filters: string[] = [];
for (const accountId in selectedSubscriptionsCache) {

View File

@@ -47,7 +47,7 @@ export class AzureResourceSubscriptionService implements IAzureResourceSubscript
const errorMsg = localize('azure.resource.tenantSubscriptionsError', "Failed to get subscriptions for account {0} (tenant '{1}'). {2}", account.key.accountId, tenantId, AzureResourceErrorMessageUtil.getErrorMessage(error));
console.warn(errorMsg);
errors.push(error);
vscode.window.showWarningMessage(errorMsg);
void vscode.window.showWarningMessage(errorMsg);
}
}
if (!gotSubscriptions) {

View File

@@ -37,7 +37,7 @@ const handleNeverUsed = async (): Promise<void> => {
const option = await vscode.window.showInformationMessage<TerminalMessageItem>(neverUsedString, openAzureShellButton, okButton);
if (option.action === TerminalOption.OPEN_SITE) {
vscode.env.openExternal(vscode.Uri.parse('https://aka.ms/AA83f8f'));
void vscode.env.openExternal(vscode.Uri.parse('https://aka.ms/AA83f8f'));
}
};
@@ -115,7 +115,7 @@ export class AzureTerminalService implements IAzureTerminalService {
});
if (!shell) {
vscode.window.showErrorMessage(localize('azure.shellTypeRequired', "You must pick a shell type"));
void vscode.window.showErrorMessage(localize('azure.shellTypeRequired', "You must pick a shell type"));
return;
}
@@ -236,7 +236,7 @@ class AzureTerminal implements vscode.Pseudoterminal {
const terminalUri = terminalResult.data?.socketUri;
if (terminalResult.data.error) {
vscode.window.showErrorMessage(terminalResult.data.error.message);
void vscode.window.showErrorMessage(terminalResult.data.error.message);
}
if (!terminalUri) {