use of com.google.idea.blaze.base.run.smrunner.BlazeTestEventsHandler in project intellij by bazelbuild.
the class BlazeFilterExistingRunConfigurationProducer method getTestFilter.
private static Optional<String> getTestFilter(ConfigurationContext context) {
RunConfiguration base = context.getOriginalConfiguration(null);
if (!(base instanceof BlazeCommandRunConfiguration)) {
return Optional.empty();
}
TargetExpression target = ((BlazeCommandRunConfiguration) base).getTarget();
if (target == null) {
return Optional.empty();
}
List<Location<?>> selectedElements = SmRunnerUtils.getSelectedSmRunnerTreeElements(context);
if (selectedElements.isEmpty()) {
return null;
}
Optional<BlazeTestEventsHandler> testEventsHandler = BlazeTestEventsHandler.getHandlerForTarget(context.getProject(), target);
return testEventsHandler.map(handler -> handler.getTestFilter(context.getProject(), selectedElements));
}
Aggregations