Show a node for globals() in Locals


Currently we only show local variables and any globals referenced from the current frame in Locals. It is occasionally useful to inspect all globals in scope for a given frame. It can be done by adding a watch for globals(), but it would be nice to expose this directly in Locals, like we already do in mixed-mode debugger.


mrolle wrote Jan 17 at 7:47 AM

I like it.
There's another aspect to this. Besides wanting to see all of the global variables, I also like to be able to see none of the globals. So if there's something called, say [global variables] in the Locals window, that means that the globals don't clutter up my screen unless I choose to expand the globals.

I think I saw mention some time ago of adding some context menu items in the IDE that could let me select what sorts of items to see. Such as selecting methods, or inherited or private attributes, of objects. I can't do this in C++, and perhaps VS does this for Visual Basic or C#, but I'd find it handy at times.

As an extension to the idea of a [globals] node at the top level, I'd like to see a distinction between instance and class attributes for an object. So you might have a node under the object for its class, which would of course show the class variables when expanded, as well as base classes of that class.

In C++ debugging, if I have an object with a base class, then the members of the base class are hidden in a node for that base class, so I don't see a single list of all the members. This is annoying. In Python, there's no such thing as instance attributes that "belong" to the class or a base class, so that's nice. However, if I look at a class, it would be nice to at least have the option of seeing the class attributes of the class and its base classes in a single list.

pminaev wrote Jan 17 at 8:14 AM

We can indeed customize the context menu that shows up for Locals/Watch/Auto windows - we already do that for mixed-mode debugging. I don't think we can customize the toolbars, though. So that would limit us to UI that can be expressed in a context menu in VS - basically checked/unchecked items or radio button style. Which should be enough for the settings that you propose.

Can you please open a separate feature request for separating instance & class attributes? I could swear I've seen one, but I can't find it in the tracker...