use of org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScTypeDefinition in project intellij by bazelbuild.
the class BlazeScalaSpecs2TestExprConfigurationProducer method testLocation.
@Nullable
private static TestLocation testLocation(ConfigurationContext context) {
// Handled by SM runner.
if (!SmRunnerUtils.getSelectedSmRunnerTreeElements(context).isEmpty()) {
return null;
}
ScInfixExpr testCase = Specs2Utils.getContainingTestExprOrScope(context.getPsiLocation());
if (testCase == null) {
return null;
}
ScTypeDefinition testClass = PsiTreeUtil.getParentOfType(testCase, ScTypeDefinition.class);
if (testClass == null) {
return null;
}
TestSize testSize = TestSizeAnnotationMap.getTestSize(testClass);
TargetInfo target = RunUtil.targetForTestClass(testClass, testSize);
if (target == null) {
return null;
}
return new TestLocation(target, testClass, testCase);
}
Aggregations