Closed MoaidHathot closed 1 year ago
Nice, Dumpify looks good, we should definitely consider it.
@kindermannhubert any thoughts on this? You have the most experience with our current rich object formatting.
That dot in .Person
is definitely a bug (probably an empty namespace) - I've created a new issue #287.
As for
it can't do that for every type of object
It can.
@MoaidHathot - For detailed output you need to press Ctrl+Enter
instead of Enter
. Your first example then looks like this:
We too support formatting with larger depths but you need to be careful about large and deep objects. These toy examples of course look better when they are fully dumped. Perhaps there is some space for improvement in some dynamic depth determination based on "something".
E.g. dumping of Type
with Dumpify does not work for me:
typeof(int).Dump()
not even
typeof(int).Dump(maxDepth: 3)
it just prints typeof(int)
.
CSharpRepl:
Our formatting is quite new and definitely not perfect. But just a few things from the top of my mind: we have better support for value tuples, we support DebuggerDisplay
and DebuggerTypeProxy
attributes, we support user-defined ToString methods, our output is much closer to "standard" Visual Studio formatting, ...
Also, we will hopefully support interactive object inspection via #226 when I'll have time for it.
I also prefer CSharpRepl's more compact formatting.
I don't see any benefit from using Dumpify. Please take no offense @MoaidHathot.
@kindermannhubert, that is ok, no offense taken :)
Regarding dumping types such as typeof(int).Dump()
, the current output from Dumpify
is by definition, since otherwise the outputted table is very big, and in most cases it will dump too much information. This of course can be changed if the community prefers otherwise, but Dumpify
supports dumping System.Reflection
types such as System.Type
's members, for example:
Btw, do you handle circular references with the Tree formatting? I still get only .person
with ctrl+enter
Regardless of this discussion, CSharpRepl
is awesome, and I use it quit a lot, thanks!
Good job and keep up the awesome work :)
Closing this. If developers do want to use Dumpify with CSharpRepl it's a quick #r "nuget: Dumpify"
away.
I agree that this is a library the .NET ecosystem sorely needs. Nice work on it so far.
Feature Description
Although
CSharpRepl
has the ability to "dump" objects into the Console, it can't do that for every type of object.Dumpify
is a relatively new package, that usesSpectre.Console
as well, to dump and render any type of .NET object into the console, but it support more features and is very customizable.For example, the following code
Outupts:
While using
Dumpify
the same code outptus:Another example:
CSharpRepl
outputs:While
Dumpify
outputs:The colors are configurable, so
CSharpRepl
can change them to maintain the same color scheme. The only missing abilities that I currently see:Dumpify
writes type names at the top of tables , there is work to add a column for the types (configuration).