mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 01:25:36 -05:00
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:
@@ -51,33 +51,33 @@ export default class MainController implements vscode.Disposable {
|
||||
|
||||
private async initializeDatabaseProjects(): Promise<void> {
|
||||
// init commands
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.properties', async (node: WorkspaceTreeItem) => { await vscode.window.showErrorMessage(`Properties not yet implemented: ${node.element.uri.path}`); }); // TODO
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.properties', async (node: WorkspaceTreeItem) => { return vscode.window.showErrorMessage(`Properties not yet implemented: ${node.element.uri.path}`); }); // TODO
|
||||
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.build', async (node: WorkspaceTreeItem) => { await this.projectsController.buildProject(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.build', async (node: WorkspaceTreeItem) => { return this.projectsController.buildProject(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.publish', async (node: WorkspaceTreeItem) => { this.projectsController.publishProject(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.deployLocal', async (node: WorkspaceTreeItem) => { this.projectsController.deployProject(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.schemaCompare', async (node: WorkspaceTreeItem) => { await this.projectsController.schemaCompare(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.createProjectFromDatabase', async (context: azdataType.IConnectionProfile | vscodeMssql.ITreeNodeInfo | undefined) => { await this.projectsController.createProjectFromDatabase(context); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.deployLocal', async (node: WorkspaceTreeItem) => { return this.projectsController.deployProject(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.schemaCompare', async (node: WorkspaceTreeItem) => { return this.projectsController.schemaCompare(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.createProjectFromDatabase', async (context: azdataType.IConnectionProfile | vscodeMssql.ITreeNodeInfo | undefined) => { return this.projectsController.createProjectFromDatabase(context); });
|
||||
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.newScript', async (node: WorkspaceTreeItem) => { await this.projectsController.addItemPromptFromNode(node, templates.script); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.newPreDeploymentScript', async (node: WorkspaceTreeItem) => { await this.projectsController.addItemPromptFromNode(node, templates.preDeployScript); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.newPostDeploymentScript', async (node: WorkspaceTreeItem) => { await this.projectsController.addItemPromptFromNode(node, templates.postDeployScript); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.newTable', async (node: WorkspaceTreeItem) => { await this.projectsController.addItemPromptFromNode(node, templates.table); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.newView', async (node: WorkspaceTreeItem) => { await this.projectsController.addItemPromptFromNode(node, templates.view); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.newStoredProcedure', async (node: WorkspaceTreeItem) => { await this.projectsController.addItemPromptFromNode(node, templates.storedProcedure); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.newExternalStreamingJob', async (node: WorkspaceTreeItem) => { await this.projectsController.addItemPromptFromNode(node, templates.externalStreamingJob); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.newItem', async (node: WorkspaceTreeItem) => { await this.projectsController.addItemPromptFromNode(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.newFolder', async (node: WorkspaceTreeItem) => { await this.projectsController.addFolderPrompt(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.newScript', async (node: WorkspaceTreeItem) => { return this.projectsController.addItemPromptFromNode(node, templates.script); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.newPreDeploymentScript', async (node: WorkspaceTreeItem) => { return this.projectsController.addItemPromptFromNode(node, templates.preDeployScript); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.newPostDeploymentScript', async (node: WorkspaceTreeItem) => { return this.projectsController.addItemPromptFromNode(node, templates.postDeployScript); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.newTable', async (node: WorkspaceTreeItem) => { return this.projectsController.addItemPromptFromNode(node, templates.table); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.newView', async (node: WorkspaceTreeItem) => { return this.projectsController.addItemPromptFromNode(node, templates.view); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.newStoredProcedure', async (node: WorkspaceTreeItem) => { return this.projectsController.addItemPromptFromNode(node, templates.storedProcedure); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.newExternalStreamingJob', async (node: WorkspaceTreeItem) => { return this.projectsController.addItemPromptFromNode(node, templates.externalStreamingJob); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.newItem', async (node: WorkspaceTreeItem) => { return this.projectsController.addItemPromptFromNode(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.newFolder', async (node: WorkspaceTreeItem) => { return this.projectsController.addFolderPrompt(node); });
|
||||
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.addDatabaseReference', async (node: WorkspaceTreeItem) => { await this.projectsController.addDatabaseReference(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.openContainingFolder', async (node: WorkspaceTreeItem) => { await this.projectsController.openContainingFolder(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.editProjectFile', async (node: WorkspaceTreeItem) => { await this.projectsController.editProjectFile(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.delete', async (node: WorkspaceTreeItem) => { await this.projectsController.delete(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.exclude', async (node: WorkspaceTreeItem) => { await this.projectsController.exclude(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.changeTargetPlatform', async (node: WorkspaceTreeItem) => { await this.projectsController.changeTargetPlatform(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.validateExternalStreamingJob', async (node: WorkspaceTreeItem) => { await this.projectsController.validateExternalStreamingJob(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.addDatabaseReference', async (node: WorkspaceTreeItem) => { return this.projectsController.addDatabaseReference(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.openContainingFolder', async (node: WorkspaceTreeItem) => { return this.projectsController.openContainingFolder(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.editProjectFile', async (node: WorkspaceTreeItem) => { return this.projectsController.editProjectFile(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.delete', async (node: WorkspaceTreeItem) => { return this.projectsController.delete(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.exclude', async (node: WorkspaceTreeItem) => { return this.projectsController.exclude(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.changeTargetPlatform', async (node: WorkspaceTreeItem) => { return this.projectsController.changeTargetPlatform(node); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.validateExternalStreamingJob', async (node: WorkspaceTreeItem) => { return this.projectsController.validateExternalStreamingJob(node); });
|
||||
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.addSqlBinding', async (uri: vscode.Uri | undefined) => { await launchAddSqlBindingQuickpick(uri, this.packageHelper); });
|
||||
vscode.commands.registerCommand('sqlDatabaseProjects.addSqlBinding', async (uri: vscode.Uri | undefined) => { return launchAddSqlBindingQuickpick(uri, this.packageHelper); });
|
||||
|
||||
IconPathHelper.setExtensionContext(this.extensionContext);
|
||||
|
||||
|
||||
@@ -247,9 +247,9 @@ export class ProjectsController {
|
||||
|
||||
const message = utils.getErrorMessage(err);
|
||||
if (err instanceof DotNetError) {
|
||||
vscode.window.showErrorMessage(message);
|
||||
void vscode.window.showErrorMessage(message);
|
||||
} else {
|
||||
vscode.window.showErrorMessage(constants.projBuildFailed(message));
|
||||
void vscode.window.showErrorMessage(constants.projBuildFailed(message));
|
||||
}
|
||||
return '';
|
||||
}
|
||||
@@ -281,16 +281,16 @@ export class ProjectsController {
|
||||
if (deployProfile.localDbSetting) {
|
||||
await this.deployService.getConnection(deployProfile.localDbSetting, true, deployProfile.localDbSetting.dbName);
|
||||
}
|
||||
vscode.window.showInformationMessage(constants.deployProjectSucceed);
|
||||
void vscode.window.showInformationMessage(constants.deployProjectSucceed);
|
||||
} else {
|
||||
vscode.window.showErrorMessage(constants.deployProjectFailed(publishResult?.errorMessage || ''));
|
||||
void vscode.window.showErrorMessage(constants.deployProjectFailed(publishResult?.errorMessage || ''));
|
||||
}
|
||||
} else {
|
||||
vscode.window.showErrorMessage(constants.deployProjectFailed(constants.deployProjectFailedMessage));
|
||||
void vscode.window.showErrorMessage(constants.deployProjectFailed(constants.deployProjectFailedMessage));
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
vscode.window.showErrorMessage(constants.deployProjectFailed(utils.getErrorMessage(error)));
|
||||
void vscode.window.showErrorMessage(constants.deployProjectFailed(utils.getErrorMessage(error)));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -318,7 +318,7 @@ export class ProjectsController {
|
||||
|
||||
return publishDatabaseDialog;
|
||||
} else {
|
||||
launchPublishDatabaseQuickpick(project, this);
|
||||
void launchPublishDatabaseQuickpick(project, this);
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
@@ -447,7 +447,7 @@ export class ProjectsController {
|
||||
.withAdditionalProperties(props)
|
||||
.send();
|
||||
|
||||
vscode.window.showErrorMessage(utils.getErrorMessage(err));
|
||||
void vscode.window.showErrorMessage(utils.getErrorMessage(err));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -476,7 +476,7 @@ export class ProjectsController {
|
||||
await project.addFolderItem(relativeFolderPath);
|
||||
this.refreshProjectsTree(treeNode);
|
||||
} catch (err) {
|
||||
vscode.window.showErrorMessage(utils.getErrorMessage(err));
|
||||
void vscode.window.showErrorMessage(utils.getErrorMessage(err));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -540,7 +540,7 @@ export class ProjectsController {
|
||||
await vscode.commands.executeCommand(constants.vscodeOpenCommand, newEntry.fsUri);
|
||||
treeDataProvider?.notifyTreeDataChanged();
|
||||
} catch (err) {
|
||||
vscode.window.showErrorMessage(utils.getErrorMessage(err));
|
||||
void vscode.window.showErrorMessage(utils.getErrorMessage(err));
|
||||
|
||||
TelemetryReporter.createErrorEvent(TelemetryViews.ProjectTree, TelemetryActions.addItemFromTree)
|
||||
.withAdditionalProperties(telemetryProps)
|
||||
@@ -560,7 +560,7 @@ export class ProjectsController {
|
||||
await project.exclude(fileEntry);
|
||||
} else {
|
||||
TelemetryReporter.sendErrorEvent(TelemetryViews.ProjectTree, TelemetryActions.excludeFromProject);
|
||||
vscode.window.showErrorMessage(constants.unableToPerformAction(constants.excludeAction, node.projectUri.path));
|
||||
void vscode.window.showErrorMessage(constants.unableToPerformAction(constants.excludeAction, node.projectUri.path));
|
||||
}
|
||||
|
||||
this.refreshProjectsTree(context);
|
||||
@@ -614,7 +614,7 @@ export class ProjectsController {
|
||||
.withAdditionalProperties({ objectType: node.constructor.name })
|
||||
.send();
|
||||
|
||||
vscode.window.showErrorMessage(constants.unableToPerformAction(constants.deleteAction, node.projectUri.path));
|
||||
void vscode.window.showErrorMessage(constants.unableToPerformAction(constants.deleteAction, node.projectUri.path));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -670,7 +670,7 @@ export class ProjectsController {
|
||||
const result = await vscode.window.showInformationMessage(constants.reloadProject, constants.yesString, constants.noString);
|
||||
|
||||
if (result === constants.yesString) {
|
||||
this.reloadProject(context);
|
||||
return this.reloadProject(context);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -683,7 +683,7 @@ export class ProjectsController {
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
vscode.window.showErrorMessage(utils.getErrorMessage(err));
|
||||
void vscode.window.showErrorMessage(utils.getErrorMessage(err));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -716,7 +716,7 @@ export class ProjectsController {
|
||||
|
||||
if (selectedTargetPlatform) {
|
||||
await project.changeTargetPlatform(constants.targetPlatformToVersion.get(selectedTargetPlatform)!);
|
||||
vscode.window.showInformationMessage(constants.currentTargetPlatform(project.projectFileName, constants.getTargetPlatformFromVersion(project.getProjectTargetVersion())));
|
||||
void vscode.window.showInformationMessage(constants.currentTargetPlatform(project.projectFileName, constants.getTargetPlatformFromVersion(project.getProjectTargetVersion())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -731,7 +731,7 @@ export class ProjectsController {
|
||||
const addDatabaseReferenceDialog = this.getAddDatabaseReferenceDialog(project);
|
||||
addDatabaseReferenceDialog.addReference = async (proj, settings) => await this.addDatabaseReferenceCallback(proj, settings, context as dataworkspace.WorkspaceTreeItem);
|
||||
|
||||
addDatabaseReferenceDialog.openDialog();
|
||||
await addDatabaseReferenceDialog.openDialog();
|
||||
return addDatabaseReferenceDialog;
|
||||
} else {
|
||||
const settings = await addDatabaseReferenceQuickpick(project);
|
||||
@@ -767,7 +767,7 @@ export class ProjectsController {
|
||||
// check for cirular dependency
|
||||
for (let r of projectReferences) {
|
||||
if ((<SqlProjectReferenceProjectEntry>r).projectName === project.projectFileName) {
|
||||
vscode.window.showErrorMessage(constants.cantAddCircularProjectReference(referencedProject?.projectFileName!));
|
||||
void vscode.window.showErrorMessage(constants.cantAddCircularProjectReference(referencedProject?.projectFileName!));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -784,7 +784,7 @@ export class ProjectsController {
|
||||
|
||||
this.refreshProjectsTree(context);
|
||||
} catch (err) {
|
||||
vscode.window.showErrorMessage(utils.getErrorMessage(err));
|
||||
void vscode.window.showErrorMessage(utils.getErrorMessage(err));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -817,10 +817,10 @@ export class ProjectsController {
|
||||
telemetryProps.success = result.success.toString();
|
||||
|
||||
if (result.success) {
|
||||
vscode.window.showInformationMessage(constants.externalStreamingJobValidationPassed);
|
||||
void vscode.window.showInformationMessage(constants.externalStreamingJobValidationPassed);
|
||||
}
|
||||
else {
|
||||
vscode.window.showErrorMessage(result.errorMessage);
|
||||
void vscode.window.showErrorMessage(result.errorMessage);
|
||||
}
|
||||
|
||||
TelemetryReporter.createActionEvent(TelemetryViews.ProjectTree, TelemetryActions.runStreamingJobValidation)
|
||||
@@ -985,7 +985,7 @@ export class ProjectsController {
|
||||
await workspaceApi.addProjectsToWorkspace([vscode.Uri.file(newProjFilePath)]);
|
||||
}
|
||||
} catch (err) {
|
||||
vscode.window.showErrorMessage(utils.getErrorMessage(err));
|
||||
void vscode.window.showErrorMessage(utils.getErrorMessage(err));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1027,7 +1027,7 @@ export class ProjectsController {
|
||||
if (await utils.exists(absolutePath + constants.sqlFileExtension)) {
|
||||
absolutePath += constants.sqlFileExtension;
|
||||
} else {
|
||||
vscode.window.showErrorMessage(constants.cannotResolvePath(absolutePath));
|
||||
void vscode.window.showErrorMessage(constants.cannotResolvePath(absolutePath));
|
||||
return fileFolderList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import { SqlDatabaseProjectProvider } from './projectProvider/projectProvider';
|
||||
let controllers: MainController[] = [];
|
||||
|
||||
export function activate(context: vscode.ExtensionContext): Promise<SqlDatabaseProjectProvider> {
|
||||
vscode.commands.executeCommand('setContext', 'azdataAvailable', !!getAzdataApi());
|
||||
void vscode.commands.executeCommand('setContext', 'azdataAvailable', !!getAzdataApi());
|
||||
// Start the main controller
|
||||
const mainController = new MainController(context);
|
||||
controllers.push(mainController);
|
||||
|
||||
@@ -150,7 +150,7 @@ export class Project implements ISqlProject {
|
||||
}
|
||||
|
||||
if (preDeployScriptCount > 1 || postDeployScriptCount > 1) {
|
||||
window.showWarningMessage(constants.prePostDeployCount, constants.okString);
|
||||
void window.showWarningMessage(constants.prePostDeployCount, constants.okString);
|
||||
}
|
||||
|
||||
// find all none-deployment scripts to include
|
||||
@@ -630,7 +630,7 @@ export class Project implements ISqlProject {
|
||||
itemGroup = this.findOrCreateItemGroup(xmlTag, prePostScriptExist);
|
||||
|
||||
if (prePostScriptExist.scriptExist === true) {
|
||||
window.showInformationMessage(constants.deployScriptExists(xmlTag));
|
||||
void window.showInformationMessage(constants.deployScriptExists(xmlTag));
|
||||
xmlTag = constants.None; // Add only one pre-deploy and post-deploy script. All additional ones get added in the same item group with None tag
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ export async function readPublishProfile(profileUri: vscode.Uri): Promise<Publis
|
||||
const profile = await load(profileUri, dacFxService);
|
||||
return profile;
|
||||
} catch (e) {
|
||||
vscode.window.showErrorMessage(constants.profileReadError(e));
|
||||
void vscode.window.showErrorMessage(constants.profileReadError(e));
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -568,11 +568,11 @@ describe('ProjectsController', function (): void {
|
||||
const addDbReferenceDialog = TypeMoq.Mock.ofType(AddDatabaseReferenceDialog, undefined, undefined, proj);
|
||||
addDbReferenceDialog.callBase = true;
|
||||
addDbReferenceDialog.setup(x => x.addReferenceClick()).returns(() => {
|
||||
projController.object.addDatabaseReferenceCallback(proj,
|
||||
return projController.object.addDatabaseReferenceCallback(proj,
|
||||
{ systemDb: SystemDatabase.master, databaseName: 'master', suppressMissingDependenciesErrors: false },
|
||||
{ treeDataProvider: new SqlDatabaseProjectTreeViewProvider(), element: undefined });
|
||||
return Promise.resolve(undefined);
|
||||
});
|
||||
addDbReferenceDialog.setup(x => x.openDialog()).returns(() => Promise.resolve());
|
||||
|
||||
const projController = TypeMoq.Mock.ofType(ProjectsController);
|
||||
projController.callBase = true;
|
||||
|
||||
@@ -53,7 +53,7 @@ export class NetCoreTool {
|
||||
public async findOrInstallNetCore(): Promise<boolean> {
|
||||
if ((!this.isNetCoreInstallationPresent || !await this.isNetCoreVersionSupported())) {
|
||||
if (vscode.workspace.getConfiguration(DBProjectConfigurationKey)[NetCoreDoNotAskAgainKey] !== true) {
|
||||
this.showInstallDialog(); // Removing await so that Build and extension load process doesn't wait on user input
|
||||
void this.showInstallDialog(); // Removing await so that Build and extension load process doesn't wait on user input
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -226,7 +226,7 @@ export class NetCoreTool {
|
||||
outputChannel.show();
|
||||
|
||||
// Add listeners to print stdout and stderr and exit code
|
||||
child.on('exit', (code: number | null, signal: string | null) => {
|
||||
void child.on('exit', (code: number | null, signal: string | null) => {
|
||||
if (code !== null) {
|
||||
outputChannel.appendLine(localize('sqlDatabaseProjects.RunStreamedCommand.ExitedWithCode', " >>> {0} … exited with code: {1}", command, code));
|
||||
} else {
|
||||
|
||||
@@ -66,7 +66,7 @@ export class PackageHelper {
|
||||
await this.addPackage(project, packageName, packageVersion);
|
||||
}
|
||||
} catch (e) {
|
||||
vscode.window.showErrorMessage(e.message);
|
||||
void vscode.window.showErrorMessage(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ export class PackageHelper {
|
||||
// TODO: figure out which project contains the file
|
||||
// the new style csproj doesn't list all the files in the project anymore, unless the file isn't in the same folder
|
||||
// so we can't rely on using that to check
|
||||
vscode.window.showInformationMessage(`To use SQL bindings, ensure your Azure Functions project has a reference to ${constants.sqlExtensionPackageName}`);
|
||||
void vscode.window.showInformationMessage(`To use SQL bindings, ensure your Azure Functions project has a reference to ${constants.sqlExtensionPackageName}`);
|
||||
console.error('need to find which project contains the file ' + filePath);
|
||||
return undefined;
|
||||
} else if (functionsProjects.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user