File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Core/Sources/ActiveApplicationMonitor Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -2,14 +2,16 @@ import AppKit
22
33public final class ActiveApplicationMonitor {
44 static let shared = ActiveApplicationMonitor ( )
5- var latestXcode : NSRunningApplication ?
5+ var latestXcode : NSRunningApplication ? = NSWorkspace . shared. runningApplications
6+ . first ( where: \. isXcode)
67 var activeApplication = NSWorkspace . shared. runningApplications. first ( where: \. isActive) {
78 didSet {
89 if activeApplication? . isXcode ?? false {
910 latestXcode = activeApplication
1011 }
1112 }
1213 }
14+
1315 private var continuations : [ UUID : AsyncStream < NSRunningApplication ? > . Continuation ] = [ : ]
1416
1517 private init ( ) {
@@ -40,7 +42,7 @@ public final class ActiveApplicationMonitor {
4042 }
4143 return nil
4244 }
43-
45+
4446 public static var latestXcode : NSRunningApplication ? { shared. latestXcode }
4547
4648 public static func createStream( ) -> AsyncStream < NSRunningApplication ? > {
@@ -72,7 +74,6 @@ public final class ActiveApplicationMonitor {
7274 }
7375}
7476
75- extension NSRunningApplication {
76- public var isXcode : Bool { bundleIdentifier == " com.apple.dt.Xcode " }
77+ public extension NSRunningApplication {
78+ var isXcode : Bool { bundleIdentifier == " com.apple.dt.Xcode " }
7779}
78-
You can’t perform that action at this time.
0 commit comments