Skip to content

Razor editor format document indents incorrectly for InputSelect components #5676

@vsfeedback

Description

@vsfeedback

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


When using Format Document (Ctrl E+D), the resulting format of razor files sometimes produces incorrect indentation. This seems to happen where code switches between markup and code.

In the code in the screenshot for example, there are a couple of inconsistencies.

  1. The braces after the foreach loops get indented differently.
  2. The closing tags of the InputSelects end up with indentations not always matching the opening tag.

The second might issue be related to the first, if for example the formatter wants to have the next line after the closing brace to be two tabs behind the brace. Either way, this is not correct.

In my perfect world, the braces would be indented like in the first foreach loop in the screenshot, with the braces at the same level as the foreach keyword, but with the contents of the loop being indented one step. And of course the closing InputSelect tag should be at the same level as the opening tag.


Original Comments

Feedback Bot on 26/10/2021, 01:02 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


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 authorbugSomething isn't workingexternalScope involves an area outside of the repofeature-formatting

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions