Skip to content
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

Visual studio 2022 community code cleanup in razor files #10931

Open
vsfeedback opened this issue Sep 26, 2024 · 0 comments
Open

Visual studio 2022 community code cleanup in razor files #10931

vsfeedback opened this issue Sep 26, 2024 · 0 comments
Labels
author: migration bot 🤖 The issue was created by a issue mover bot. The author may not be the actual author feature-formatting

Comments

@vsfeedback
Copy link

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


[severity:It bothers me. A fix would be nice]
I have issues with the visual studio 2022 analyze > code cleanup functionnality. It's working fine in regular C#. My code formats correctly based on my preferences defined in the editorconfig file and the visual studio config. But when using the ctrl k + ctrl d command from within a razor file, the C# code inside a @{ } block is acting weird.
When writing a statement on multiple lines, it removes spaces to make all lines start at the same indent level.

Here are the two codess : The first one is the correctly formatted code inside a regular C# file, the second one is the code inside a code block in a razor file.

First :

IFormGroup? linkedProduct =
        identificationGroups
          . FirstOrDefault( group =>
            group
              . FormItemsCollection
              . OfType<IFormItem>( )
              . Any( item =>
                item
                  . Field == nameof( StockItemDetailDTO.LinkedProduct.Id )
              )
          );

Second :

var linkedProduct =
    identificationGroups
    . FirstOrDefault(group =>
    group
    . FormItemsCollection
    . OfType<IFormItem>()
    . Any(item =>
    item
    . Field == nameof(StockItemDetailDTO.LinkedProduct.Id)
    )
    );

Can you provide me help ?


Original Comments

Feedback Bot on 9/17/2024, 06:30 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.

@dotnet-policy-service dotnet-policy-service bot added untriaged author: migration bot 🤖 The issue was created by a issue mover bot. The author may not be the actual author labels Sep 26, 2024
@phil-allen-msft phil-allen-msft added this to the 17.13 Planning milestone Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author: migration bot 🤖 The issue was created by a issue mover bot. The author may not be the actual author feature-formatting
Projects
None yet
Development

No branches or pull requests

2 participants