Dumpify icon indicating copy to clipboard operation
Dumpify copied to clipboard

Add an option to limit how many elements to render for collections and arrays

Open hermanussen opened this issue 11 months ago • 4 comments

As mentioned in the readme:

You can ensure that arrays, dictionaries and collections don't output too much by allowing results to be truncated. Do this by setting the MaxCollectionCount property in the tableConfig.

int[] arr = [1, 2, 3, 4];

// Outputs only the first two elements and a message that says: ... truncated 2 items
arr.Dump(tableConfig: new () { MaxCollectionCount = 2 });

hermanussen avatar Mar 22 '24 20:03 hermanussen

I saw that you merged the other PR, but I'm guessing this one needs some more thorough review :-P. Let me know if you need any additional information. Happy to help.

Btw, if you want to see what the truncated output looks like: run the unit tests. All variations should be in the test output.

hermanussen avatar Mar 23 '24 15:03 hermanussen

Hi @hermanussen, yes, I need some more time to review this one and think about it :) I hope to be able to go over it this weekend. Thanks BTW for your contributions :)

MoaidHathot avatar Mar 23 '24 23:03 MoaidHathot

Hi @MoaidHathot any update on this? Thanks!

hermanussen avatar Jul 12 '24 11:07 hermanussen

@hermanussen, sorry for not updating the progress before. I'm applying some changes and soon will merge this feature.

MoaidHathot avatar Jul 12 '24 23:07 MoaidHathot

@hermanussen, sorry for the delay in reviewing and thank you for your contribution, awesome work! I'm working on the next release, and I might change a bit the behavior of this PR to align it with future features, but this is great, thanks!

MoaidHathot avatar Aug 28 '24 07:08 MoaidHathot