This issue has been moved from a ticket on Developer Community.
[severity:It's more difficult to complete my work]
Sometimes (more than not) when adding statements like if statements or for loops in a .razor component, once I have created the basic form of the statement as indicated in the attached image, and I press Enter, the curly braces expand as expected, with a blank like between them. However, when the auto-expansion occurs, some indentation in previous blocks of code are then "broken" and it makes it very hard to see where some of them start and then end to fix them.
Now extracting several of the indentation layers to different methods should make it easier to see where the statements start and end, but even if I add the if(){} to the first indentation layer, at the bottom of the .razor file, it still breaks the indentation near the start of the @code block.
! [image.png] (https://aka.ms/dc/image?name=B45054fa0c3634e839578f3e5383c7d5a637792922209624403_20220201-080340-image.png&tid=45054fa0c3634e839578f3e5383c7d5a637792922209624403)
Original Comments
Feedback Bot on 2/3/2022, 01:36 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.
David Wengier [MSFT] on 2/4/2022, 02:19 PM:
Thanks for reporting this issue. To better understand what you’re seeing would it be possible for you to attach a larger screenshot, showing the code you are typing in, and the code above that becomes broken? Perhaps a screen recording, or a even just a before and after image would be very helpful.
It is intentional that some formatting is done in surrounding code however we certainly don’t want to have anything end up “broken”.
Stephan van der Westhuizen on 3/4/2022, 07:30 PM:
(private comment, text removed)
Feedback Bot on 2/16/2022, 06:48 PM:
We will close this report in 14 days because we don’t have enough information to investigate further. To keep the problem open, please provide the requested details.
Stephan van der Westhuizen on 3/9/2022, 06:42 PM:
Should I give more information on this topic? It makes it quite hard to do any work in a large razor file, as the indentation breaks, and the cursor jumps to the top of the file so i lose my place in the file very easily.
Original Solutions
(no solutions)
This issue has been moved from a ticket on Developer Community.
[severity:It's more difficult to complete my work]
Sometimes (more than not) when adding statements like if statements or for loops in a .razor component, once I have created the basic form of the statement as indicated in the attached image, and I press Enter, the curly braces expand as expected, with a blank like between them. However, when the auto-expansion occurs, some indentation in previous blocks of code are then "broken" and it makes it very hard to see where some of them start and then end to fix them.
Now extracting several of the indentation layers to different methods should make it easier to see where the statements start and end, but even if I add the if(){} to the first indentation layer, at the bottom of the .razor file, it still breaks the indentation near the start of the @code block.
! [image.png] (https://aka.ms/dc/image?name=B45054fa0c3634e839578f3e5383c7d5a637792922209624403_20220201-080340-image.png&tid=45054fa0c3634e839578f3e5383c7d5a637792922209624403)
Original Comments
Feedback Bot on 2/3/2022, 01:36 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.
David Wengier [MSFT] on 2/4/2022, 02:19 PM:
Thanks for reporting this issue. To better understand what you’re seeing would it be possible for you to attach a larger screenshot, showing the code you are typing in, and the code above that becomes broken? Perhaps a screen recording, or a even just a before and after image would be very helpful.
It is intentional that some formatting is done in surrounding code however we certainly don’t want to have anything end up “broken”.
Stephan van der Westhuizen on 3/4/2022, 07:30 PM:
(private comment, text removed)
Feedback Bot on 2/16/2022, 06:48 PM:
We will close this report in 14 days because we don’t have enough information to investigate further. To keep the problem open, please provide the requested details.
Stephan van der Westhuizen on 3/9/2022, 06:42 PM:
Should I give more information on this topic? It makes it quite hard to do any work in a large razor file, as the indentation breaks, and the cursor jumps to the top of the file so i lose my place in the file very easily.
Original Solutions
(no solutions)