Search in sources :

Example 1 with HTMLMasonBlock

use of com.perl5.lang.htmlmason.parser.psi.HTMLMasonBlock in project Perl5-IDEA by Camelcade.

the class HTMLMasonStubBasedNamedElementImpl method getArgsBlocks.

@NotNull
public List<HTMLMasonCompositeElement> getArgsBlocks() {
    StubElement rootStub = getStub();
    // noinspection Duplicates duplicates file implementation
    if (rootStub != null) {
        final List<HTMLMasonCompositeElement> result = new ArrayList<>();
        PerlPsiUtil.processElementsFromStubs(rootStub, psi -> {
            if (psi instanceof HTMLMasonArgsBlock) {
                result.add(((HTMLMasonArgsBlock) psi));
            }
            return true;
        }, HTMLMasonNamedElement.class);
        return result;
    }
    HTMLMasonBlock block = PsiTreeUtil.getChildOfType(this, HTMLMasonBlock.class);
    if (block != null) {
        return block.getArgsBlocks();
    }
    return Collections.emptyList();
}
Also used : HTMLMasonCompositeElement(com.perl5.lang.htmlmason.parser.psi.HTMLMasonCompositeElement) HTMLMasonBlock(com.perl5.lang.htmlmason.parser.psi.HTMLMasonBlock) ArrayList(java.util.ArrayList) StubElement(com.intellij.psi.stubs.StubElement) HTMLMasonArgsBlock(com.perl5.lang.htmlmason.parser.psi.HTMLMasonArgsBlock) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

StubElement (com.intellij.psi.stubs.StubElement)1 HTMLMasonArgsBlock (com.perl5.lang.htmlmason.parser.psi.HTMLMasonArgsBlock)1 HTMLMasonBlock (com.perl5.lang.htmlmason.parser.psi.HTMLMasonBlock)1 HTMLMasonCompositeElement (com.perl5.lang.htmlmason.parser.psi.HTMLMasonCompositeElement)1 ArrayList (java.util.ArrayList)1 NotNull (org.jetbrains.annotations.NotNull)1