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

Using Suggestion: Move type to (Type).cs will changes indent #8077

Open
Luminash opened this issue Mar 19, 2025 · 2 comments
Open

Using Suggestion: Move type to (Type).cs will changes indent #8077

Luminash opened this issue Mar 19, 2025 · 2 comments

Comments

@Luminash
Copy link

Luminash commented Mar 19, 2025

Type: Bug

Issue Description

I found that when I use Suggestion: Move type to (Type).cs, this will cause indent changes.

Steps to Reproduce

  1. Create a file which contain two classes, with indedt using 4 space, for example:
public record ThisFile()
{
    enum ENUM
    {
        TEST
    }
}

public record Test()
{
    enum T
    {
        ABC
    }
}
  1. Use code suggesion Move type to (TypeName).cs to move one of the class to the other file
  2. Open the file with the moved class, you can see that the indent become Tab instead of Space

Expected Behavior

When using this suggestion to move, I expect that indent won't change, or at least, the moved file should use editor config as rule to reformat itslef

Actual Behavior

When using space as indent, currently it will become Tab instead.

@Luminash Luminash changed the title Move type to file will changes indent Using Suggestion: Move type to (Type).cs will changes indent Mar 19, 2025
@Luminash
Copy link
Author

Luminash commented Mar 19, 2025

After a bit of rechecking, I found that it is because my project folder contain 2 editor config in different subfolder, and since C# pick only the top most editor config, in result there are no editor config been picked.

So I seem it is my fault, sorry!

@Luminash Luminash reopened this Mar 19, 2025
@Luminash
Copy link
Author

I found that sometime it work, some time it doesn't, it is a bit wierd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant