CLion code formatter: Anyway to prioritize the rules?

Lets say I have a constructor like this:

MyClass::MyClass( Type1 parameter1, Type2 parameter2, Type3 parameter3, Type4 parameter4, Type5 parameter5 ) : MyBaseClass( parameter1, parameter2 ), memberVariable1( parameter3, parameter4 ), memberVariable2( parameter5 ) {

// Other initializations

}

When the line is long, I like to break (wrap if long) at the colon or a comma. However when the line break is at an innermost comma, it is hard to follow. E.g.

MyClass::MyClass( Type1 parameter1, Type2 parameter2, Type3 parameter3, Type4 parameter4, Type5 parameter5 ) : MyBaseClass( parameter1

    , parameter2 ), memberVariable1( parameter3, parameter4 ), memberVariable2( parameter5 ) {

 Is there a way to tell that the first choice is the colon, then an outermost comma and only then an innermost comma?

Similarly, is there a way to prioritize '>' in templates?

 

 

0

请先登录再写评论。