Open Nixxen opened 4 months ago
Switch expressions (as with functions) should be broken if one line is too long to maintain readability. This is an example of a switch expression return. We have the line width set to 120 characters.
Input:
return operation switch { GenericOperationEnum.OperationA => await GetOperationATimelineAsync(timelineRequest), GenericOperationEnum.OperationB => await GetOperationBTimelineAsync(timelineRequest), GenericOperationEnum.OperationC => await GetOperationCTimelineAsync(timelineRequest), GenericOperationEnum.OperationDLongerNameHere => await GetOperationDLongerNameHereTimelineAsync(timelineRequest), GenericOperationEnum.OperationELongerNameHere => await GetOperationELongerNameHereTimelineAsync(timelineRequest), GenericOperationEnum.OperationFLongerNameHere => await GetOperationFLongerNameHereTimelineAsync(timelineRequest), GenericOperationEnum.OperationG => await GetOperationGTimelineAsync(timelineRequest), _ => new() { await GetGenericTimelineDataSeriesAsync(timelineRequest) }, };
Output:
Expected behavior:
Switch expressions (as with functions) should be broken if one line is too long to maintain readability. This is an example of a switch expression return. We have the line width set to 120 characters.
Input:
Output:
Expected behavior: