Show function name when prompting user for sql binding type (#19336)

This commit is contained in:
Barbara Valdez
2022-05-11 13:51:15 -07:00
committed by GitHub
parent e10b1eb5a9
commit e69bd2c01f
4 changed files with 8 additions and 6 deletions

View File

@@ -285,8 +285,9 @@ export async function isFunctionProject(folderPath: string): Promise<boolean> {
/**
* 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<BindingType | undefined> {
export async function promptForBindingType(funcName?: string): Promise<BindingType | undefined> {
const inputOutputItems: (vscode.QuickPickItem & { type: BindingType })[] = [
{
label: constants.input,
@@ -300,7 +301,7 @@ export async function promptForBindingType(): Promise<BindingType | undefined> {
const selectedBinding = (await vscode.window.showQuickPick(inputOutputItems, {
canPickMany: false,
title: constants.selectBindingType,
title: constants.selectBindingType(funcName),
ignoreFocusOut: true
}));

View File

@@ -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");