55 Commits
Author SHA1 Message Date
Stephen Celis 84b30e1af7 Only print "no difference detected" when diff output is the same (#85)
* Only print "no difference detected" when diff output is the same

* wip

* fix for Xcode 13.4.1
2023-04-13 14:04:03 -07:00
Stephen Celis 21404fead4 Show difference when values are equal if labels differ (#84) 2023-04-12 16:34:29 -07:00
Stephen Celis 805c57f32a Don't use AnyKeyPath.debugDescription due to crash (#81)
* 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
2023-04-03 10:59:29 -07:00
stephencelis 6a90124ac7 Run swift-format 2023-03-22 18:27:33 +00:00
Stephen Celis be44c34910 Support ordered dictionaries/sets (#80)
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.
2023-03-22 11:08:42 -07:00
Stephen Celis 2a3499352e Add String.init(customDumping:) (#79)
* 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
2023-03-13 19:27:42 -07:00
stephencelis 2bb5551b6c Run swift-format 2023-03-08 21:43:51 +00:00
Stephen Celis 79cb03ef21 Abbreviate optional, array, and dictionary types (#78)
We try our best to pretty-print in a Swift-y fashion, so let's extend
that to the shorthand syntaxes for optionals, arrays, and dictionaries.
2023-03-08 13:27:39 -08:00
Stephen Celis de8ba65649 Fix regression in typeName output (#77)
* 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
2023-03-07 17:37:57 -08:00
mbrandonw e266399f31 Run swift-format 2023-03-07 22:44:59 +00:00
Brandon Williams 0dd3e712ff Lock access to keyPathToName in key path printing. (#76)
* Lock access to keyPathToName for key path printing.

* slack release

* modernize
2023-03-07 14:37:58 -08:00
Stephen Celis adef407be3 Use AnyKeyPath.customDebugDescription when possible (#73)
* Use `AnyKeyPath.customDebugDescription` when possible

New in Swift 5.8 with implementation of
[SE-0369](https://github.com/apple/swift-evolution/blob/main/proposals/0369-add-customdebugdescription-conformance-to-anykeypath.md).

* Linux support.

* Linux tests

* Fix warning

* Fix

* wip

* wip

* wip
2023-02-22 15:05:06 -08:00
Stephen Celis dd86159e25 Tests 2023-02-03 11:29:00 -08:00
Stephen Celis 3860d0beee Abbreviate enums in diffs (#72)
* 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
2023-02-03 11:08:14 -08:00
Stephen Celis 87dd388a19 Abbreviate nested enums (#71)
We can use dot-abbreviation to keep descriptions short but provide
enough context.
2023-01-30 17:06:26 -08:00
Stephen Celis ead7d30cc2 Update CI to use latest Xcode, test in release (#68)
* Bump CI

* wip

* wip

* wip

* wip

* Fix key path release bug

* bump
2022-11-07 11:59:46 -08:00
Mahmood Tahir 0ff5e251d0 AnyHashable dump conformance (#64)
* 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
2022-10-20 13:34:35 -07:00
Mahmood Tahir 8e64f1eee6 Add ids to second occurrence of a type within a dump (#60)
* Add ids to second occurrence of a type within a dump

* Update logic

* Cleanup

* Update tests after rebase

* Use # instead of <>
2022-10-03 13:43:57 -07:00
Mahmood Tahir d7f18c3e8a Add support to dump superclass nodes (#58)
* 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
2022-10-03 09:54:31 -07:00
Stephen Celis c9b6b940d9 Temporary fix for Xcode 14.1 (#56) 2022-09-14 18:58:08 -04:00
Stephen Celis b7500c3ce7 Add CI for SwiftWASM (#55)
* Add WASM to CI

* wip

* wip

* wip

* wip

* wip

* wip
2022-09-13 00:02:17 -04:00
stephencelis 3737faeece Run swift-format 2022-09-13 03:41:37 +00:00
Yasuhiro Inami 55b08ec65d Add if !os(WASI) for SwiftWasm (#53) 2022-09-12 23:34:55 -04:00
Stephen Celis 11ccf4ca40 Use _typeName instead of String.init(reflecting:) (#52) 2022-06-20 14:54:55 -04:00
Stephen Celis 253e3d9130 Differentiate equal dumps of different types (#49)
Fixes #48.
2022-05-03 11:11:45 -04:00
Brentley Jones e7c6d6444d Show label for visited items (#43) 2022-03-02 09:18:32 -05:00
Stephen Celis 1c384565cf Revert removal of platform requirements (#42)
* Partially revert "f8c70309e75569964669af8a068fb0d0312c323f"

* Revert "Remove platform requirements (#37)"

This reverts commit fa2eb2572b.
2022-02-18 18:02:48 -05:00
Stephen Celis f8c70309e7 Run 13.2 CI on experimental build system (#38)
* Run 13.2 CI on experimental build system

* wip

* wip

* wip
2022-02-17 14:46:36 -05:00
stephencelis e9205f1599 Run swift-format 2022-02-14 17:26:38 +00:00
Stephen Celis fa2eb2572b Remove platform requirements (#37)
* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip
2022-02-14 12:17:32 -05:00
stephencelis 439b99b196 Run swift-format 2021-12-08 15:17:49 +00:00
Jaanus SiimandStephen Celis 51698ece74 UNNotificationPresentationOptions [.banner, .list] workaround (#30)
* UNNotificationPresentationOptions [.banner, .list] workaround

* Update Sources/CustomDump/Conformances/UserNotifications.swift

Co-authored-by: Stephen Celis <stephen.celis@gmail.com>
2021-12-08 10:10:52 -05:00
stephencelis 25292d6c6e Run swift-format 2021-10-25 15:01:32 +00:00
Stephen Celis c393756672 Print object identity in diff (#29)
* Print object identity in diff

* Fix for other structures

* Simplify
2021-10-25 10:40:25 -04:00
stephencelis a0b2f40505 Run swift-format 2021-10-13 17:24:17 +00:00
Stephen Celis 21f8fdbb32 Fix NSNumber() null pointer exception (#28)
* Fix NSNumber() null pointer exception

* Update FoundationTests.swift
2021-10-13 12:53:26 -04:00
Stephen Celis c2dd2c64b7 Don't show "(unknown context)" (#26)
* Don't show "(unknown context)"

It's probably not super useful to preserve this info.

* break out foundation tests

* wip
2021-09-22 14:24:16 -04:00
Stephen Celis cdf46f3a6c More CI (#25)
* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip
2021-09-22 13:11:00 -04:00
David Roman 23801e4e80 Don't compile symbols for Linux that are not yet available (#22) 2021-09-21 22:39:51 -04:00
Kevin Lundberg 897071de6b Don't compile symbols for mac catalyst that are not yet available out of beta (#20) 2021-09-21 09:41:37 -04:00
Adam Roben 5cb92db47d Improve dumping of Errors bridged to NSError (#17)
When dumping a Swift Error bridged to NSError, we'd only show the error
domain and error code generated by the Swift runtime. We can get much
better output (e.g., enum/case names, associated values, etc.) if we
unwrap the Swift Error and dump it directly.

Unfortunately this doesn't work on Linux due to
https://bugs.swift.org/browse/SR-15191.
2021-09-15 12:11:21 -04:00
Stephen Celis 1a2947d25d Fix for Xcode 13 RC targeting macOS on Big Sur (#19)
Fixes #18.
2021-09-14 18:30:24 -04:00
stephencelis b1d34e0711 Run swift-format 2021-08-30 17:32:42 +00:00
BellaposaandStephen Celis 825ea0767e Extend CoreImage conformance (#10)
* Add CoreImage conformance

* Update Sources/CustomDump/Conformances/CoreImage.swift

Co-authored-by: Stephen Celis <stephen.celis@gmail.com>

* Update CoreImage.swift

Co-authored-by: Stephen Celis <stephen.celis@gmail.com>
2021-08-30 10:39:05 -04:00
konomae 56d70aa35a Add Decimal conformance (#9) 2021-08-28 11:47:37 -04:00
stephencelis d71cd3c367 Run swift-format 2021-08-25 18:46:27 +00:00
Stephen CelisandBrandon Williams ec99a2b584 Add some option sets (#8)
* Add conformance for UNAuthorizationOptions

* wip

* wip

* wip

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2021-08-25 13:59:59 -04:00
noppefoxwolf ebf370435e Add UIControl.State conformance (#6)
* Add UIControl.State conformance

* Add UIKit tests
2021-08-24 15:48:42 -04:00
Stephen Celis 7543d4101a Add UIUserInterfaceStyle conformance (#5) 2021-08-24 14:34:41 -04:00
8655495733 Extend conformances Photos, StoreKit, UIKit (#1)
* Conform UIScrollView.ContentInsetAdjustmentBehavior

* Conform some Photos enums

* Conform some StoreKit enums

* Update Sources/CustomDump/Conformances/UIKit.swift

* Fix availability

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
Co-authored-by: Stephen Celis <stephen.celis@gmail.com>
2021-08-23 13:08:04 -04:00