mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Breakpoints ignored after code editing (PY-19642)
Do not rely on breakpoint's offset, because it isn't always updated after code editing
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user