@@ -25,7 +25,7 @@ public enum Environment {
2525 public static var now = { Date ( ) }
2626
2727 public static var isXcodeActive : ( ) async -> Bool = {
28- ActiveApplicationMonitor . activeXcode != nil
28+ ActiveApplicationMonitor . shared . activeXcode != nil
2929 }
3030
3131 public static var frontmostXcodeWindowIsEditor : ( ) async -> Bool = {
@@ -43,8 +43,8 @@ public enum Environment {
4343 }
4444
4545 public static var fetchCurrentProjectRootURLFromXcode : ( ) async throws -> URL ? = {
46- if let xcode = ActiveApplicationMonitor . activeXcode
47- ?? ActiveApplicationMonitor . latestXcode
46+ if let xcode = ActiveApplicationMonitor . shared . activeXcode
47+ ?? ActiveApplicationMonitor . shared . latestXcode
4848 {
4949 let application = AXUIElementCreateApplication ( xcode. processIdentifier)
5050 let focusedWindow = application. focusedWindow
@@ -84,8 +84,8 @@ public enum Environment {
8484 }
8585
8686 public static var fetchCurrentFileURL : ( ) async throws -> URL = {
87- guard let xcode = ActiveApplicationMonitor . activeXcode
88- ?? ActiveApplicationMonitor . latestXcode
87+ guard let xcode = ActiveApplicationMonitor . shared . activeXcode
88+ ?? ActiveApplicationMonitor . shared . latestXcode
8989 else {
9090 throw FailedToFetchFileURLError ( )
9191 }
@@ -111,8 +111,8 @@ public enum Environment {
111111 }
112112
113113 public static var fetchFocusedElementURI : ( ) async throws -> URL = {
114- guard let xcode = ActiveApplicationMonitor . activeXcode
115- ?? ActiveApplicationMonitor . latestXcode
114+ guard let xcode = ActiveApplicationMonitor . shared . activeXcode
115+ ?? ActiveApplicationMonitor . shared . latestXcode
116116 else { return URL ( fileURLWithPath: " /global " ) }
117117
118118 let application = AXUIElementCreateApplication ( xcode. processIdentifier)
@@ -134,8 +134,8 @@ public enum Environment {
134134 }
135135
136136 public static var triggerAction : ( _ name: String ) async throws -> Void = { name in
137- guard let activeXcode = ActiveApplicationMonitor . activeXcode
138- ?? ActiveApplicationMonitor . latestXcode
137+ guard let activeXcode = ActiveApplicationMonitor . shared . activeXcode
138+ ?? ActiveApplicationMonitor . shared . latestXcode
139139 else { return }
140140 let bundleName = Bundle . main
141141 . object ( forInfoDictionaryKey: " EXTENSION_BUNDLE_NAME " ) as! String
0 commit comments