use of org.jetbrains.plugins.scala.lang.psi.api.statements.ScFunctionDefinition in project intellij by bazelbuild.
the class BlazeScalaTestRunLineMarkerContributor method getInfo.
@Nullable
@Override
public Info getInfo(PsiElement element) {
if (isIdentifier(element)) {
PsiElement testElement = element.getParent();
if (testElement instanceof ScClass) {
return getInfo((ScClass) testElement, null, super.getInfo(element));
}
ScClass testClass = PsiTreeUtil.getParentOfType(testElement, ScClass.class);
if (testClass == null) {
return null;
}
if (testElement instanceof ScFunctionDefinition) {
return getInfo(testClass, testElement, super.getInfo(element));
}
if (testElement.getParent() instanceof ScInfixExpr) {
ScInfixExpr infixExpr = (ScInfixExpr) testElement.getParent();
if (infixExpr.operation().equals(testElement)) {
return getInfo(testClass, infixExpr, super.getInfo(element));
}
}
}
return null;
}
Aggregations