Fix Rider C# formatting of linebreaks for method parameter attributes

Viewed 845

I prefer having parameter attributes stay on the same line as the parameter itself:

[Authorize]
[HttpPost()]
public async Task<ActionResult<QuoteResponse>> CreateQuoteDataOnly([FromBody] QuoteRequest request)

However, I can't find the settings in Rider to make that happen.

Instead I get this:

[Authorize]
[HttpPost()]
public async Task<ActionResult<QuoteResponse>> CreateQuoteDataOnly([FromBody]
    QuoteRequest request)

It puts a line break AFTER the FromBody attribute.

Image of some of my settings in Rider: Rider settings The docs here haven't helped me yet: https://www.jetbrains.com/help/rider/EditorConfig_CSHARP_LineBreaksPageSchema.html

Hopefully I'm not the only one who finds this annoying, and so far my googling skills have failed me.

1 Answers

Increase "Place attribute section list on separate line if it is longer than" parameter value in "Line Breaks and Wrapping" tab: Screenshot

Related