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.
- The braces after the foreach loops get indented differently.
- 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)
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.
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)