Some General questions and suggestions about the interactive debug window

Dec 24, 2012 at 9:46 AM
Edited Dec 24, 2012 at 10:01 AM

Hi, 

First let me say I love PTVS, great work!

After a use of couple of days, I would like to ask and suggest some features their lackness disturbs the overall experience:

1. As I mentioned in previous post, error marking, the same error marking as in C# if possible, I find the .Net error reporting just great.

2. Allow assessment of code expressions in one click (Like in matlab) for example if I stopped in a break point, and want to evaluate the next code line, instead of copy pasting it to the IDW, I would just press F-something to send it to the IDW. I find this feature in matlab to be a real time saver. Currently you can send it interactive (Ctrl+E), which will     evaluate the expression in python, but that is worthless since it doesn’t know the local          variables. Instead it should be "send to IDW". 

3. When I enter an expression in IDW, it is evaluated, no problem. But when I want to change an already entered expression in the middle of it, I can’t just press enter and evaluate it, since the enter starts a new line. I have to press "Home" to get to the end of the expression, and only then press enter. I find it annoying since 99% of the time I want to evaluate the modified expression and not start a new line. 

4. Allow code changes while debugging, like in .Net. I usually run in debug mode on my code, find an error, fix it and want to keep going without having to restart the run. I think this should be a must for a non-compiled language, isn’t it so?

5. cant get the ipython interperter to replace the standard one... ?

 

Thanks again for that great work. I really wish you would fix and improve those suggestions, which would make the coding experience phenomenal!

 

Coordinator
Dec 24, 2012 at 10:25 PM

Thanks for the feedback and suggestions.

We're already working on #1 and I've created an issue for #2 (http://pytools.codeplex.com/workitem/951). For #3, you can press Ctrl+Enter anywhere in the line and it will evaluate it. And we're already discussing #5 on another thread.

#4 is something we'd love to be able to do, but unfortunately it is impossible at this point. Because we don't "own" Python, we can't simply change it to allow Edit and Continue (both .NET and C++ have special compiler support to enable this) and even if we did manage to get changes made to CPython, it wouldn't be available until version 3.4 (which is coming in 2014). Without changing how the interpreter works there is no way to get proper support, and even though it is possible to get partial support, we don't think it is reliable or useful enough to spend the time on at the expense of other features.

Glad you're enjoying PTVS!

Dec 24, 2012 at 11:17 PM

Thanks for the quick answers! Im really looking forward for the #2, and about #3 dont you think it should be the other way around? enter evaluates, Ctrl+enter new line? 

I appreciate the supportg you are giving here, makes me real confident about choosing PTVS. keep on the great work!

Dec 25, 2012 at 1:07 AM

+1 on #3. This annoyed me for a long time. I think "enter to evaluate" is the majority default for REPL environments. At least providing a config option for this would be great.

 Thanks!

 

Coordinator
Dec 25, 2012 at 9:20 PM

You may be right, though I've certainly seen both approaches used in various places. An option sounds like the way to go here.

Dec 16, 2013 at 11:03 PM
Another +1 on #3. Please provide a config option to select between "enter to evaluate" and "enter for newline". Nice work on the development to date. PTVS rocks!
Coordinator
Dec 16, 2013 at 11:50 PM
You can already change those key bindings through the Tools/Options/Keyboard dialog. I don't remember what the commands are called right now (I'm in a cafe in Australia, rather than at my desk) but if you press Enter in the shortcut box it will show you what it's currently bound to.

Having a single option to simply swap the two would also be good, though it may conflict with the fully customizable option.
Feb 1 at 12:00 AM
Zooba, I tried changing those key bindings as you suggested, but I can't get it to work.

In VS 2013, under Tools/Options/Environment/Keyboard , I see that ctrl-enter is a shortcut for: OtherContextMenus.InteractiveConsole.ExecuteorPasteInput

Then I try to associate that command with a new shortcut key.
Under "Use new shortcut in:" I select "Python Interactive Window", then move the cursor into the "Press shortcut keys:" box. But then it will not allow me to assign "Enter" as a shortcut key.

