I'm having problems with Organize Members feature of CodeRush for Roslyn reformatting some of the wrapped parameters for methods, and some type constraints for generic type parameters.
It only happens with the first member in a region and some random type constraints. I haven't discovered the trigger to make it reproducible for the type constraints, but once it starts removing the indention, it keeps doing it. For methods, it seems to be reproducible if the method returns a generic type and is the first member in a region. Code will start out like the first screenshot and after each call to Organize Members (called on file save), the wrapped parameters lose a level of indention, finally ending up like the second screenshot.
I have tried to mess with the formatting features of CodeRush to fix the wrapping, but that introduces other problems as Object Initializers are forced to have extra levels of indentation, even when turned off.
I would like to be able to use Organize Members and have the wrapped parameters not re-formatted when it runs.
Hi Ben,
Thank you for contacting us.
I've tried to reproduce the problem but did not face the behavior you describe.
Here is a video illustrating my attempts.
Could you please send us a single code file where you see this problem?
Also, please send us your CodeRush settings from the following location: %AppData%\CodeRush\Settings\ and solution settings from the .cr folder, which is located near the solution file (if this folder exists). We will try to recreate the same conditions as yours.
Thanks, Eugene. Sorry for the delay; time off got in the way.
Here are the requested personal and solution settings.
The example file attached displays the formatting issue; if you indent lines 21-25 with the parameters, saving will un-indent them one to two levels each time until they are left-aligned to the file.
Thanks again for the help.
Hi Ben,
Thank you for the CodeRush settings and CodeRushFormatting.cs file.
I have reproduced the problem on my side. We will research the problem and try to find way to fix it. We cannot guarantee that we will solve the issue, because it's related with a wide interaction of CodeRush and Visual Studio, thus the problem can be in Visual Studio services, which CodeRush uses.
Once we will have any progress, we will notify you about it in the context of the current ticket.