Search in sources :

Example 36 with SourcePosition

use of com.intellij.debugger.SourcePosition 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

SourcePosition (com.intellij.debugger.SourcePosition)36 Project (com.intellij.openapi.project.Project)13 Nullable (org.jetbrains.annotations.Nullable)11 EvaluateException (com.intellij.debugger.engine.evaluation.EvaluateException)9 VirtualFile (com.intellij.openapi.vfs.VirtualFile)8 XSourcePosition (com.intellij.xdebugger.XSourcePosition)7 DebuggerContextImpl (com.intellij.debugger.impl.DebuggerContextImpl)6 StackFrameProxyImpl (com.intellij.debugger.jdi.StackFrameProxyImpl)6 Document (com.intellij.openapi.editor.Document)6 DebuggerContextCommandImpl (com.intellij.debugger.engine.events.DebuggerContextCommandImpl)5 DebugProcessImpl (com.intellij.debugger.engine.DebugProcessImpl)4 ExpressionEvaluator (com.intellij.debugger.engine.evaluation.expression.ExpressionEvaluator)4 DebuggerSession (com.intellij.debugger.impl.DebuggerSession)4 DebuggerTreeNodeImpl (com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl)4 Location (com.sun.jdi.Location)4 NotNull (org.jetbrains.annotations.NotNull)4 PsiElement (com.intellij.psi.PsiElement)3 DebuggerBundle (com.intellij.debugger.DebuggerBundle)2 DebuggerManagerEx (com.intellij.debugger.DebuggerManagerEx)2 NoDataException (com.intellij.debugger.NoDataException)2