Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add Visual Studio snippets extension for static imports and component patterns#309

Open
Copilot wants to merge 3 commits intodevfrom
copilot/create-snippet-package
Open

Add Visual Studio snippets extension for static imports and component patterns#309
Copilot wants to merge 3 commits intodevfrom
copilot/create-snippet-package

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026 *
edited
Loading

BlazorWebFormsComponents uses static classes for enumeration types, requiring verbose fully-qualified names in markup. This adds a VSIX extension to provide code snippets for static imports and common component patterns.

Changes

New Project: BlazorWebFormsComponents.Snippets

  • VSIX extension targeting VS 2022 (17.0+)
  • Contains 13 snippets with .pkgdef registration for Razor/C#/HTML contexts

Static Import Snippets

Enable concise enumeration usage:

  • bwfall - All common enum static imports
  • bwfrepeat - RepeatLayout
  • bwfdatalist - DataListEnum
  • bwfvalidation - Validation enums

Component Pattern Snippets

Templates with tab-navigable placeholders:

  • Data controls: bwfgridview, bwfdl, bwfrepeater, bwfformview
  • Form controls: bwfbutton, bwftextbox, bwfcheckboxlist
  • Validation: bwfrequired, bwfvalsummary

All snippets use correct generic parameter names (ItemType for most components, TItem for CheckBoxList).

Documentation

  • docs/UtilityFeatures/Snippets.md - Usage guide and snippet reference
  • Updated mkdocs.yml and README.md with snippets section

Example

Before (verbose):

<DataList RepeatLayout="BlazorWebFormsComponents.Enums.RepeatLayout.Table"
RepeatDirection="BlazorWebFormsComponents.Enums.DataListEnum.Horizontal">

After (with bwfall snippet + static imports):

@using static BlazorWebFormsComponents.Enums.RepeatLayout
@using static BlazorWebFormsComponents.Enums.DataListEnum

<DataList RepeatLayout="Table" RepeatDirection="Horizontal">
Original prompt

This section details on the original issue you should resolve

Create a Snippet package
Suggestion to publish a Snippet package for the static imports to anabe phau enumeration types as well as other useful markup snippets.

Another option may be an extension or project templates

Comments on the Issue (you are @copilot in this section)

@csharpfritz Coming back to this and getting some Copilot assistance. This is a good idea

You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI assigned Copilot and csharpfritz Jan 29, 2026
Copilot started work on behalf of csharpfritz January 29, 2026 20:22 View session
Copilot AI and others added 2 commits January 29, 2026 20:27
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Snippet package for static imports and markup Add Visual Studio snippets extension for static imports and component patterns Jan 29, 2026
Copilot AI requested a review from csharpfritz January 29, 2026 20:34
Copilot finished work on behalf of csharpfritz January 29, 2026 20:34
csharpfritz marked this pull request as ready for review January 29, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

csharpfritz Awaiting requested review from csharpfritz

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Create a Snippet package

2 participants