I like PTVS a lot, but not being able to press Enter to evaluate in the middle of a line might be a deal breaker for me. Is there any way to do it?

Thanks.
Coordinator
Feb 1 at 12:26 AM
Apparently not. I didn't realize that VS won't let you use Enter as a shortcut. We will need to add a new option to be able to change the behavior.

There is a feature proposal at https://pytools.codeplex.com/workitem/952, but right now it's not a high enough priority to make it into our upcoming release (2.1). We reevaluate these for each release, so there's always a chance it'll get picked up for the following one, but the quickest way to get it in will be for someone to do it and send in a patch/pull request.
Feb 2 at 2:22 PM
Edited Feb 2 at 2:41 PM
Hi all,

I have some more suggestions regarding the IPython console in regular and Interactive debugging (IDW):
  1. History - type first letters, get all commands starting with those letters by up/down arrows.
  2. Esc key clears current line command (for the common case you scrolled for a command and found it is not what you needed, and you need to empty the cmd)
  3. IDW knows debug variables, completes them (and their attributes) and can change them.
  4. Support for pandas - Show dataframes in nicely formatted tables.
  5. As mentioned above - Send to debug interactive in a simple keyboard shortcut.
I have used VS for debugging in Cpp and C#, and Im also very experienced in debugging scripts in MATLAB and Python. I'm saying that to support the following claim: Having a good interactive debug console is by far superior to "watch" style debugging. It completely makes it unnecessary/irrelevant. Good interactive debugger accelerate productiveness significantly.

I'm saying that because (to my understanding/experience with PTVS) having to open large lists/dictionary on hoovering over variables or in watches can be unstable performance wise. So maybe, and Im just suggesting here, you might want to limit the hoovering inspection to a few first entries and the rest could be approached from the IDW.
Coordinator
Feb 2 at 3:50 PM
Edited Feb 2 at 3:51 PM
Thanks for the suggestions! I think you'll be happy to hear that we've heard all of these before (or brought them up ourselves) and they're all on the table for when we get a chance to really work on this area.

Being a small team, we like to focus each release on a particular area. PTVS 2.1 is going to be great for web developers, and the feedback we're hearing is that people using numpy/pandas/matplotlib could do with some features, so it's looking likely that vNext will focus on that area. Hopefully you won't have to wait too long (and neither will we - some of us are really keen to improve this stuff!).
Coordinator
Feb 2 at 8:03 PM
With respect to having large collections in watch window or data tips (hovering) - in 2.0, this should not be an issue with built-in collections like list or set, but custom collection types like collections.OrderedDict or numpy arrays didn't get that special treatment. We did some work to improve this further in 2.1, and, in particular, to cover custom collection types. This functionality will be in alpha (which we're planning to ship "real soon now"), and it will be great if you can give it a try once it's there and see if it resolves the issues that you were having - indeed, it was your bug report that triggered that investigation and work.

Speaking in general, keep the bug reports, feature requests, usability improvement suggestions and all the other feedback coming! We might not be able to act on them immediately as the main focus of the work is elsewhere, but we do go through all the user feedback during release planning, and the themes of releases are affected by it, as well. Rest assured that we will be looking at these very closely when planning the next release.

As a side note: to make sure that your suggestions don't slip through the cracks, it is best to file them as feature requests in the tracker. It is hard for us to sift through all the forum threads for the past several months to filter only the messages that contain specific suggestions and feature requests (and not support questions etc). It also lets other people express support easily by voting for them, and we take those votes into account as well.
Feb 3 at 10:47 AM
Sure, I will open feature requests on those issues :) Thanks for the great support and responsiveness. I'm soon moving on to another project which will not involved custom collections and I'm planning to get back using PTVS as I see it as the most promising python IDE out there (and I'm using PyCharm and have used WING, Eclipse+pydev,spyder and others) So I'm probably going to raise many requests real soon.. :) Hopefully I will be able to do more active contribution too, maybe more to the scientific support of PTVS.

Keep on the good work :)