Skip to content

Visual Studio 2022 Preview 4.1 -- Blazor Code Snippets inside Razor file not working #4322

@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


[severity:It bothers me. A fix would be nice]
Steps to reproduce:

  • Open Visual Studio Preview 4.1
  • Create a new Blazor WebAssembly project using the default template
  • Open the Counter.razor page
  • In the markup section (not the code section), type @if followed by pressing Tab twice on the keyboard to insert an IF block.

You can compare this to following the same steps in Visual Studio 2019, where the snippet is inserted. I should note that VS2019 does seem to mess up the spacing and indenting. And normally true would get inserted as the default for the condition which goes not happen even in 2019, but reporting based on 2022 being less functional than 2019.

I'm attaching a video of the difference between VS2019 and VS2022.

Expected result:
Typing @if followed by two TAB presses of the keyboard should insert...

@if (true)
{

}

... with the true condition highlighted and ready to be changed. And then pressing the Enter key should put you in the middle of the block, the same as it would for a normal class/code file.


Original Comments

(no comments)


Original Solutions

(no solutions)

Metadata

Metadata

Assignees

Labels

author: migration bot 🤖The issue was created by a issue mover bot. The author may not be the actual authorenhancementSmall improvement request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions