diff --git a/extensions/sql-bindings/src/common/azureFunctionsUtils.ts b/extensions/sql-bindings/src/common/azureFunctionsUtils.ts index 1718e6c7b5..2c6e1bef30 100644 --- a/extensions/sql-bindings/src/common/azureFunctionsUtils.ts +++ b/extensions/sql-bindings/src/common/azureFunctionsUtils.ts @@ -285,8 +285,9 @@ export async function isFunctionProject(folderPath: string): Promise { /** * Prompts the user to select type of binding and returns result + * @param funcName (Optional) Name of the function to which we are adding the SQL Binding */ -export async function promptForBindingType(): Promise { +export async function promptForBindingType(funcName?: string): Promise { const inputOutputItems: (vscode.QuickPickItem & { type: BindingType })[] = [ { label: constants.input, @@ -300,7 +301,7 @@ export async function promptForBindingType(): Promise { const selectedBinding = (await vscode.window.showQuickPick(inputOutputItems, { canPickMany: false, - title: constants.selectBindingType, + title: constants.selectBindingType(funcName), ignoreFocusOut: true })); diff --git a/extensions/sql-bindings/src/common/constants.ts b/extensions/sql-bindings/src/common/constants.ts index b461c6f706..4a95efb2a1 100644 --- a/extensions/sql-bindings/src/common/constants.ts +++ b/extensions/sql-bindings/src/common/constants.ts @@ -52,7 +52,7 @@ export const yesString = localize('yesString', "Yes"); export const noString = localize('noString', "No"); export const input = localize('input', "Input"); export const output = localize('output', "Output"); -export const selectBindingType = localize('selectBindingType', "Select type of binding"); +export function selectBindingType(funcName?: string): string { return funcName ? localize('selectBindingTypeToSpecifiedFunction', "Select type of binding for the function '{0}'", funcName) : localize('selectBindingType', "Select type of binding"); } export const selectAzureFunction = localize('selectAzureFunction', "Select an Azure function in the current file to add SQL binding to"); export const sqlTableOrViewToQuery = localize('sqlTableOrViewToQuery', "SQL table or view to query"); export const sqlTableToUpsert = localize('sqlTableToUpsert', "SQL table to upsert into"); diff --git a/extensions/sql-bindings/src/extension.ts b/extensions/sql-bindings/src/extension.ts index 247b81b60a..4401633380 100644 --- a/extensions/sql-bindings/src/extension.ts +++ b/extensions/sql-bindings/src/extension.ts @@ -20,8 +20,8 @@ export async function activate(context: vscode.ExtensionContext): Promise => { return addSqlBinding(bindingType, filePath, functionName, objectName, connectionStringSetting); }, - promptForBindingType: async (): Promise => { - return promptForBindingType(); + promptForBindingType: async (funcName?: string): Promise => { + return promptForBindingType(funcName); }, promptForObjectName: async (bindingType: BindingType): Promise => { return promptForObjectName(bindingType); diff --git a/extensions/sql-bindings/src/sql-bindings.d.ts b/extensions/sql-bindings/src/sql-bindings.d.ts index bdb60f2dba..8140254bad 100644 --- a/extensions/sql-bindings/src/sql-bindings.d.ts +++ b/extensions/sql-bindings/src/sql-bindings.d.ts @@ -29,8 +29,9 @@ declare module 'sql-bindings' { /** * Prompts the user to select type of binding and returns result or undefined if the user cancelled out of the prompt + * @param funcName (Optional) Name of the function we are adding the SQL Binding to */ - promptForBindingType(): Promise; + promptForBindingType(funcName?: string): Promise; /** * Prompts the user to enter object name for the SQL query