Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<!-- endregion exclude-from-marketplace -->

Use the Azure Functions extension to quickly create, debug, manage, and deploy serverless apps directly from VS Code. Check out the [Azure serverless community library](https://aka.ms/AA4ul9b) to view sample projects.
Use the Azure Functions extension to quickly create, debug, manage, and deploy serverless apps directly from VS Code.

**Visit the [wiki](https://github.com/Microsoft/vscode-azurefunctions/wiki) for more information about Azure Functions and how to use the advanced features of this extension.**

Expand Down
18 changes: 5 additions & 13 deletions src/commands/createNewProject/NewProjectLanguageStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { AzureWizardPromptStep, UserCancelledError, type AzureWizardExecuteStep, type IAzureQuickPickItem, type IWizardOptions } from '@microsoft/vscode-azext-utils';
import { AzureWizardPromptStep, type AzureWizardExecuteStep, type IAzureQuickPickItem, type IWizardOptions } from '@microsoft/vscode-azext-utils';
import { type QuickPickOptions } from 'vscode';
import { ProjectLanguage, nodeDefaultModelVersion, nodeLearnMoreLink, nodeModels, pythonDefaultModelVersion, pythonLearnMoreLink, pythonModels } from '../../constants';
import { localize } from '../../localize';
import { TemplateSchemaVersion } from '../../templates/TemplateProviderBase';
import { nonNullProp } from '../../utils/nonNull';
import { openUrl } from '../../utils/openUrl';
import { FunctionListStep } from '../createFunction/FunctionListStep';
import { addInitVSCodeSteps } from '../initProjectForVSCode/InitVSCodeLanguageStep';
import { type IProjectWizardContext } from './IProjectWizardContext';
Expand Down Expand Up @@ -39,7 +38,7 @@ export class NewProjectLanguageStep extends AzureWizardPromptStep<IProjectWizard

public async prompt(context: IProjectWizardContext): Promise<void> {
// Only display 'supported' languages that can be debugged in VS Code
let languagePicks: IAzureQuickPickItem<{ language: ProjectLanguage, model?: number } | undefined>[] = [
let languagePicks: IAzureQuickPickItem<{ language: ProjectLanguage, model?: number }>[] = [
{ label: ProjectLanguage.JavaScript, data: { language: ProjectLanguage.JavaScript } },
{ label: ProjectLanguage.TypeScript, data: { language: ProjectLanguage.TypeScript } },
{ label: ProjectLanguage.CSharp, data: { language: ProjectLanguage.CSharp } },
Expand All @@ -50,23 +49,16 @@ export class NewProjectLanguageStep extends AzureWizardPromptStep<IProjectWizard
{ label: localize('customHandler', 'Custom Handler'), data: { language: ProjectLanguage.Custom } }
];

languagePicks.push({ label: localize('viewSamples', '$(link-external) View sample projects'), data: undefined, suppressPersistence: true });

if (context.languageFilter) {
languagePicks = languagePicks.filter(p => {
return p.data !== undefined && context.languageFilter?.test(p.data.language);
return context.languageFilter?.test(p.data.language);
});
}

const options: QuickPickOptions = { placeHolder: localize('selectLanguage', 'Select a language') };
const result = (await context.ui.showQuickPick(languagePicks, options)).data;
if (result === undefined) {
await openUrl('https://aka.ms/AA4ul9b');
throw new UserCancelledError('viewSampleProjects');
} else {
context.language = result.language;
this.setTemplateSchemaVersion(context);
}
context.language = result.language;
this.setTemplateSchemaVersion(context);
}

public shouldPrompt(context: IProjectWizardContext): boolean {
Expand Down