Skip to content

Comments

Group templates by filter rather than filtering it out#4826

Open
nturinski wants to merge 8 commits intomainfrom
nat/groupTemplateFilters
Open

Group templates by filter rather than filtering it out#4826
nturinski wants to merge 8 commits intomainfrom
nat/groupTemplateFilters

Conversation

@nturinski
Copy link
Member

This caused a bug when displaying Python v2 triggers.

99% sure it's because of this: https://github.com/microsoft/vscode-azurefunctions/compare/nat/groupTemplateFilters?expand=1#diff-c46886397fa9d35fb1038f5209fb64795b7591a3dc76ebfe658fcdee63c344c1R92

Will fix this and merge after release

@nturinski nturinski requested a review from a team as a code owner November 18, 2025 15:00
@nturinski
Copy link
Member Author

Updated screenshot:
image

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors template filtering to use a grouping approach instead of filtering templates out. Templates are now assigned a templateFilter property (Verified, Core, or All) and displayed using VS Code's grouping feature, rather than filtering them based on a user setting. This change fixes a bug with displaying Python v2 triggers.

Changes:

  • Removed TemplateFilter parameter from getFunctionTemplates method and all its call sites
  • Added templateFilter property to FunctionTemplateBase interface to categorize templates
  • Refactored CentralTemplateProvider.getFunctionTemplates to assign templateFilter to all templates instead of filtering
  • Updated FunctionListStep to use grouping instead of filter selection, enabling enableGrouping on quick pick
  • Removed template filter change UI and related settings updates
  • Deprecated templateFilterSetting in package.json with explanation message
  • Updated sorting logic to always prioritize HttpTrigger/TimerTrigger templates

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/templates/IFunctionTemplate.ts Added optional templateFilter property to categorize templates
src/templates/CentralTemplateProvider.ts Refactored to assign templateFilter to templates instead of filtering them out
src/templates/dotnet/parseDotnetTemplates.ts Set templateFilter to All for dotnet templates
src/commands/createFunction/FunctionListStep.ts Removed filter selection UI, added grouping support, updated sorting
src/constants.ts Removed templateFilterSetting constant
src/vsCodeConfig/verifyVSCodeConfigOnActivate.ts Removed TemplateFilter parameter from getFunctionTemplates call
package.json Deprecated templateFilter setting with explanation message
test/*.ts Updated test calls to remove TemplateFilter parameter
Comments suppressed due to low confidence (2)

src/commands/createFunction/FunctionListStep.ts:140

  • The "No templates found" warning option (lines 134-140) doesn't have a group property set, similar to the OpenAPI option. For consistency with other non-template options ("Skip for now" and "Reload templates"), consider adding group: ' ' to ensure it's displayed in a separate group from actual templates.
        if (templates.length === 0) {
            picks.push({
                label: localize('noTemplates', '$(warning) No templates found'),
                suppressPersistence: true,
                data: <IFunctionTemplate | TemplatePromptResult><unknown>undefined,
                onPicked: () => { /* do nothing */ }
            })

src/commands/createFunction/FunctionListStep.ts:140

  • Avoid automated semicolon insertion (91% of all statements in the enclosing function have an explicit semicolon).
            })

Copy link
Contributor

Copilot AI commented Jan 14, 2026

@nturinski I've opened a new pull request, #4884, to work on those changes. Once the pull request is ready, I'll request review from you.

nturinski and others added 2 commits January 14, 2026 15:18
* Initial plan

* Fix sortTemplates bug by removing outer scope variable dependency

Co-authored-by: nturinski <[email protected]>

* Fix duplicate httptrigger regex pattern in getPriority

Co-authored-by: nturinski <[email protected]>

* Update src/commands/createFunction/FunctionListStep.ts

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: nturinski <[email protected]>
Co-authored-by: Nathan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants