Search in sources :

Example 1 with DynamicMembersHint

use of org.jetbrains.plugins.groovy.lang.resolve.processors.DynamicMembersHint in project intellij-community by JetBrains.

the class GrAssignmentExpressionImpl method processDeclarations.

@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place) {
    final ElementClassHint classHint = processor.getHint(ElementClassHint.KEY);
    if (!ResolveUtil.shouldProcessProperties(classHint))
        return true;
    final DynamicMembersHint dynamicMembersHint = processor.getHint(DynamicMembersHint.KEY);
    if (dynamicMembersHint != null && !dynamicMembersHint.shouldProcessProperties())
        return true;
    if (!(getParent() instanceof GroovyFileImpl))
        return true;
    final GroovyFileImpl file = (GroovyFileImpl) getParent();
    if (!file.isInScriptBody(lastParent, place))
        return true;
    final GrExpression lValue = getLValue();
    if (!processLValue(processor, state, place, file, lValue))
        return false;
    if (lValue instanceof GrTupleExpression) {
        for (GrExpression expression : ((GrTupleExpression) lValue).getExpressions()) {
            if (!processLValue(processor, state, place, file, expression))
                return false;
        }
    }
    return true;
}
Also used : ElementClassHint(com.intellij.psi.scope.ElementClassHint) GroovyFileImpl(org.jetbrains.plugins.groovy.lang.psi.impl.GroovyFileImpl) DynamicMembersHint(org.jetbrains.plugins.groovy.lang.resolve.processors.DynamicMembersHint)

Aggregations

ElementClassHint (com.intellij.psi.scope.ElementClassHint)1 GroovyFileImpl (org.jetbrains.plugins.groovy.lang.psi.impl.GroovyFileImpl)1 DynamicMembersHint (org.jetbrains.plugins.groovy.lang.resolve.processors.DynamicMembersHint)1