@Override
  public boolean processDeclarations(@NotNull final PsiScopeProcessor processor,
                                     @NotNull ResolveState state,
                                     @Nullable PsiElement lastParent,
                                     @NotNull PsiElement place) {
    ElementClassHint classHint = processor.getHint(ElementClassHint.KEY);

    if (getStub() == null) {
      if (!(lastParent instanceof GrMember)) {
        // only local usages are traversed here. Having a stub means the clients are outside and won't see our variables
        if (!processLocals(this, processor, state, lastParent, place)) return false;
      }
      if (!processBindings(this, processor, state, lastParent, place)) return false;
    }

    if (myContext != null) {
      return true;
    }

    final GroovyScriptClass scriptClass = getScriptClass();
    if (scriptClass != null && !(lastParent instanceof GrTypeDefinition)) {
      if (!ResolveUtil.processClassDeclarations(scriptClass, processor, state, lastParent, place)) return false;
    }

    if (!super.processDeclarations(processor, state, lastParent, place)) return false;

    if (ResolveUtil.shouldProcessProperties(classHint)) {
      if (lastParent != null && !(lastParent instanceof GrTypeDefinition) && scriptClass != null) {
        if (!ResolveUtil.processElement(processor, getSyntheticArgsParameter(), state)) return false;
      }
    }

    return true;
  }
@Override
  public boolean processDeclarations(@NotNull final PsiScopeProcessor processor,
                                     @NotNull ResolveState state,
                                     @Nullable PsiElement lastParent,
                                     @NotNull PsiElement place)