Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breakpoint in cell with leading empty lines may be ignored #829

Conversation

fcollonval
Copy link
Contributor

If a cell starts with empty lines, they are cleanup as part of the code transformation. This result in breakpoint that can be missed as the number of lines executed will be smaller than the breakpoint line number.

For example,

def f(a, b):
    return a + b
f(2, 3)

Setting the breakpoint on the last line is not working

Xref: jupyterlab/jupyterlab#11532

This removes the leading_empty_lines cleanup transform when a debug session is active.

@fcollonval
Copy link
Contributor Author

pinging @Carreau could you please have a look at this PR? I'm not very confident to turn off one of the default transformation applied by IPython.

@fcollonval
Copy link
Contributor Author

The error on Python 3.10 seems legit.

@fcollonval
Copy link
Contributor Author

Actually the debugger with Python 3.10 is much more broken than with Python 3.9. But I can't yet figure out what is going on.

@fcollonval
Copy link
Contributor Author

I propose to skip the new test for Python 3.10 for now. And tackle the issue related to Python 3.10 in a separate PR.

@Carreau Carreau added the bug label Jan 7, 2022
@Carreau
Copy link
Member

Carreau commented Jan 7, 2022

I have no objection to have this as a workaround, we can make the transformer have an enabled/disabled flag in IPython itself to make it less brittle to index positions.

@fcollonval
Copy link
Contributor Author

Thanks @Carreau

This is ready for review.

Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@blink1073 blink1073 merged commit 7778d69 into ipython:main Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants