Skip to content

Display IEnumerables and IDictionaries in debugger prettily (with "Raw View" available) #1634

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

Merged
merged 14 commits into from
Jan 24, 2022

Conversation

JustinGrote
Copy link
Collaborator

@JustinGrote JustinGrote commented Nov 23, 2021

Resolves #1633

Adds a "Raw View" expandable to the variable pane much like the C# variable provider to hide "noisy" properties of IEnumerable/IDictionary.
image

@ghost ghost added Area-Debugging Issue-Enhancement A feature request (enhancement). labels Nov 23, 2021
Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome :) thanks for this! In your screen shot it shows a $true without color. Is that new with this change? or just something separate we need an issue for?

@JustinGrote
Copy link
Collaborator Author

Awesome :) thanks for this! In your screen shot it shows a $true without color. Is that new with this change? or just something separate we need an issue for?

Pretty sure that's separate, let me check without

JustinGrote added a commit that referenced this pull request Nov 24, 2021
JustinGrote added a commit that referenced this pull request Nov 24, 2021
@JustinGrote
Copy link
Collaborator Author

Awesome :) thanks for this! In your screen shot it shows a $true without color. Is that new with this change? or just something separate we need an issue for?

Pretty sure that's separate, let me check without

Yep, it is, opened issue PowerShell/vscode-powershell#3703

Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks again!

@andyleejordan
Copy link
Member

Ditto #1636 (comment)

@andyleejordan
Copy link
Member

What tests can we add to cover this @JustinGrote?

@JustinGrote
Copy link
Collaborator Author

I would say test both an ienumerable and an idictionary and verify that:

  1. The object display contains all necessary properties
  2. The "raw view" variable display contains what you would expect to see from an idictionary/ienumerable
  3. Test a derived idictionary with additional properties/methods and make sure they show up similarly under "Raw view" instead of the direct collection

@JustinGrote JustinGrote force-pushed the JustinGrote/issue1633 branch from 95542b3 to a92d9d7 Compare January 23, 2022 20:49
@JustinGrote
Copy link
Collaborator Author

Other test length updates were because their "view" has changed to summarize under the "Raw View" header

@JustinGrote
Copy link
Collaborator Author

@SeeminglyScience please re-review, code has changed a little to clean up the "Raw View" header, but this is mostly net-new tests. Thanks :)

@andyleejordan
Copy link
Member

@JustinGrote I just added a commit with a couple cleanups. Namely I took out the new AssertDebuggerStoppedCommand and just made the existing AssertDebuggerStopped optionally accept a CommandBreakpointDetails, and I used the GetVariables(scope) helper I'd previously introduced to shorten your (lovely!) new tests.

@andyleejordan andyleejordan changed the title Feature: Add "Raw View" to IEnumerables and IDictionaries Display IEnumerables and IDictionaries in debugger prettily (with "Raw View" available) Jan 24, 2022
@andyleejordan andyleejordan enabled auto-merge (squash) January 24, 2022 20:37
Copy link
Member

@andyleejordan andyleejordan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work Justin!

@andyleejordan andyleejordan merged commit 3ea4eb9 into master Jan 24, 2022
@andyleejordan andyleejordan deleted the JustinGrote/issue1633 branch January 24, 2022 20:41
@JustinGrote
Copy link
Collaborator Author

@andschwa thanks, I actually originally wrote it with the optional parameters but I wasn't sure if that was muddling up the original AssertDebuggerStopped with too many code paths, hence the separate function for clarity. All good though!

@andyleejordan
Copy link
Member

It made sense to me cause they're all doing the same thing: asserting the debugger stopped, and then optionally asserting it stopped on the right line (or command).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Debugging Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IEnumerable/IDictionary Display should be simplified
3 participants