I develop in C++. I know JetBrain's function "invert if statement" to swap the if block with the else block and also swap the condition. It there a way to do the same in eclipse?
Asked
Active
Viewed 512 times
2 Answers
3
It is possible with Eclipse through "quick fix" operation : select the if keyword and conditions then Ctrl+1 and select "Invert Conditions". Example here https://veerasundar.com/blog/2012/10/eclipse-refactoring-on-steroids/#4-invertingifstatement

Michael Zilbermann
- 1,398
- 9
- 19
-
At least with Eclipse IDE for C/C++ Developers in version 2019-09 this does not work. – Teddy Jan 23 '21 at 10:33
-
My bad, I checked for java, not C/C++ – Michael Zilbermann Jan 24 '21 at 21:18
0
Not as part of the default refactor methods in Eclipse. You could try to write your own refactor plugin to add the functionality (look at this answer), but that might be too much hassle.

Arcanefoam
- 687
- 7
- 20