Skip to content

Add debugger displays and type proxies for core abstraction types - #1080

Merged
Shawn Callegari (shawncal) merged 12 commits into
microsoft:mainfrom
stephentoub:debuggerdisplay
May 20, 2023
Merged

Shawn Callegari (shawncal) merged 12 commits into
microsoft:mainfrom
stephentoub:debuggerdisplay

Conversation

@stephentoub

Copy link
Copy Markdown
Member

Motivation and Context

Make it easier to examine core state while debugging with semantic kernel.

Description

While debugging through examples to better understand the whole model, I found myself routinely diving into various data structures to find the information I wanted to see. I've added [DebuggerDisplay] and [DebuggerTypeProxy] attributes to surface the most relevant information. I view this as a starting point; hopefully folks like this and will replicate it onto other types of relevance.

Example Before

image

Example After

image

Contribution Checklist

cc: Shawn Callegari (@shawncal)

@github-actions github-actions Bot added .NET Issue or Pull requests regarding .NET code kernel.core labels May 18, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is cool! I might add similar to Plan object. Curious if you have any thoughts/consideration there.

@lemillermicrosoft Lee Miller (lemillermicrosoft) added PR: ready for review All feedback addressed, ready for reviews PR: ready to merge PR has been approved by all reviewers, and is ready to merge. labels May 19, 2023
@stephentoub

Stephen Toub (stephentoub) commented May 19, 2023 •

Copy link
Copy Markdown
Member Author

This is cool! I might add similar to Plan object. Curious if you have any thoughts/consideration there.

I've pushed another commit to add a debugger display for plan. Obviously this and any other one I've added can be tweaked to ensure the most useful information is highlighted.

Before

image

After

image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for adding Plan changes!

@shawncal

Copy link
Copy Markdown
Contributor

Merged main, resolved (in browser) then had to fix a dotnet format whitespace thing.

@shawncal
Shawn Callegari (shawncal) enabled auto-merge (squash) May 20, 2023 05:25
@shawncal
Shawn Callegari (shawncal) merged commit 780284e into microsoft:main May 20, 2023
Shawn Callegari (shawncal) added a commit to shawncal/semantic-kernel that referenced this pull request Jul 6, 2023
…crosoft#1080)

### Motivation and Context

Make it easier to examine core state while debugging with semantic
kernel.

### Description

While debugging through examples to better understand the whole model, I
found myself routinely diving into various data structures to find the
information I wanted to see. I've added [DebuggerDisplay] and
[DebuggerTypeProxy] attributes to surface the most relevant information.
I view this as a starting point; hopefully folks like this and will
replicate it onto other types of relevance.

Example Before


![image](https://github.com/microsoft/semantic-kernel/assets/2642209/737d05f9-9328-48ac-a497-e6296d50d2eb)

Example After

<img width="426" alt="image"
src="https://github.com/microsoft/semantic-kernel/assets/2642209/1ab6514a-7333-441f-bc5a-b2fb6e4d26ff">

### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [x] The code builds clean without any errors or warnings
- [x] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [x] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄

cc: @shawncal

---------

Co-authored-by: Lee Miller <[email protected]>
Co-authored-by: Shawn Callegari <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Issue or Pull requests regarding .NET code PR: ready for review All feedback addressed, ready for reviews PR: ready to merge PR has been approved by all reviewers, and is ready to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants