use of com.google.idea.blaze.base.lang.buildfile.psi.ListLiteral in project intellij by bazelbuild.
the class GlobReference method resolveListContents.
private static List<String> resolveListContents(Expression expr) {
if (expr == null) {
return ImmutableList.of();
}
PsiElement rootElement = PsiUtils.getReferencedTargetValue(expr);
if (!(rootElement instanceof ListLiteral)) {
return ImmutableList.of();
}
Expression[] children = ((ListLiteral) rootElement).getElements();
List<String> strings = Lists.newArrayListWithCapacity(children.length);
for (Expression child : children) {
if (child instanceof StringLiteral) {
strings.add(((StringLiteral) child).getStringContents());
}
}
return strings;
}
Aggregations