mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 13:31:28 +07:00
CollapseIntoLoopAction: disable when expression is written
GitOrigin-RevId: aa405149d65d0e669bc18f87359f486981c1c899
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0dcc904eb3
commit
51cd561f79
@@ -229,6 +229,7 @@ public class CollapseIntoLoopAction implements IntentionAction {
|
||||
if (!(leftDiff instanceof PsiExpression) || !(rightDiff instanceof PsiExpression)) return false;
|
||||
curIterationExpression = (PsiExpression)rightDiff;
|
||||
firstIterationExpression = (PsiExpression)leftDiff;
|
||||
if (PsiUtil.isAccessedForWriting(curIterationExpression)) return false;
|
||||
PsiType curType = curIterationExpression.getType();
|
||||
PsiType firstType = firstIterationExpression.getType();
|
||||
if (curType == null || !curType.equals(firstType)) return false;
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Collapse into loop" "false"
|
||||
class X {
|
||||
void test() {
|
||||
int x, y, z;
|
||||
<selection>x = 1;
|
||||
y = 1;
|
||||
z = 1;</selection>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user