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

When ungrouped, list and dict variables have inconvenient sort order #278

Closed
huguesv opened this issue Jun 6, 2020 · 5 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@huguesv
Copy link
Contributor

huguesv commented Jun 6, 2020

Environment data

  • debugpy version: 1.0.0 beta 10
  • OS and version: windows
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7
  • Using VS Code or Visual Studio: Visual Studio

Actual behavior

image

image

Expected behavior

The actual list items should be at the top instead of the bottom, to avoid the need to scroll all the way down to see them.

Steps to reproduce:

  1. Declare a list or dict with a few values in them
  2. Expand at the variable in the debugger
@int19h int19h added the enhancement New feature or request label Jun 16, 2020
@V1NAY8
Copy link

V1NAY8 commented Nov 14, 2020

Hi, @int19h I am thinking of contributing to this issue.
Here's my understanding:

  • I declared two variables a and x to replicate this. Here's how it comes in VSCode
  • Does this mean that the values of list and dict should be in top, special variables and function variables should be at bottom?
    image

@int19h
Copy link
Contributor

int19h commented Nov 16, 2020

This issue is specifically about how the items look when they're not grouped - which is the case in Visual Studio by default (but not in Visual Studio Code).

@V1NAY8
Copy link

V1NAY8 commented Nov 16, 2020

@int19h Yes :) I'm just trying to figure out the repository. Can you please give me some inputs on where to make changes and point me int he right direction? 😃

@AdamYoblick
Copy link
Member

This is no longer an issue. Variable grouping has been the default behavior in VS for some time now, identical to vs code. Here's an example of this working on Visual Studio 17.7.7:

image

You can change how variables are grouped from the debugger by going to Tools -> Options -> Python -> Debugging:

image

@int19h
Copy link
Contributor

int19h commented Jan 3, 2024

The issue isn't that the variables are ungrouped. It's that list & dict list child attributes first, and only then list their items. So when grouping is disabled, you see all the methods first, and only then the items. Since usually users want to see the items when expanding a collection, the items should arguably be first.

However for large collections changing it to work that way would mean that you can't easily get to other things when you need to, sometimes. So I think it's best to keep this as is after all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants