Search in sources :

Example 1 with PerlClassAccessorWrapperStub

use of com.perl5.lang.perl.parser.Class.Accessor.psi.stubs.PerlClassAccessorWrapperStub in project Perl5-IDEA by Camelcade.

the class PerlClassAccessorWrapper method isFollowBestPractice.

public boolean isFollowBestPractice() {
    PerlPolyNamedElementStub stub = getStub();
    if (stub != null) {
        return ((PerlClassAccessorWrapperStub) stub).isFollowBestPractice();
    }
    PerlClassAccessorWrapperStub greenStub = getGreenStub();
    if (greenStub != null) {
        return greenStub.isFollowBestPractice();
    }
    boolean[] result = new boolean[] { false };
    // fixme we need a smarter treewalkup here, scopes are not necessary here
    PerlResolveUtil.treeWalkUp(this, (element, state) -> {
        if (element instanceof PsiPerlNamespaceContent) {
            return false;
        }
        if (PsiUtilCore.getElementType(element) == CLASS_ACCESSOR_FBP) {
            result[0] = true;
            return false;
        }
        return true;
    });
    return result[0];
}
Also used : PerlPolyNamedElementStub(com.perl5.lang.perl.psi.stubs.PerlPolyNamedElementStub) PerlClassAccessorWrapperStub(com.perl5.lang.perl.parser.Class.Accessor.psi.stubs.PerlClassAccessorWrapperStub) PsiPerlNamespaceContent(com.perl5.lang.perl.psi.PsiPerlNamespaceContent)

Aggregations

PerlClassAccessorWrapperStub (com.perl5.lang.perl.parser.Class.Accessor.psi.stubs.PerlClassAccessorWrapperStub)1 PsiPerlNamespaceContent (com.perl5.lang.perl.psi.PsiPerlNamespaceContent)1 PerlPolyNamedElementStub (com.perl5.lang.perl.psi.stubs.PerlPolyNamedElementStub)1