Skip to content

Commit cd616aa

Browse files
committed
Update the window to show up only when the focused element is a "Source Editor"
1 parent 420d57b commit cd616aa

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Core/Sources/Service/GUI/SuggestionPanelController.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ final class SuggestionPanelController {
4848
let application = AXUIElementCreateApplication(activeXcode.processIdentifier)
4949
if let focusElement: AXUIElement = try? application
5050
.copyValue(key: kAXFocusedUIElementAttribute),
51+
let focusElementType: String = try? focusElement.copyValue(key: kAXDescriptionAttribute),
52+
focusElementType == "Source Editor",
5153
let parent: AXUIElement = try? focusElement.copyValue(key: kAXParentAttribute),
5254
let positionValue: AXValue = try? parent
5355
.copyValue(key: kAXPositionAttribute),

0 commit comments

Comments
 (0)