Open drieseng opened 2 years ago
@vatsalyaagrawal, is there anything I can do to help? I suppose there are two parts to this issue:
@drieseng we are unlikely to make any changes to our current formatting engine, due to the high risk of regressions and unintended impact on users currently on it. We are currently working on a design for a new formatter (@jmarolf for details) that would ideally allow for more extensibility. We'll add this feature request to that item so it is tracked.
The csharp_indent_braces .editorconfig option currently only allows one to enable or disable indent of braces for all code elements.
Would it be possible to allows indenting of braces to be enabled for specific code elements (just as other options like csharp_new_line_before_open_brace have)?
In our team, we indent braces for object initializers, but not for namespaces, types and methods. For example:
Currently it's not possible to configure this style. We therefore have to disable IDE0055 (
dotnet_diagnostic.IDE0055.severity = none
) which is quite a pity as we miss out on other useful formatting checks.I propose to update csharp_indent_braces to allow for the following values:
For compatibility, the current allowed values true and false can remain supported: