use of com.perl5.lang.perl.psi.PsiPerlSubSignatureElementIgnore in project Perl5-IDEA by Camelcade.
the class PerlSubDefinitionMixin method processSignatureElement.
@Override
protected boolean processSignatureElement(PsiElement signatureElement, List<PerlSubArgument> arguments) {
if (!super.processSignatureElement(signatureElement, arguments)) {
if (signatureElement instanceof PsiPerlSubSignatureElementIgnore) {
PerlSubArgument newArgument = PerlSubArgument.empty();
// has elements inside, means optional
newArgument.setOptional(signatureElement.getFirstChild() != signatureElement.getLastChild());
arguments.add(newArgument);
} else if (signatureElement.getNode().getElementType() == PerlElementTypes.OPERATOR_ASSIGN && arguments.size() > 0) {
// setting last element as optional
arguments.get(arguments.size() - 1).setOptional(true);
} else {
return false;
}
}
return true;
}
Aggregations