@@ -7,25 +7,20 @@ import { AzureWizardPromptStep, IAzureQuickPickItem, IAzureQuickPickOptions, non
77import { localize } from '../../localize' ;
88import { IProjectWizardContext } from './IProjectWizardContext' ;
99
10- type ProgrammingModel = { modelVersion : number | undefined , label : string } ;
1110export class ProgrammingModelStep extends AzureWizardPromptStep < IProjectWizardContext > {
1211 public hideStepCount : boolean = true ;
13- private _models : ProgrammingModel [ ] = [ ] ;
12+ private _models : IAzureQuickPickItem < number | undefined > [ ] = [ ] ;
1413 private _learnMoreLink : string | undefined ;
1514
16- public constructor ( options : { models : ProgrammingModel | ProgrammingModel [ ] , learnMoreLink ?: string } ) {
15+ public constructor ( options : { models : IAzureQuickPickItem < number | undefined > [ ] , learnMoreLink ?: string } ) {
1716 super ( ) ;
1817 this . _models = Array . isArray ( options . models ) ? options . models : [ options . models ] ;
1918 this . _learnMoreLink = options . learnMoreLink ;
2019 }
2120
2221 public async prompt ( context : IProjectWizardContext ) : Promise < void > {
23- const modelsPick : IAzureQuickPickItem < number | undefined > [ ] = this . _models . map ( model => {
24- return {
25- label : model . label ,
26- data : model . modelVersion
27- }
28- } ) ;
22+ // duplicate the array so we don't modify the original
23+ const modelsPick : IAzureQuickPickItem < number | undefined > [ ] = this . _models . slice ( ) ;
2924
3025 const learnMoreQp = { label : localize ( 'learnMore' , '$(link-external) Learn more about Model V4...' ) , description : '' , data : undefined } ;
3126 if ( this . _learnMoreLink ) {
@@ -53,7 +48,7 @@ export class ProgrammingModelStep extends AzureWizardPromptStep<IProjectWizardCo
5348 public shouldPrompt ( context : IProjectWizardContext ) : boolean {
5449 // auto-select the default model if there is only one
5550 if ( this . _models . length === 1 ) {
56- context . languageModel = this . _models [ 0 ] . modelVersion ;
51+ context . languageModel = this . _models [ 0 ] . data ;
5752 }
5853
5954 // this only impacts node for now so only check the feature flag for node
0 commit comments