[groovy] do not offer to select reference expression if it is resolved to class and has reference parent.

Cover cases when it is qualified name like `SomeClass` in `SomeClass.InnerClass` or `SomeClass.STATIC_FIELD` should not be considered as an expression.
This commit is contained in:
Daniil Ovchinnikov
2015-10-28 14:48:03 +03:00
parent 5e936c2b07
commit d893a7581f
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -216,6 +216,9 @@ public abstract class GrIntroduceHandlerBase<Settings extends GrIntroduceSetting
if (expression instanceof GrParenthesizedExpression && !expressions.contains(((GrParenthesizedExpression)expression).getOperand())) {
expressions.add(((GrParenthesizedExpression)expression).getOperand());
}
if (expression.getParent() instanceof GrReferenceExpression
&& expression instanceof GrReferenceExpression
&& ((GrReferenceExpression)expression).resolve() instanceof PsiClass) continue;
if (expressionIsIncorrect(expression, acceptVoidCalls)) continue;
expressions.add(expression);