was the original code, then the light bulb allows you to - "invert if condition" - "simplify boolean condition"
generally, it would be great to sort the "non-logic-breaking" intentions to the beginning of the list - you know, the kind of refactorings that do not alter the logical flow, or in other words, the "harmless" ones ;)
I also think non-semantic intentions should be highlighted in some special way, like with an asterisk or a differently colored lightbulb. What would yo uthink of this?
Michael Damberger wrote:
if (myvar == true) ...
was the original code, then the light bulb allows you to - "invert if condition" - "simplify boolean condition"
generally, it would be great to sort the "non-logic-breaking" intentions to the beginning of the list - you know, the kind of refactorings that do not alter the logical flow, or in other words, the "harmless" ones ;)
Both "invert if condition" and "simplify boolean condition" do not change the semantics of the code actually.
Bas
Michael Damberger wrote:
if (myvar == true) ...
was the original code, then the light bulb allows you to - "invert if condition" - "simplify boolean condition"
generally, it would be great to sort the "non-logic-breaking" intentions to the beginning of the list - you know, the kind of refactorings that do not alter the logical flow, or in other words, the "harmless" ones ;)
generally, it would be great to sort the "non-logic-breaking" intentions to the beginning of the list - you know, the kind of refactorings that do not alter the logical flow, or in other words, the "harmless" ones ;)
Strictly speaking, "invert if condition" is "harmless" as well as it doesn't change the logic of your code. With so many new intentions around, it would probably need a do-what-I-mean mind reading device that can select the intention you want. And even then, people would complain that the intention order changes. No wait, with a do-what-I-mean device we wouldn't need intention actions any more at all, the correct code would just magically appear on the screen ;)
The best solution for this specific case would probably be to make the "invert if condition" intention only available when the caret is placed on the "if" keyword, but I think we already had that and it was requested to make it available on the condition as well.
>> generally, it would be great to sort the "non-logic-breaking" intentions to the beginning of the list - you know, the kind of refactorings that do not alter the logical flow, or in other words, the "harmless" ones ;)
The best solution for this specific case would probably be to make the "invert if condition" intention only available when the caret is placed on the "if" keyword,
+1
Michael Damberger wrote:
The intention or the quick fix of the inspection? Perhaps you could
submit a JIRA request with a little bit of example code or a screen shot?
Bas
if (myvar == true) ...
was the original code, then the light bulb allows you to
- "invert if condition"
- "simplify boolean condition"
generally, it would be great to sort the "non-logic-breaking" intentions to the beginning of the list - you know, the kind of refactorings that do not alter the logical flow, or in other words, the "harmless" ones ;)
will make JIRA entry when I have more time...
I also think non-semantic intentions should be highlighted in some
special way, like with an asterisk or a differently colored lightbulb.
What would yo uthink of this?
Michael Damberger wrote:
Both "invert if condition" and "simplify boolean condition" do not
change the semantics of the code actually.
Bas
Michael Damberger wrote:
Michael Damberger wrote:
Strictly speaking, "invert if condition" is "harmless" as well as it doesn't
change the logic of your code. With so many new intentions around, it would
probably need a do-what-I-mean mind reading device that can select the intention
you want. And even then, people would complain that the intention order changes.
No wait, with a do-what-I-mean device we wouldn't need intention actions any
more at all, the correct code would just magically appear on the screen ;)
The best solution for this specific case would probably be to make the "invert
if condition" intention only available when the caret is placed on the "if"
keyword, but I think we already had that and it was requested to make it
available on the condition as well.
Sascha
Sascha Weinreuter wrote:
>> generally, it would be great to sort the "non-logic-breaking" intentions to the beginning of the list - you know, the kind of refactorings that do not alter the logical flow, or in other words, the "harmless" ones ;)
Agreed.
Bas
sorry - I should have looked what "invert if condition" really does.
it missed that it does not change semantics in fact!