I am using ReSharper 2017.1.2 and am having trouble finding the settings that will get this code to reformat in a desirable way. I am using Eigen (http://eigen.tuxfamily.org) in C++ to do matrix math, and ReSharper likes to add extra spaces before the commas in the comma initializer. It also does not properly indent the lines.
Currently I get this when applying a reformat:
tilt_mat << 1 , 0 , 0 , // notice the spaces before the commas
0 , cos(tilt) , sin(tilt) , // notice the not-aligned indent
0 , -sin(tilt) , cos(tilt);
But what I would like to get is this:
tilt_mat << 1, 0, 0,
0, cos(tilt), sin(tilt),
0, -sin(tilt), cos(tilt);
Is there a setting to help with this that I am missing? I have every setting labeled "Before comma in *" under C++ > Formatting Style > Spaces unchecked. My suspicion is that ReSharper is treating the commas as a binary operator.
I realize this syntax is kind of goofy, but it is the only way to initialize a matrix in Eigen. I'm not entirely sure how the Eigen folks created the comma initializer construct. I wasn't aware you could even write code for a comma operator in C++.