Skip to content

Debugger display of dictionary types and DebuggerDisplayAttribute.Name #88736

Closed

Description

@JamesNK

DebuggerDisplayAttribute has Name and Type 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:

image

After:

image

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.

Activity

  1. ghost added
    untriaged
    on Jul 12, 2023
  2. JamesNK commented on Jul 13, 2023

    @JamesNK
    MemberAuthor

    @jaredpar Curious if you have any insight here or historical context.

  3. added
    enhancement
    and removed
    untriaged
    on Jul 13, 2023
  4. modified the milestones: 9.0.0, Future on Jul 13, 2023
  5. jaredpar commented on Jul 13, 2023

    @jaredpar
    Member

    Don't really have any historical context on this specific decision.

    I will say that in general the rules of DebuggerDisplay and the power when combined with DebuggerTypeProxy and DebuggerBrowsable wasn't fully appreciated by everyone when it first came out. That combined with various bugs in the EE, perf issues evaluating so many new expressions, and actual bugs how developers structured meant they weren't as utilized as they could have been. It wasn't until probably VS 2010 until I think the entire system was in a fully formed state.

    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.

  6. added a commit that references this issue on Sep 23, 2023
    e7963bc
  7. ghost added
    in-pr
    on Sep 23, 2023
  8. added a commit that references this issue on Nov 2, 2023
    34bf55c
  9. ghost removed
    in-pr
    on Nov 2, 2023
  10. ghost locked as resolved and limited conversation to collaborators on Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Collectionsenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions