Home > Software engineering >  Formatting attributes on the same line in editor config
Formatting attributes on the same line in editor config

Time:12-02

Is there any option on editor config to format attributes like in "Example1" instead of "Example2"?

The example below is C#.

CodePudding user response:

AFAIK there is no such option for "vanilla" .editorconfig, but if you are using Rider/Resharper then there are quite a lot of options to setup arrangement of attributes. For example you can use the following:

[*.cs]
place_attribute_on_same_line = false

Or to target specifically fields:

[*.cs]
csharp_place_field_attribute_on_same_line = false
  • Related