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

[WIP] PR: Initial traceback setup to use selected syntax style (IPython Console) #22965

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dalthviz
Copy link
Member

Description of Changes

  • Included a screenshot or animation (if affecting the UI, see Licecap)

Enable verbose tracebacks to follow currently selected syntax style. A preview:

traceback_preview

Issue(s) Resolved

Fixes #22412

Notes

Probably the logic here to set the syntax style via the import of the VerboseTB class and set the exception handler to verbose (xmode magic) should go over spyder-kernels and be added as a kernel comm handler method? What do you think @ccordoba12 ?

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct: dalthviz

@dalthviz dalthviz added this to the v6.0.3 milestone Nov 13, 2024
@dalthviz dalthviz self-assigned this Nov 13, 2024
@pep8speaks
Copy link

Hello @dalthviz! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 1445:1: E122 continuation line missing indentation or outdented

@ccordoba12
Copy link
Member

ccordoba12 commented Nov 13, 2024

Probably the logic here to set the syntax style via the import of the VerboseTB class and set the exception handler to verbose (xmode magic) should go over spyder-kernels and be added as a kernel comm handler method?

Yep, I was thinking exactly the same. You should be able to use the ShellWidget.set_kernel_configuration method to do that and then add a new method in spyder-kernels to set the traceback style.

That approach has the great advantage of being backwards compatible because the corresponding handler in spyder-kernels (SpyderKernel.set_configuration) doesn't do anything if it's asked to update a config it can't handle.

Also, since this requires the verbose traceback mode, you need to change that in the kernel too, specifically here:

https://github.com/spyder-ide/spyder-kernels/blob/7b8dc11d487b7f94cf94a9546ea29b65c64e3c84/spyder_kernels/console/start.py#L73

And you also probably need to update the code that allows to click on a traceback filename to open it in the editor due to that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Traceback color handling and definition
3 participants