surround with: don't accept physical expression guessed from selection

This commit is contained in:
Anna.Kozlova
2017-07-06 12:25:37 +02:00
parent 56ce334d56
commit 3d68990811
2 changed files with 16 additions and 2 deletions
@@ -50,7 +50,7 @@ public class JavaExpressionSurroundDescriptor implements SurroundDescriptor {
PsiExpression expr = CodeInsightUtil.findExpressionInRange(file, startOffset, endOffset);
if (expr == null) {
expr = IntroduceVariableBase.getSelectedExpression(file.getProject(), file, startOffset, endOffset);
if (expr == null) {
if (expr == null || expr.isPhysical()) {
return PsiElement.EMPTY_ARRAY;
}
}