[groovy] tweak isEquivalentTo() in accessors and light variables
[idea/community.git] / plugins / groovy / groovy-psi / src / org / jetbrains / plugins / groovy / lang / psi / impl / synthetic / GrLightVariable.java
index cf871ff52e026ebb6a21949a54219362633d454f..e2c86883130fd1439db565cbacf2684084fe1752 100644 (file)
@@ -111,6 +111,9 @@ public class GrLightVariable extends GrImplicitVariableImpl implements Navigatab
 
   @Override
   public boolean isEquivalentTo(PsiElement another) {
+    if (another instanceof GrLightVariable) {
+      return myDeclarations.equals(((GrLightVariable)another).getDeclarations());
+    }
     return myDeclarations.contains(another) || super.isEquivalentTo(another);
   }