MoaidHathot / Dumpify

Adding `.Dump()` extension methods to Console Applications, similar to LinqPad's.
MIT License
959 stars 40 forks source link

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

Open hermanussen opened 5 months ago

hermanussen commented 5 months ago

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 commented 5 months ago

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.

MoaidHathot commented 5 months ago

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 :)

hermanussen commented 1 month ago

Hi @MoaidHathot any update on this? Thanks!

MoaidHathot commented 1 month ago

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