-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Razor editor format document indents incorrectly for InputSelect components #5676
Comments
This seems to repro with an |
This repros it:
Without the outer |
Looks like this is caused by a bug in the Roslyn C# formatter: dotnet/roslyn#57465 |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
The Roslyn issue is fixed! Will leave this open until I have been able to verify the fix. |
Update, this is now blocked by dotnet/roslyn#60437 |
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)
The text was updated successfully, but these errors were encountered: