Skip to content

Request: Consider displaying count in debugger display when known for System.Linq iterators #22888

@jamesqo

Description

@jamesqo

Today I was debugging an xUnit theory that accepted an IEnumerable<int>. In my test data method, I was generating the enumerable via Enumerable.Range. When I looked at the enumerable in the debugger, it was stringified to {System.Linq.RangeIterator}. I needed to evaluate the enumerable via 'Results View' and count the number of elements displayed to find the count.

corefx_dbgview

Can we consider just displaying the count in the debugger display if we know it already? We can even consider adding more information for a few iterators, where there's not a risk of stringifying a really long collection or evaluating user-supplied functions. For example, we can show Start = x, Count = y in the debugger display for Range and Element = ..., Count = x for Repeat.

Metadata

Metadata

Assignees

Labels

area-System.LinqenhancementProduct code improvement that does NOT require public API changes/additionshelp wanted[up-for-grabs] Good issue for external contributors

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions