use of com.google.idea.blaze.base.lang.buildfile.psi.Argument.Keyword in project intellij by bazelbuild.
the class BuildTargetElementEvaluator method getParentFuncallIfNameString.
@Nullable
private static FuncallExpression getParentFuncallIfNameString(PsiElement element) {
PsiElement parent = element.getParent();
if (!(parent instanceof StringLiteral)) {
return null;
}
parent = parent.getParent();
if (!(parent instanceof Keyword)) {
return null;
}
if (!Objects.equals(((Keyword) parent).getName(), "name")) {
return null;
}
parent = parent.getParent();
if (!(parent instanceof ArgumentList)) {
return null;
}
parent = parent.getParent();
return parent instanceof FuncallExpression ? (FuncallExpression) parent : null;
}
Aggregations