We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 473f88f commit eac534bCopy full SHA for eac534b
1 file changed
Core/Sources/Environment/Environment.swift
@@ -116,13 +116,20 @@ public enum Environment {
116
117
let application = AXUIElementCreateApplication(xcode.processIdentifier)
118
let focusedElement = application.focusedElement
119
- if focusedElement?.description != "Source Editor" {
+ var windowElement: URL {
120
let window = application.focusedWindow
121
let id = window?.identifier.hashValue
122
return URL(fileURLWithPath: "/xcode-focused-element/\(id ?? 0)")
123
}
124
+ if focusedElement?.description != "Source Editor" {
125
+ return windowElement
126
+ }
127
- return try await fetchCurrentFileURL()
128
+ do {
129
+ return try await fetchCurrentFileURL()
130
+ } catch {
131
132
133
134
135
public static var createSuggestionService: (
0 commit comments