use of com.intellij.execution.filters.ExceptionFilter in project intellij-community by JetBrains.
the class StackTraceElementObjectRenderer method getFullValueEvaluator.
@Nullable
@Override
public XFullValueEvaluator getFullValueEvaluator(final EvaluationContextImpl evaluationContext, final ValueDescriptorImpl valueDescriptor) {
return new JavaValue.JavaFullValueEvaluator(DebuggerBundle.message("message.node.navigate"), evaluationContext) {
@Override
public void evaluate(@NotNull XFullValueEvaluationCallback callback) {
Value value = valueDescriptor.getValue();
ClassType type = ((ClassType) value.type());
Method toString = type.concreteMethodByName("toString", "()Ljava/lang/String;");
if (toString != null) {
try {
Value res = evaluationContext.getDebugProcess().invokeMethod(evaluationContext, (ObjectReference) value, toString, Collections.emptyList());
if (res instanceof StringReference) {
callback.evaluated("");
final String line = ((StringReference) res).value();
ApplicationManager.getApplication().runReadAction(() -> {
ExceptionFilter filter = new ExceptionFilter(evaluationContext.getDebugProcess().getSession().getSearchScope());
Filter.Result result = filter.applyFilter(line, line.length());
if (result != null) {
final HyperlinkInfo info = result.getFirstHyperlinkInfo();
if (info != null) {
DebuggerUIUtil.invokeLater(() -> info.navigate(valueDescriptor.getProject()));
}
}
});
}
} catch (EvaluateException e) {
LOG.info("Exception while getting stack info", e);
}
}
}
@Override
public boolean isShowValuePopup() {
return false;
}
};
}
Aggregations