Add no-floating-promises rule to sql-database-projects extension (#16943)

* Add no-floating-promises rule to sql-database-projects extension

* fix test
This commit is contained in:
Charles Gagnon
2021-08-31 14:13:52 -07:00
committed by GitHub
parent af135c0d71
commit c8cc6c08e9
13 changed files with 84 additions and 71 deletions

View File

@@ -139,9 +139,9 @@ export class AddDatabaseReferenceDialog {
this.updateEnabledInputBoxes();
if (this.currentReferenceType === ReferenceType.project) {
this.projectRadioButton?.focus();
await this.projectRadioButton?.focus();
} else {
this.systemDatabaseRadioButton?.focus();
await this.systemDatabaseRadioButton?.focus();
}
this.initDialogComplete?.resolve();
@@ -559,7 +559,7 @@ export class AddDatabaseReferenceDialog {
}
this.exampleUsage!.value = newText;
this.exampleUsage?.updateCssStyles({ 'font-style': fontStyle });
void this.exampleUsage?.updateCssStyles({ 'font-style': fontStyle });
}
private validSqlCmdVariables(): boolean {

View File

@@ -17,14 +17,14 @@ export async function launchAddSqlBindingQuickpick(uri: vscode.Uri | undefined,
try {
getAzureFunctionsResult = await azureFunctionsService.getAzureFunctions(uri.fsPath);
} catch (e) {
vscode.window.showErrorMessage(e);
void vscode.window.showErrorMessage(e);
return;
}
const azureFunctions = getAzureFunctionsResult.azureFunctions;
if (azureFunctions.length === 0) {
vscode.window.showErrorMessage(constants.noAzureFunctionsInFile);
void vscode.window.showErrorMessage(constants.noAzureFunctionsInFile);
return;
}
@@ -89,11 +89,11 @@ export async function launchAddSqlBindingQuickpick(uri: vscode.Uri | undefined,
const result = await azureFunctionsService.addSqlBinding(selectedBinding.type, uri.fsPath, azureFunctionName, objectName, connectionStringSetting);
if (!result.success) {
vscode.window.showErrorMessage(result.errorMessage);
void vscode.window.showErrorMessage(result.errorMessage);
return;
}
} catch (e) {
vscode.window.showErrorMessage(e);
void vscode.window.showErrorMessage(e);
return;
}

View File

@@ -123,7 +123,7 @@ export class CreateProjectFromDatabaseDialog {
let formModel = this.formBuilder.component();
await view.initializeModel(formModel);
this.selectConnectionButton?.focus();
await this.selectConnectionButton?.focus();
this.initDialogComplete?.resolve();
});
}
@@ -209,7 +209,7 @@ export class CreateProjectFromDatabaseDialog {
private async updateConnectionComponents(connectionTextboxValue: string, connectionId: string, databaseName?: string) {
this.sourceConnectionTextBox!.value = connectionTextboxValue;
this.sourceConnectionTextBox!.updateProperty('title', connectionTextboxValue);
void this.sourceConnectionTextBox!.updateProperty('title', connectionTextboxValue);
// populate database dropdown with the databases for this connection
if (connectionId) {
@@ -249,7 +249,7 @@ export class CreateProjectFromDatabaseDialog {
this.projectNameTextBox.onTextChanged(() => {
this.projectNameTextBox!.value = this.projectNameTextBox!.value?.trim();
this.projectNameTextBox!.updateProperty('title', this.projectNameTextBox!.value);
void this.projectNameTextBox!.updateProperty('title', this.projectNameTextBox!.value);
this.tryEnableCreateButton();
});
@@ -275,7 +275,7 @@ export class CreateProjectFromDatabaseDialog {
}).component();
this.projectLocationTextBox.onTextChanged(() => {
this.projectLocationTextBox!.updateProperty('title', this.projectLocationTextBox!.value);
void this.projectLocationTextBox!.updateProperty('title', this.projectLocationTextBox!.value);
this.tryEnableCreateButton();
});
@@ -312,7 +312,7 @@ export class CreateProjectFromDatabaseDialog {
}
this.projectLocationTextBox!.value = folderUris[0].fsPath;
this.projectLocationTextBox!.updateProperty('title', folderUris[0].fsPath);
void this.projectLocationTextBox!.updateProperty('title', folderUris[0].fsPath);
});
return browseFolderButton;

View File

@@ -146,7 +146,7 @@ export class PublishDatabaseDialog {
let formModel = this.formBuilder.component();
await view.initializeModel(formModel);
this.loadProfileTextBox!.focus();
await this.loadProfileTextBox!.focus();
});
}
@@ -464,7 +464,7 @@ export class PublishDatabaseDialog {
this.sqlCmdVars = { ...this.project.sqlCmdVariables };
const data = this.convertSqlCmdVarsToTableFormat(this.sqlCmdVars!);
(<azdataType.DeclarativeTableComponent>this.sqlCmdVariablesTable)!.updateProperties({
await (<azdataType.DeclarativeTableComponent>this.sqlCmdVariablesTable)!.updateProperties({
dataValues: data
});
@@ -489,7 +489,7 @@ export class PublishDatabaseDialog {
let connectionTextboxValue: string = getConnectionName(connection);
this.updateConnectionComponents(connectionTextboxValue, this.connectionId);
await this.updateConnectionComponents(connectionTextboxValue, this.connectionId);
// change the database inputbox value to the connection's database if there is one
if (connection.options.database && connection.options.database !== constants.master) {
@@ -505,7 +505,7 @@ export class PublishDatabaseDialog {
private async updateConnectionComponents(connectionTextboxValue: string, connectionId: string) {
this.targetConnectionTextBox!.value = connectionTextboxValue;
this.targetConnectionTextBox!.updateProperty('title', connectionTextboxValue);
await this.targetConnectionTextBox!.updateProperty('title', connectionTextboxValue);
// populate database dropdown with the databases for this connection
if (connectionId) {
@@ -569,7 +569,7 @@ export class PublishDatabaseDialog {
// show file path in text box and hover text
this.loadProfileTextBox!.value = fileUris[0].fsPath;
this.loadProfileTextBox!.updateProperty('title', fileUris[0].fsPath);
await this.loadProfileTextBox!.updateProperty('title', fileUris[0].fsPath);
}
});