Search in sources :

Example 1 with PerlStatementMixin

use of com.perl5.lang.perl.psi.mixins.PerlStatementMixin in project Perl5-IDEA by Camelcade.

the class PerlConvertableCompound method isConvertableToModifier.

/**
 * @return true if compound may be converted to the statement modifier
 */
default boolean isConvertableToModifier() {
    PsiPerlBlock mainBlock = getBlock();
    if (mainBlock == null) {
        return false;
    }
    PsiElement[] children = mainBlock.getChildren();
    return children.length == 1 && children[0] instanceof PerlStatementMixin && ((PerlStatementMixin) children[0]).getModifier() == null;
}
Also used : PsiPerlBlock(com.perl5.lang.perl.psi.PsiPerlBlock) PerlStatementMixin(com.perl5.lang.perl.psi.mixins.PerlStatementMixin) PsiElement(com.intellij.psi.PsiElement)

Aggregations

PsiElement (com.intellij.psi.PsiElement)1 PsiPerlBlock (com.perl5.lang.perl.psi.PsiPerlBlock)1 PerlStatementMixin (com.perl5.lang.perl.psi.mixins.PerlStatementMixin)1