Collapse all region + new ternary refactors

I use a lot CollapseToDefinition (Ctrl M O) and, every time it reopens closed regions, can you add a "Region collapse" setting (Close all / Keep ? / Open all) ?

can you also implement "Convert 'if' to ternary" / "Convert ternary to 'if'" like in Resharper ?

if ((input[0] % 2) + 1 == 27)
    return 1;
else
    return 2;

<==>

return (input[0] % 2) + 1 == 27 ? 1 : 2;

Thanks a lot

Comments

  • I'm inclined to make "Collapse to Definition" always preserve existing regions - can you see any reason why we'd need Close All or Open All?

    Regarding those refactorings, that's a good call - I'll add those along with a bunch more in the next beta.

  • HI, thanks for your quick response,

    I often use regions to gather and hide all my clutters just keeping the WIP code visible but it's up to you if the collapsed region stays collapsed.

    Will the region collapsible states be remembered across restarts ?

  • 9.12.1 has now been released - this includes a modification to not change the expansion state for regions when calling Collapse To Definition.

  • it's works well ... but does not survive a restart. Thanks