Allow adding new sqlcmd variables to sql project without DefaultValue (#23229)

This commit is contained in:
Kim Santiago
2023-05-26 11:01:20 -07:00
committed by GitHub
parent 1a1839ab09
commit 5560b52df1
3 changed files with 44 additions and 2 deletions

View File

@@ -993,14 +993,21 @@ export class ProjectsController {
return;
}
const defaultValue = await vscode.window.showInputBox(
let defaultValue = await vscode.window.showInputBox(
{
title: constants.enterNewSqlCmdVariableDefaultValue(variableName),
ignoreFocusOut: true
});
if (!defaultValue) {
return;
// prompt asking if they want to add to add a sqlcmd variable without a default value
const result = await vscode.window.showInformationMessage(constants.addSqlCmdVariableWithoutDefaultValue(variableName), constants.yesString, constants.noString);
if (result === constants.noString) {
return;
} else {
defaultValue = '';
}
}
await project.addSqlCmdVariable(variableName, defaultValue);