Is PLACE_SIMPLE_ANONYMOUSMETHOD_ON_SINGLE_LINE designed to ignore max col width?
[7.1.16]
(120 col width set in RS settings)
I use RS cleanup with "reformat code" set, and observe the following behavior:
CASE A) Scenario with PLACE_SIMPLE_ANONYMOUSMETHOD_ON_SINGLE_LINE set to false:
class Foo { //scenario 1, I want RS to wrap this according to max col width private Action<string, string, string, string> _cb = (string someParam1, string someParam2, string someParam3, string someParam4) => { Console.WriteLine(someParam1); } //scenario 2, I do not want RS to wrap the empty anonymous method (unless it exceeds col width) private Action<string, string, string, string> _cb = (string someParam1, string someParam2, string someParam3, string someParam4) => { }; }
CASE B) Scenario with PLACE_SIMPLE_ANONYMOUSMETHOD_ON_SINGLE_LINE set to true:
class Foo { //scenario 1, I want RS to wrap this according to max col width private Action<string, string, string, string> _cb = (string someParam1, string someParam2, string someParam3, string someParam4) => { Console.WriteLine(someParam1); } //scenario 2, I do not want RS to wrap the empty anonymous method (unless it exceeds col width) private Action<string, string, string, string> _cb = (string someParam1, string someParam2, string someParam3, string someParam4) => { } }
CASE C) However, if I have PLACE_SIMPLE_ANONYMOUSMETHOD_ON_SINGLE_LINE set to true, and complete the statement via e.g. ";", it becomes
internal class Foo { //scenario 1, I want RS to wrap this according to max col width private Action<string, string, string, string> _cb = (string someParam1, string someParam2, string someParam3, string someParam4) => { Console.WriteLine(someParam1); }; //scenario 2, I do not want RS to wrap the empty anonymous method (unless it exceeds col width) private Action<string, string, string, string> _cb = (string someParam1, string someParam2, string someParam3, string someParam4) => { }; }
Is this a bug in cleanup, i.e. should not behavior for CASE C) and CASE A) be the same?
Please sign in to leave a comment.
Seems to be a regession bug in 7, works consistent in 6.1 (never exceeding col width).
Thanks - I've confirmed this one as a bug. It is now logged in YouTrack here: http://youtrack.jetbrains.com/issue/RSRP-333712.