@@ -10,6 +10,15 @@ struct WindowDetectedCallback: ConvenienceCopyable, Equatable {
1010 rawRun ?? dieT ( " ID-46D063B2 should have discarded nil " )
1111 }
1212
13+ var debugJson : Json {
14+ var result : [ String : Json ] = [ : ]
15+ result [ " matcher " ] = matcher. debugJson
16+ if let commands = rawRun {
17+ result [ " commands " ] = . string( commands. prettyDescription)
18+ }
19+ return . dict( result)
20+ }
21+
1322 static func == ( lhs: WindowDetectedCallback , rhs: WindowDetectedCallback ) -> Bool {
1423 return lhs. matcher == rhs. matcher && lhs. checkFurtherCallbacks == rhs. checkFurtherCallbacks &&
1524 zip ( lhs. run, rhs. run) . allSatisfy { $0. equals ( $1) }
@@ -23,6 +32,26 @@ struct WindowDetectedCallbackMatcher: ConvenienceCopyable, Equatable {
2332 var workspace : String ?
2433 var duringAeroSpaceStartup : Bool ?
2534
35+ var debugJson : Json {
36+ var resultParts : [ String ] = [ ]
37+ if let appId {
38+ resultParts. append ( " appId= \" \( appId) \" " )
39+ }
40+ if appNameRegexSubstring != nil {
41+ resultParts. append ( " appNameRegexSubstrin=Regex " )
42+ }
43+ if windowTitleRegexSubstring != nil {
44+ resultParts. append ( " windowTitleRegexSubstring=Regex " )
45+ }
46+ if let workspace {
47+ resultParts. append ( " workspace= \" \( workspace) \" " )
48+ }
49+ if let duringAeroSpaceStartup {
50+ resultParts. append ( " duringAeroSpaceStartup= \( duringAeroSpaceStartup) " )
51+ }
52+ return . string( resultParts. joined ( separator: " , " ) )
53+ }
54+
2655 static func == ( lhs: WindowDetectedCallbackMatcher , rhs: WindowDetectedCallbackMatcher ) -> Bool {
2756 check (
2857 lhs. appNameRegexSubstring == nil &&
0 commit comments