@Override
  public boolean isMemberInplaceRenameAvailable(@NotNull PsiElement element, @Nullable PsiElement context) {
    if (context == null || context.getContainingFile() instanceof GroovyFile) return false;
    PsiElement parent = context.getParent();

    //don't try to inplace rename aliased imported references
    if (parent instanceof GrReferenceElement) {
      GroovyResolveResult result = ((GrReferenceElement<?>)parent).advancedResolve();
      PsiElement fileResolveContext = result.getCurrentFileResolveContext();
      if (fileResolveContext instanceof GrImportStatement && ((GrImportStatement)fileResolveContext).isAliasedImport()) {
        return false;
      }
    }
    return element instanceof GrMember;
  }
@Override
  public boolean isMemberInplaceRenameAvailable(@NotNull PsiElement element, @Nullable PsiElement context)