use of com.perl5.lang.perl.psi.PsiPerlStringList in project Perl5-IDEA by Camelcade.
the class PerlMooseExtendsStatementImpl method getParentsList.
@NotNull
protected List<String> getParentsList() {
List<String> result = new ArrayList<>();
PsiElement expr = getExpr();
if (expr != null) {
if (expr instanceof PerlString) {
String content = ElementManipulators.getValueText(expr);
if (!content.isEmpty()) {
result.add(content);
}
} else if (expr instanceof PsiPerlCommaSequenceExpr) {
PsiElement element = expr.getFirstChild();
while (element != null) {
if (element instanceof PerlString) {
String content = ElementManipulators.getValueText(element);
if (!content.isEmpty()) {
result.add(content);
}
}
element = element.getNextSibling();
}
} else if (expr instanceof PsiPerlStringList) {
for (PsiElement element : PerlPsiUtil.collectStringElements(expr.getFirstChild())) {
String content = element.getText();
if (!content.isEmpty()) {
result.add(content);
}
}
} else {
// todo we need to somehow mark statement as bad
}
}
return result;
}
Aggregations