Fixes#87.
The generic `T` is `Any` when traversing deeper into the mirror. It's
possible that we should be opening existentials more explicitly at each
layer, but we already have the mirror's subject type, so we can use that
instead.
* Fix `CustomDumpRepresentable` max depth
When we reach a custom dump representable value, we should not decrement
the max depth when printing it.
At times this can cause the max depth to roll from 0 to -1, which
currently causes the logic that collapses nodes to leave them expanded.
We should update that logic, as well, so I'll do that in another commit.
* Treat negative depth as zero
* Add/fix some unrelated tests
* Don't use `AnyKeyPath.debugDescription` due to crash
SE-0369's implementation unfortunately has a crash related to dynamic
member lookup, so we should revert our reliance on it till the bug is
fixed.
See https://github.com/apple/swift/issues/64865 for more info.
* wip
* wip
* wip
We currently auto-sort the children of any mirror with a display style
of dictionary or set alphabetically. This is important for consistent
dumps (good for snapshot tests, too), but affects types that don't need
the sorting, like ordered dictionaries and sets.
This PR introduces an `_UnorderedCollection` protocol to control this
behavior, and conforms `Dictionary`, `Set`, and their `NS`-
predecessors, but leaves other types open to dumping and diffing in an
ordered way by default.
* Add `String.init(customDumping:)`
It can be useful to get a custom dump representation of a value as a
string on a single line. Swift provides `String.init(describing:)` and
`String.init(reflecting:)` (though no equivalent for a quick string from
`Swift.dump`), so maybe we can provide _similar_ functionality via a
string initializer.
* oops
* Fix regression in `typeName` output
The regular expression that strips excessive info from type names was
refactored in #73 to fix some bugs that were discovered, but this change
caused a regression in some nested types.
* fix
* wip
* Abbreviate enums in diffs
We added the ability to abbreviate nested dumps in #71, but this didn't
transfer to diffs.
* wip
* Fix for old Swift runtime
* AnyHashable dump conformance
Without it the Mirror for AnyHashable has a style of nil so it just uses string interpolation and doesn't dump properly
* Add tests
* Move to Swift.swift file
* Add support to dump subset of children and superclass nodes
* Dump superclass by default
* Clean up code based on @iampatbrown's feature branch
* More cleanup
* revert unrelated indentation
* Remove new protocols
* Revert some syntax changes