introduce variable from polyadic expression: ensure that selected expr would be replaced

This commit is contained in:
anna
2012-04-09 20:29:44 +02:00
parent 41e4ff0913
commit 37f41bf73f
4 changed files with 89 additions and 0 deletions
@@ -752,6 +752,10 @@ public abstract class IntroduceVariableBase extends IntroduceHandlerBase {
}
}
if (!deleteSelf && replaceSelf && expr1 instanceof PsiPolyadicExpression && expr1.isValid() && !expr1.isPhysical() ) {
array.add(replace(expr1, ref, project));
}
if (editor != null) {
final PsiElement[] replacedOccurences = PsiUtilBase.toPsiElementArray(array);
highlightReplacedOccurences(project, editor, replacedOccurences);