File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -116,13 +116,20 @@ public enum Environment {
116116
117117 let application = AXUIElementCreateApplication ( xcode. processIdentifier)
118118 let focusedElement = application. focusedElement
119- if focusedElement ? . description != " Source Editor " {
119+ var windowElement : URL {
120120 let window = application. focusedWindow
121121 let id = window? . identifier. hashValue
122122 return URL ( fileURLWithPath: " /xcode-focused-element/ \( id ?? 0 ) " )
123123 }
124+ if focusedElement? . description != " Source Editor " {
125+ return windowElement
126+ }
124127
125- return try await fetchCurrentFileURL ( )
128+ do {
129+ return try await fetchCurrentFileURL ( )
130+ } catch {
131+ return windowElement
132+ }
126133 }
127134
128135 public static var createSuggestionService : (
You can’t perform that action at this time.
0 commit comments