In the last versions of Telerik JustCode we added some nice features that will help you quickly refactor your code, so let’s start right away.
Convert If To Switch Statement
JustCode now detects the if-statements that can be converted to a switch statement and suggests doing it for you. Place your cursor on the if-statement and hit Alt+Enter or choose the F menu from VisualAid, select ‘Convert if to switch statement’.
Convert If To Conditional Expression
Another if conversion that we added is to convert an if-statement to a conditional expression (or ternary operator as some people call it). Place your cursor on the if-statement and hit Alt+Enter or choose the F menu from VisualAid, select ‘Convert if to conditional expression’.
More info: here
Pull Members To Base Type
We’ve had this one for some time but it got a lot better recently. Now you can select multiple members with direct selection in code or in the dialog window that pops up. You can also select a particular base type where you’d like your members to be moved to. Code speaks better than just words:
Press Alt+Ins to bring out the refactorings menu or you can access it from the VisualAid. Select ‘Pull Members To Base Type…’.
You can also execute it on the class identifier which will select all members automatically.
More info: here
Convert Property To Method(s)
You can easily change a class member from property to method without going through each usage and updating it manually. If it has both a getter and a setter – two methods will be created for each.
Place your cursor on the property and select ‘Convert Property To Method(s)’ from the refactorings menu.
That’s it for today, we hope you like it, there is much more to come. Your feedback is welcome and appreciated – write to us in forum or support.
The JustCode team