Debugging shortcuts research (Was: [spyder] Toolbar for debugger in spyder)

339 views
Skip to first unread message

anatoly techtonik

unread,
Jun 1, 2012, 1:23:40 AM6/1/12
to spyd...@googlegroups.com
On Fri, Jun 1, 2012 at 2:59 AM, Jed Ludlow <jed.l...@gmail.com> wrote:
> On Thu, May 31, 2012 at 2:46 PM, Steve <steve.f....@gmail.com> wrote:
>>
>> Also, can we get some hot keys for these actions?
>
> The global hot key space is getting pretty crowded. I'm open to
> recommendations on a set of global debugging hot keys that make sense.
> Recall that pdb already responds to "n" for next, "c" for continue, "s" for
> step in, etc., when it has focus.

Some unscientific research gathering information about debugging
shortcuts from different Python IDEs
(http://wiki.python.org/moin/IntegratedDevelopmentEnvironments)
definitely won't hurt here. Some scientific usability study would be
even more appreciated. =) Some IDEs have so-called 'debug mode', and I
suspect that if we don't have one, we may face a keyboard conflict
pitfall that this mode tries to avoid. I've added a page to Python
wiki with some into, as it is easier for everyone to edit. Feel free
to extend with your favorite editor combinations.

http://wiki.python.org/moin/IDEKeyboardShortcuts

Steve

unread,
Jun 1, 2012, 10:51:20 AM6/1/12
to spyd...@googlegroups.com
Yeah, I think as long as everything is mappable there is no real conflict.  I'd personally prefer VS mapping because I'm used to it, but whatever is chosen is fine with me as long as I can change the mapping.

Jed Ludlow

unread,
Jun 1, 2012, 10:57:45 AM6/1/12
to spyd...@googlegroups.com

In the spirit of Larry Tesler [1], I'd argue for staying modeless because it's not really clear that Spyder has a debugging mode per se. Most heavy-weight IDEs have a strong project-based model, so when you launch the debugger you really are debugging the current "project" as a glob of source files. On the other hand, in Spyder you can fire up a debugger at will on any script at any time. In fact, you could have several different interpreters open and running at the same time, each coming in and out of debugging interactively and independently. This high level of interactivity is what makes it so powerful for scientific computing. Strictly speaking the notion of "global" debugging commands is not really accurate since you have to designate which interpreter should receive the debugging commands by setting focus first. In that light, the global debugging toolbar and associated hot keys today would be implicitly understood to send commands to the interpreter that currently has focus.

It's common to use function keys as hot keys for the basic debugging commands as Anatoly pointed out. If there really is enough demand for debugging hot keys to be somewhat inline with the model of other IDEs I guess we could reassign some of the less commonly used function keys to debugging commands, maybe in the F10-F12 range. Thoughts?

[1] http://nomodes.com/Larry_Tesler_Consulting/CV.html

Steve

unread,
Jun 1, 2012, 11:24:50 AM6/1/12
to spyd...@googlegroups.com
My organization uses Spyder for it's great python editing capabilities and debugging is a must (including bindable hot keys).


Jed Ludlow

unread,
Jun 1, 2012, 3:03:07 PM6/1/12
to spyd...@googlegroups.com
It's common to use function keys as hot keys for the basic debugging commands as Anatoly pointed out. If there really is enough demand for debugging hot keys to be somewhat inline with the model of other IDEs I guess we could reassign some of the less commonly used function keys to debugging commands, maybe in the F10-F12 range. Thoughts?

 
As a quick experiment, I decided to adopt a hot key mapping convention similar to Visual Studio, and I've pushed a prototype implementation to my clone here:

http://code.google.com/r/jedludlow-spyderlib-default/source/browse?name=jedludlow-issue-554

Here are the new hot key mappings:

F10: Debug step over
F11: Debug step into
Shift+F11: Debug step return
F12: Debug continue
Shift+F12: Debug exit

In the process, these got new mappings:

Ctrl+F10: Run profiler
Ctrl+F11: Full screen mode
Ctrl+F12: Add breakpoint
Ctrl+Shift+12: Add conditional breakpoint

It's not really straightforward to reuse F5 for continue since we are modeless and F5 already has an assignment to run the currently active editor script. It may be possible to get fancier with this, but for now the simplest approach was to use F12 for continue.

I'm publishing these changes to my clone simply for testing purposes, and I would recommend broader discussion on the implications before it gets pulled to the default repo. In that light, if there are strong opinions on this, please dive in, test, and make recommendations.

Steve

unread,
Jun 1, 2012, 7:26:25 PM6/1/12
to spyd...@googlegroups.com
Awesome!  I'm loving it already.  The issue with using the toolbar while the console is on the second monitor is resolved.

Here's another idea. What if the break point widget had a global enable/disable button to control spyder behavior?  With the addition of that spyder can automatically choose to use pdb when F5 is pressed based on whether the breakpoints are globally enabled or not.

Steve

unread,
Jun 6, 2012, 10:58:46 AM6/6/12
to spyd...@googlegroups.com
The functionality seems to be working great.  Any chance you can merge the breakpoint widget into this same bookmark?  Or what's the easiest way for me to get it and merge it in?


On Friday, June 1, 2012 2:03:07 PM UTC-5, Jed Ludlow wrote:

Jed Ludlow

unread,
Jun 6, 2012, 11:15:45 AM6/6/12
to spyd...@googlegroups.com
I created a clone last week that has all the recent debugging features merged:

http://code.google.com/r/jedludlow-spyderlib-default-merged/
> --
> You received this message because you are subscribed to the Google Groups
> "spyder" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/spyderlib/-/Y-5szqbItwcJ.
> To post to this group, send email to spyd...@googlegroups.com.
> To unsubscribe from this group, send email to
> spyderlib+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/spyderlib?hl=en.
>
>

Carlos Córdoba

unread,
Jun 9, 2012, 12:36:42 AM6/9/12
to spyd...@googlegroups.com
Jed, I have time now to review your work and of course Flam's. I'm -1 on
renaming shortcuts, because Spyder 2 has been around for almost two
years and that's probably going to break some people's workflow. Besides
that, this is really a great addition to the project.

Let's continue the discussion on issue 554.

Cheers,
Carlos

El 06/06/12 10:15, Jed Ludlow escribió:

Jed Ludlow

unread,
Jun 9, 2012, 2:17:29 PM6/9/12
to spyd...@googlegroups.com
On Fri, Jun 8, 2012 at 10:36 PM, Carlos Córdoba <ccord...@gmail.com> wrote:
Jed, I have time now to review your work and of course Flam's. I'm -1 on renaming shortcuts, because Spyder 2 has been around for almost two years and that's probably going to break some people's workflow. Besides that, this is really a great addition to the project.

Let's continue the discussion on issue 554.

Cheers,
Carlos


I must admit that I was originally skeptical about the value of creating hot keys for the basic debugging commands, but after using it now for a week or so I'm hooked. It's been very beneficial, and I must say that having the key mapping be somewhat similar to Visual Studio has also been refreshing.

I know there are many out there who have wanted better debugging support. Some feedback from those users would be helpful. I'd be interested to see alternative proposals brought forward on the hot key mapping. I'd also appreciate broader input on how frequently the hot keys I remapped (earlier in the thread) are used and how big an impact the remapping would be to people.
Reply all
Reply to author
Forward
0 new messages