Search in sources :

Example 1 with PerlImplicitVariablesProvider

use of com.perl5.lang.perl.extensions.PerlImplicitVariablesProvider in project Perl5-IDEA by Camelcade.

the class PerlResolveUtil method processChildren.

public static boolean processChildren(@NotNull PsiElement element, @NotNull PsiScopeProcessor processor, @NotNull ResolveState resolveState, @Nullable PsiElement lastParent, @NotNull PsiElement place) {
    PsiElement run = lastParent == null ? element.getLastChild() : lastParent.getPrevSibling();
    while (run != null) {
        ProgressManager.checkCanceled();
        if (run instanceof PerlCompositeElement && // fixme this should be in composite
        !(run instanceof PerlLexicalScope) && !run.processDeclarations(processor, resolveState, null, place)) {
            return false;
        }
        run = run.getPrevSibling();
    }
    // checking implicit variables fixme: decide, move processchildren to here or move this one to processDeclarations?
    if (element instanceof PerlImplicitVariablesProvider) {
        for (PerlVariableDeclarationElement wrapper : ((PerlImplicitVariablesProvider) element).getImplicitVariables()) {
            ProgressManager.checkCanceled();
            if (!processor.execute(wrapper, resolveState)) {
                return false;
            }
        }
    }
    return true;
}
Also used : PerlCompositeElement(com.perl5.lang.perl.psi.PerlCompositeElement) PerlVariableDeclarationElement(com.perl5.lang.perl.psi.PerlVariableDeclarationElement) PerlImplicitVariablesProvider(com.perl5.lang.perl.extensions.PerlImplicitVariablesProvider) PerlLexicalScope(com.perl5.lang.perl.psi.properties.PerlLexicalScope)

Aggregations

PerlImplicitVariablesProvider (com.perl5.lang.perl.extensions.PerlImplicitVariablesProvider)1 PerlCompositeElement (com.perl5.lang.perl.psi.PerlCompositeElement)1 PerlVariableDeclarationElement (com.perl5.lang.perl.psi.PerlVariableDeclarationElement)1 PerlLexicalScope (com.perl5.lang.perl.psi.properties.PerlLexicalScope)1