@@ -10,6 +10,19 @@ struct WindowDetectedCallback: ConvenienceCopyable, Equatable {
1010 rawRun ?? dieT ( " ID-46D063B2 should have discarded nil " )
1111 }
1212
13+ var debugInfo : Json {
14+ var result : [ String : Json ] = [ : ]
15+ result [ " matcher " ] = matcher. debugInfo
16+ if let commands = rawRun {
17+ let commandsJson : [ Json ] = commands. map { command in
18+ let args = command. args. rawArgs. value. joined ( separator: " , " )
19+ return . string( " \( command. info. kind. rawValue) \( args) " )
20+ }
21+ result [ " commands " ] = . array( commandsJson)
22+ }
23+ return . dict( result)
24+ }
25+
1326 static func == ( lhs: WindowDetectedCallback , rhs: WindowDetectedCallback ) -> Bool {
1427 return lhs. matcher == rhs. matcher && lhs. checkFurtherCallbacks == rhs. checkFurtherCallbacks &&
1528 zip ( lhs. run, rhs. run) . allSatisfy { $0. equals ( $1) }
@@ -22,7 +35,27 @@ struct WindowDetectedCallbackMatcher: ConvenienceCopyable, Equatable {
2235 var windowTitleRegexSubstring : Regex < AnyRegexOutput > ?
2336 var workspace : String ?
2437 var duringAeroSpaceStartup : Bool ?
25-
38+
39+ var debugInfo : Json {
40+ var resultParts : [ String ] = [ ]
41+ if let appId = appId {
42+ resultParts. append ( " appId= \" \( appId) \" " )
43+ }
44+ if let _ = appNameRegexSubstring {
45+ resultParts. append ( " appNameRegexSubstrin=Regex " )
46+ }
47+ if let _ = windowTitleRegexSubstring {
48+ resultParts. append ( " windowTitleRegexSubstring=Regex " )
49+ }
50+ if let workspace = workspace {
51+ resultParts. append ( " workspace= \" \( workspace) \" " )
52+ }
53+ if let duringAeroSpaceStartup = duringAeroSpaceStartup {
54+ resultParts. append ( " duringAeroSpaceStartup= \( duringAeroSpaceStartup) " )
55+ }
56+ return . string( resultParts. joined ( separator: " , " ) )
57+ }
58+
2659 static func == ( lhs: WindowDetectedCallbackMatcher , rhs: WindowDetectedCallbackMatcher ) -> Bool {
2760 check (
2861 lhs. appNameRegexSubstring == nil &&
0 commit comments