C
C#3w ago
cheeze2000

✅ How do I disable auto formatting in vscode?

i'm preetty sure this is c# dev kit because after i disable the extension, the auto formatting disappears. i can't find the setting that disables this behavior
17 Replies
cheeze2000
cheeze2000OP3w ago
seems like uninstalling the c# dev kit extension and downgrading the c# extension helps
sibber
sibber3w ago
you can definitely disable it try asking gpt or something theyre good at that
Angius
Angius3w ago
Why would you not want your code to be made more correct for free?
ero
ero2w ago
You should keep this. This is the correct style to use. If you seriously feel the need to change the style to your requirements, add an .editorconfig file instead and customize the settings there. You can just as well disable formatOnSave. Or any other combination of settings that absolutely do not require you to disable or downgrade extensions.
cheeze2000
cheeze2000OP2w ago
because i don't like allman
ero
ero2w ago
I hate to tell you this, but it's the convention in C#. You should bite the bullet and get used to it. Any C# developer reading your code (which includes asking for help here) will be thankful for sticking to the convention and not having to adjust how they read C# code just for one individual But like I said. You can configure this via an .editorconfig file: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/csharp-formatting-options#new-line-options
cheeze2000
cheeze2000OP2w ago
i tried it and it had no effect
ero
ero2w ago
Then you simply made a mistake, sorry I use exclusively vscode and it respects the editorconfig just fine
cheeze2000
cheeze2000OP2w ago
does it respect those settings you sent?
ero
ero2w ago
Of course
cheeze2000
cheeze2000OP2w ago
which versions of the extensions are you using?
ero
ero2w ago
The latest
cheeze2000
cheeze2000OP2w ago
ok i will actually try it again and let you know
ero
ero2w ago
Don't forget to actually show your files and their contents if it doesn't work, nobody can help otherwise
cheeze2000
cheeze2000OP2w ago
thanks! it worked turns out i forgot the [*.cs] when i first tried it
ero
ero2w ago
I just want to reiterate again to please reconsider and simply stick to the conventions set forth by the language. It's much better to stick to the language's style everywhere instead of your own style everywhere. You always need to have readers and contributors in mind. Other than that, $close
MODiX
MODiX2w ago
If you have no further questions, please use /close to mark the forum thread as answered

Did you find this page helpful?