Skip to content

Analyzer that checks the breaking behavior of expression bodies #1575

@cbersch

Description

@cbersch

In our code we prefer having single line methods and properties as expression bodies with

roslynator_body_style = expression
roslynator_use_block_body_when_declaration_spans_over_multiple_lines = true
roslynator_use_block_body_when_expression_spans_over_multiple_lines = true

However, we also like to break before => to easier see the actual body.

For that I would like to request an analyzer and fix.

Example

public int Property
    => 12;

public int DoSomething()
    => SingleLineBreaksBeforeArray();

What do you think of it?

It could be an option like

roslynator_expression_body_new_line = never|after_arrow|before_arrow

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions