use of org.jetbrains.java.debugger.breakpoints.properties.JavaLineBreakpointProperties in project intellij-community by JetBrains.
the class JavaLineBreakpointType method getContainingMethod.
@Nullable
public PsiElement getContainingMethod(@NotNull LineBreakpoint<?> breakpoint) {
SourcePosition position = breakpoint.getSourcePosition();
if (position == null)
return null;
JavaBreakpointProperties properties = breakpoint.getProperties();
if (properties instanceof JavaLineBreakpointProperties && !(breakpoint instanceof RunToCursorBreakpoint)) {
Integer ordinal = ((JavaLineBreakpointProperties) properties).getLambdaOrdinal();
if (ordinal > -1) {
List<PsiLambdaExpression> lambdas = DebuggerUtilsEx.collectLambdas(position, true);
if (ordinal < lambdas.size()) {
return lambdas.get(ordinal);
}
}
}
return DebuggerUtilsEx.getContainingMethod(position);
}
use of org.jetbrains.java.debugger.breakpoints.properties.JavaLineBreakpointProperties in project kotlin by JetBrains.
the class KotlinLineBreakpointType method getContainingMethod.
@Override
@Nullable
public PsiElement getContainingMethod(@NotNull LineBreakpoint<?> breakpoint) {
SourcePosition position = breakpoint.getSourcePosition();
if (position == null)
return null;
JavaBreakpointProperties properties = getProperties(breakpoint);
if (properties instanceof JavaLineBreakpointProperties) {
Integer ordinal = ((JavaLineBreakpointProperties) properties).getLambdaOrdinal();
PsiElement lambda = getLambdaByOrdinal(position, ordinal);
if (lambda != null)
return lambda;
}
return getContainingMethod(position.getElementAt());
}
Aggregations