Skip to content

Commit 04d9b1a

Browse files
committed
Make fetchFocusedElementURI return fake URL when Xcode not launched
1 parent cbfdc1a commit 04d9b1a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Core/Sources/Environment/Environment.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,7 @@ public enum Environment {
114114
public static var fetchFocusedElementURI: () async throws -> URL = {
115115
guard let xcode = ActiveApplicationMonitor.activeXcode
116116
?? ActiveApplicationMonitor.latestXcode
117-
else {
118-
throw FailedToFetchFileURLError()
119-
}
117+
else { return URL(fileURLWithPath: "/global") }
120118

121119
let application = AXUIElementCreateApplication(xcode.processIdentifier)
122120
let focusedElement = application.focusedElement

0 commit comments

Comments
 (0)