Skip to content

Commit 023c351

Browse files
authored
Add setting to allow users to select programming model (#4469)
1 parent d696b71 commit 023c351

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,6 +1291,11 @@
12911291
"type": "boolean",
12921292
"description": "%azureFunctions.showMarkdownPreview%",
12931293
"default": true
1294+
},
1295+
"azureFunctions.allowProgrammingModelSelection": {
1296+
"type": "boolean",
1297+
"description": "%azureFunctions.allowProgrammingModelSelection%",
1298+
"default": false
12941299
}
12951300
}
12961301
}

package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"azureFunctions.addBinding": "Add binding...",
3+
"azureFunctions.allowProgrammingModelSelection": "Allow the user to select a programming model when creating a new function project.",
34
"azureFunctions.appSettings.add": "Add New Setting...",
45
"azureFunctions.appSettings.decrypt": "Decrypt Settings",
56
"azureFunctions.appSettings.delete": "Delete Setting...",

src/commands/createNewProject/ProgrammingModelStep.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { FuncVersion } from '../../FuncVersion';
88
import { recommendedDescription } from '../../constants-nls';
99
import { localize } from '../../localize';
1010
import { getTemplateVersionFromLanguageAndModel } from '../../utils/templateVersionUtils';
11+
import { getWorkspaceSetting } from '../../vsCodeConfig/settings';
1112
import { type IProjectWizardContext } from './IProjectWizardContext';
1213

1314
export class ProgrammingModelStep extends AzureWizardPromptStep<IProjectWizardContext> {
@@ -59,7 +60,7 @@ export class ProgrammingModelStep extends AzureWizardPromptStep<IProjectWizardCo
5960
// auto-select the default model if there is only one
6061
if (this._options.models.length === 1) {
6162
context.languageModel = this._options.models[0].data;
62-
} else if (this._options.defaultModel !== undefined) {
63+
} else if (this._options.defaultModel !== undefined && !getWorkspaceSetting("allowProgrammingModelSelection")) {
6364
context.languageModel = this._options.defaultModel;
6465
}
6566
}

0 commit comments

Comments
 (0)