import { AzureWizardPromptStep , IAzureQuickPickItem } from "vscode-azureextensionui" ; import { previewDescription } from "../../../constants" ; import { hasMinFuncCliVersion } from "../../../funcCoreTools/hasMinFuncCliVersion" ; import { localize } from "../../../localize" ; import { IJavaProjectWizardContext } from "./IJavaProjectWizardContext" ; const java8 = '8' ; export class JavaVersionStep extends AzureWizardPromptStep < IJavaProjectWizardContext > { public static async setDefaultVersion ( context ) { if ( ! await hasMinFuncCliVersion ( context , '3.0.2630' , context . version ) ) { context . javaVersion = java8 ; } } public async prompt ( context ) { const picks = [ { label : 'Java 8' , data : java8 } , { label : 'Java 11' , description : previewDescription , data : '11' } , ] ; const placeHolder = localize ( 'selectJavaVersion' , 'Select a version of Java' ) ; context . javaVersion = ( await context . ui . showQuickPick ( picks , { placeHolder } ) ) . data ; } public shouldPrompt ( context ) { return ! context . javaVersion ; } }