The problem is whenever i try to type i.e. a method() then put "{" and "enter" to make both braces go below the method (in new line) then only one goes down and the first stays on the right side of the method. I've tried every step from these answers:
How do I set up VSCode to put curly braces on a new line in C# and C++ while typing?
Make the VS Code move the curly brace to the next line automatically
Basically the answer was to type these "FormatOptions" inside omnisharp.json and place that inside my project directory(in the same dir, where Asset folder is):
"FormattingOptions": {
"NewLinesForBracesInLambdaExpressionBody": true,
"NewLinesForBracesInAnonymousMethods": true,
"NewLinesForBracesInAnonymousTypes": true,
"NewLinesForBracesInControlBlocks": true,
"NewLinesForBracesInTypes": true,
"NewLinesForBracesInMethods": true,
"NewLinesForBracesInProperties": true,
"NewLinesForBracesInObjectCollectionArrayInitializers": true,
"NewLinesForBracesInAccessors": true,
"NewLineForElse": true,
"NewLineForCatch": true,
"NewLineForFinally": true
}
With alternately setting false/true these:
"omnisharp.enableEditorConfigSupport": false,
"omnisharp.useEditorFormattingSettings": false,
However that only fixed when I used alt+shift+f, in fact for me putting every FormattingOptions to true was the thing I looked after but I didn't wanted it to work only after I pressed the combination keys. So I cheked the box from the vscode settings -> Format onType to true but that also did not changed anything.
I understand that this problem was asked many times and many solution have been pointed out but so far from the above solutions none helped me.