File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import Environment
77import Preferences
88import SwiftUI
99import UserDefaultsObserver
10+ import XcodeInspector
1011
1112@MainActor
1213public final class SuggestionWidgetController : NSObject {
@@ -482,8 +483,7 @@ extension SuggestionWidgetController {
482483 let detachChat = chatWindowViewModel. chatPanelInASeparateWindow
483484
484485 if let widgetFrames = {
485- if let xcode = ActiveApplicationMonitor . latestXcode {
486- let application = AXUIElementCreateApplication ( xcode. processIdentifier)
486+ if let application = XcodeInspector . shared. latestActiveXcode? . appElement {
487487 if let focusElement = application. focusedElement,
488488 focusElement. description == " Source Editor " ,
489489 let parent = focusElement. parent,
Original file line number Diff line number Diff line change @@ -139,9 +139,9 @@ public final class XcodeInspector: ObservableObject {
139139}
140140
141141public class AppInstanceInspector : ObservableObject {
142- let runningApplication : NSRunningApplication
143- let appElement : AXUIElement
144- var isActive : Bool { runningApplication. isActive }
142+ public let appElement : AXUIElement
143+ public let runningApplication : NSRunningApplication
144+ public var isActive : Bool { runningApplication. isActive }
145145
146146 init ( runningApplication: NSRunningApplication ) {
147147 self . runningApplication = runningApplication
You can’t perform that action at this time.
0 commit comments