Skip to content

Semantic Snippets - switch snippet#77143

Open
akhera99 wants to merge 4 commits intodotnet:mainfrom
akhera99:snippets/switch
Open

Semantic Snippets - switch snippet#77143
akhera99 wants to merge 4 commits intodotnet:mainfrom
akhera99:snippets/switch

Conversation

@akhera99
Copy link
Member

Adds a switch snippet provider.
Creates a switch snippet which produces a default statement.

@akhera99 akhera99 requested a review from a team as a code owner February 10, 2025 21:35
@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Feb 10, 2025
public const string Else = "else";
public const string Enum = "enum";
public const string For = "for";
public const string ReversedFor = "forr";
Copy link
Member Author

Choose a reason for hiding this comment

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

just reordering alphabetically

Copy link
Member

@JoeRobich JoeRobich left a comment

Choose a reason for hiding this comment

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

The current switch snippet supports generating all cases statements when an enum variable is chosen for switch_on. Semantic snippets do not support this and it would regress the experience.

We need to determine whether:

  1. the Editor team can provide us a callback similar to the current snippets <Function> capability.
  2. we could build it on our side reusing parts of inline rename
  3. we can't fully replace the current snippet model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE Feature - Semantic Snippets untriaged Issues and PRs which have not yet been triaged by a lead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants