Search in sources :

Example 6 with JavaBreakpointProperties

use of org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties 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());
}
Also used : XSourcePosition(com.intellij.xdebugger.XSourcePosition) SourcePosition(com.intellij.debugger.SourcePosition) JavaLineBreakpointProperties(org.jetbrains.java.debugger.breakpoints.properties.JavaLineBreakpointProperties) JavaBreakpointProperties(org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties) PsiElement(com.intellij.psi.PsiElement) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

JavaBreakpointProperties (org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties)6 XSourcePosition (com.intellij.xdebugger.XSourcePosition)4 SourcePosition (com.intellij.debugger.SourcePosition)2 XBreakpoint (com.intellij.xdebugger.breakpoints.XBreakpoint)2 XBreakpointBase (com.intellij.xdebugger.impl.breakpoints.XBreakpointBase)2 Nullable (org.jetbrains.annotations.Nullable)2 JavaExceptionBreakpointProperties (org.jetbrains.java.debugger.breakpoints.properties.JavaExceptionBreakpointProperties)2 JavaLineBreakpointProperties (org.jetbrains.java.debugger.breakpoints.properties.JavaLineBreakpointProperties)2 PsiElement (com.intellij.psi.PsiElement)1