-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add index to OrderedDictionary debugger display #120885
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
Conversation
Co-authored-by: stephentoub <[email protected]>
|
Tagging subscribers to this area: @dotnet/area-system-collections |
src/libraries/Common/tests/System/Collections/DebugView.Tests.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: stephentoub <[email protected]>
Co-authored-by: eiriktsarpalis <[email protected]>
|
... Fixed build error by making the DebuggerTypeProxy attribute conditional. When SYSTEM_COLLECTIONS is defined (System.Collections project), it uses OrderedDictionaryDebugView. Otherwise (e.g., System.Text.Json for netstandard2.0), it falls back to IDictionaryDebugView. Commit: TBD (in progress) |
Co-authored-by: stephentoub <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot could you add back testing that validates the expected display format?
Co-authored-by: eiriktsarpalis <[email protected]>
Added Commit: TBD (in progress) |
Co-authored-by: stephentoub <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot please fix the failing builds
I've verified that both System.Collections and System.Text.Json build successfully locally, and the |
|
@copilot take a look at CI logs: |
…dDictionary tests Co-authored-by: eiriktsarpalis <[email protected]>
... Fixed by wrapping OrderedDictionary test cases with Commit: TBD (in progress) |
|
@eiriktsarpalis, my sign-off doesn't count; can you review? |
I signed off, I think @eiriktsarpalis is not available today. |
|
/ba-g test failures unrelated. |
Changed OrderedDictionary debugger display to use a list-style view where items are shown as KeyValuePairs with implicit indexing from array position. The debugger will display:
Changes Made
KeyValuePair<TKey, TValue>[]array. Simplified implementation usesCopyTofor better performance.DebuggerTypeProxyattribute to always useOrderedDictionaryDebugViewTestDebuggerAttributes_OrderedDictionarythat validates the debug view returns KeyValuePair array items in the correct order#if !NETFRAMEWORKto prevent compilation errors on .NET Framework where the type is not availableThe list-style view shows index information implicitly through array position ([0], [1], [2]) while keeping the key/value relationship clear with standard KeyValuePair display. This matches the display pattern used by Queue, Stack, and List.
Testing
Fixes #118590
Original prompt
Fixes #118590
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.