SomeDeveloper
SomeDeveloper

Reputation: 2632

ReSharper - format generic type constraint

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
{ }

Upvotes: 1

Views: 137

Answers (1)

Piers Myers
Piers Myers

Reputation: 10899

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

Upvotes: 2

Related Questions