-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Debugger display of dictionary types and DebuggerDisplayAttribute.Name
#88736
Comments
Tagging subscribers to this area: @thaystg Issue DetailsDebuggerDisplayAttribute has A place Before: After: This seems like an improvement to me. I was wondering why IDictionaryDebugView and other dictionary type proxies don't use this feature. Right now the key and value are squashed together in the debugger, and a meaningless index is displayed as the name.
|
Tagging subscribers to this area: @dotnet/area-system-collections Issue DetailsDebuggerDisplayAttribute has A place Before: After: This seems like an improvement to me. It's easier to see what the keys and values are. I was wondering why IDictionaryDebugView and other dictionary type proxies don't use this feature. Right now the key and value are squashed together in the debugger, and a meaningless index is displayed as the name.
|
@jaredpar Curious if you have any insight here or historical context. |
Don't really have any historical context on this specific decision. I will say that in general the rules of It's quite possible the original author didn't realize these type of tricks were possible, or tried and gave up due to the mentioned issues and no one has revisited it since then. |
The change alows generic and non-generic dictionaries to be displayed in the same way: with separate columns for keys and values with an ability to expand each column. Fixes dotnet#88736
* Improves and unifies debug views of dictionaries. The change alows generic and non-generic dictionaries to be displayed in the same way: with separate columns for keys and values with an ability to expand each column. Fixes #88736 * Fix the DebuggerView tests of dictionaries Included non-generic dictionaries in tests * Fix more DebuggerView tests * Included more types that implement IDictionary in the DebuggerView tests. * Improved the testing code to support classes with attributes declared by their base classes. * Fixed .Net Framework 4.8 build error by removing a dependency on the record c# feature. * Fixed tests remaining tests (outside of the System.Collections subset) * Fix DebugView.Tests build errors on .Net Framework * Update DebugView tests to expect different outcomes on .Net Framework .Net Framwork does not support recent improvements in the way the debugger displays a dictionary. Depending on the framwork used, the debugger view of generic dictionaries and ListDictionaryInternal are different. * Applied suggested changes and fixes * mostly code style changes * restored a rest for an empty HashSet. * fixed testing of the generic SortedList. * Minor improvents Renamed an internal method to match its new behavior and removed unnecessary init accessors.
DebuggerDisplayAttribute has
Name
andType
properties. We never use these.A place
Name
is useful is collection items. It can be used to display a custom name instead of an index in a debugger window.Before:
After:
This seems like an improvement to me. It's easier to see what the keys and values are.
I was wondering why IDictionaryDebugView and other dictionary type proxies don't use this feature. Right now the key and value are squashed together in the debugger, and a meaningless index is displayed as the name.
The text was updated successfully, but these errors were encountered: