From d152ead589a526e370d4b80bb400e8376a5c8e30 Mon Sep 17 00:00:00 2001 From: Elizaveta Shashkova Date: Fri, 12 Aug 2016 17:25:39 +0300 Subject: [PATCH] Breakpoints ignored after code editing (PY-19642) Do not rely on breakpoint's offset, because it isn't always updated after code editing --- python/src/com/jetbrains/python/debugger/PyDebugProcess.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/src/com/jetbrains/python/debugger/PyDebugProcess.java b/python/src/com/jetbrains/python/debugger/PyDebugProcess.java index c2436abb0b50..4608ef6d8419 100644 --- a/python/src/com/jetbrains/python/debugger/PyDebugProcess.java +++ b/python/src/com/jetbrains/python/debugger/PyDebugProcess.java @@ -767,8 +767,8 @@ public class PyDebugProcess extends XDebugProcess implements IPyDebugProcess, Pr final Project project = getSession().getProject(); if (document != null) { if (file.getFileType() == PythonFileType.INSTANCE) { - PsiElement psiElement = XDebuggerUtil.getInstance().findContextElement(file, breakpoint.getSourcePosition().getOffset(), - project, false); + PsiElement psiElement = XDebuggerUtil.getInstance(). + findContextElement(file, document.getLineStartOffset(breakpoint.getSourcePosition().getLine()), project, false); PyFunction function = PsiTreeUtil.getParentOfType(psiElement, PyFunction.class); if (function != null) { return function.getName();