diff --git a/src/commands/createNewProject/createNewProject.ts b/src/commands/createNewProject/createNewProject.ts index 57ffdbb83..5fbf91600 100644 --- a/src/commands/createNewProject/createNewProject.ts +++ b/src/commands/createNewProject/createNewProject.ts @@ -49,6 +49,7 @@ export async function createNewProjectInternal(context: IActionContext, options: const version: string = options.version || getGlobalSetting(funcVersionSetting) || await tryGetLocalFuncVersion(context, undefined) || latestGAVersion; const projectTemplateKey: string | undefined = getGlobalSetting(projectTemplateKeySetting); const wizardContext: Partial & IActionContext = Object.assign(context, options, { language, version: tryParseFuncVersion(version), projectTemplateKey }); + const optionalExecuteStep = options.executeStep; if (options.folderPath) { FolderListStep.setProjectPath(wizardContext, options.folderPath); @@ -64,7 +65,7 @@ export async function createNewProjectInternal(context: IActionContext, options: const wizard: AzureWizard = new AzureWizard(wizardContext, { title: localize('createNewProject', 'Create new project'), promptSteps: [new FolderListStep(), new NewProjectLanguageStep(options.templateId, options.functionSettings), new OpenBehaviorStep()], - executeSteps: [new OpenFolderStep()] + executeSteps: optionalExecuteStep ? [optionalExecuteStep, new OpenFolderStep()] : [new OpenFolderStep()] }); await wizard.prompt(); await wizard.execute(); diff --git a/src/extension.ts b/src/extension.ts index 2ce62d250..71d223625 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -99,7 +99,7 @@ export async function activateInternal(context: vscode.ExtensionContext, perfSta createFunction: createFunctionFromApi, downloadAppSettings: downloadAppSettingsFromApi, uploadAppSettings: uploadAppSettingsFromApi, - apiVersion: '1.7.0' + apiVersion: '1.8.0' }]); } diff --git a/src/vscode-azurefunctions.api.d.ts b/src/vscode-azurefunctions.api.d.ts index ee46359e9..7de4b7318 100644 --- a/src/vscode-azurefunctions.api.d.ts +++ b/src/vscode-azurefunctions.api.d.ts @@ -3,6 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { AzureWizardExecuteStep, IActionContext } from "@microsoft/vscode-azext-utils"; + export interface AzureFunctionsExtensionApi { apiVersion: string; @@ -83,4 +85,10 @@ export interface ICreateFunctionOptions { * If set, it will automatically select the worker runtime for .NET with the matching targetFramework */ targetFramework?: string | string[]; + + /** + * If set, it will include a step that will be executed prior to OpenFolderStep determined by the priority of the step + * OpenFolder priority is 250 (https://github.com/microsoft/vscode-azurefunctions/blob/main/src/commands/createNewProject/OpenFolderStep.ts#L11) + */ + executeStep?: AzureWizardExecuteStep; }