Closed alexander-yakushev closed 7 months ago
It's called prettify but the approach is not pretty. Anyway, at some point if we want more customizations it will have to be rewritten. But this should work for now.
I didn't replace the orchard.inspect
representation for methods, fields, and such because, on its own, it is useful for a single method to show which class it belongs to. It's just that the inspector provides plenty of context when it renders many methods of the same class, so it makes sense to only override it there.
The prettification could also be applied when inspecting a Method
or Field:
(however if we do that then it's not clear that we're within the Long class. Maybe we could add an additional header?
Just prettyfying the Value
field can be easily done ad-hoc. Adding a header would require overloading inspect
for methods and fields and constructors, then reusing the :default
implementation which handles them now. I'd rather do the former. We can also render Value
for them in some third specific way, e.g. java.lang.Long: public static int bitCount(long)
, but I'm not sure it would be any better than how it looks now.
Doing the prettification and nothing else is OK for now - in the end, the user knows what he's inspecting, or can go back if he forgot
I'd personally like the header but no rush - just leaving a discussion here is fine
java.lang.reflect.Field<java.lang.Long>
or some other format can also be OK (assuming it doesn't affect navigation)
Addresses #242.