ReSharper - format generic type constraint

Viewed 71

Here is an example of a generic type constraint declaration from this MSDN page:

class MyClass<T, U>
    where T : class
    where U : struct
{ }

Is it possible to format my class using ReSharper in this way? Currently after formatting runs the declaration resides on one line:

class MyClass<T, U> where T : class where U : struct
{ }
1 Answers

Search for type constraints in the ReSharper options. Un-ticking the Allow type contsraints on the same line should keep the formatting as you want it.

enter image description here

Related