Search code examples
c#.netresharpercode-formatting

How can I tell ReSharper to format these field attributes differently?


When I use ReSharper's Code-Cleanup, this is what it does to my backing fields...

[DebuggerBrowsable(DebuggerBrowsableState.Never)] private readonly DateTime_auctionOn;

^ all on a single line.

How can I tell R# that I want it to be formatted like this:

[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly DateTime _auctionOn;

please.

with cherries on top.


Solution

  • Look under Code Editing > C# > Formatting Style > Line Breaks and Wrapping in the options and take a look at the following entries. specifically this one: Place field attribute on same line

    Place field attribute on same line