C# formatting in VSCode since version 1.81 and C# Dev Kit

1.2k views Asked by At

So, apparently there has been an update. And i don't really understand what changed because i don't really keep up to date with changelogs of VSCode, but my C# formatting that i used to define in user/.omnisharp/omnisharp.json doesn't work anymore. I remember that last update, i already had to add "omnisharp.enableEditorConfigSupport": false to my settings.json in order to have omnisharp.json to be taken into account.

But, what happened since the latest update? Since i use Unity, I installed C# Dev Kit and the new Unity extension as described here, but i don't really understand what is going on.

If i understand correctly, the C# extension do not use Omnisharp by default anymore? So my question is, how am i supposed to have custom formatting options? (Especially keeping curly braces on the same line). Do i HAVE to use EditorConfig for VS Code extension? If so, how do i even keep open curly braces on the same line?

I managed to revert to using Omnisharp and make use my previous way of formatting trough omnisharp.json but i have that kinf of feeling that this method is on the way out, right?

2

There are 2 answers

1
Thomas Finet On

I encountered the same problem today and I apparently fixed it by going to Preferences > Settings > Omnisharp > Toggling on 'Dotnet>Server: Use Omnisharp'

Hope that helps

0
Teddy Smith On

If you look at bottom right of Vs Code (beside UTF-8), you will see an error saying something along the lines of "Prettier not working". Switch the formatter and that should fix.