Skip to content

Commit

Permalink
Add more information to Xcode Inspector debug menu
Browse files Browse the repository at this point in the history
  • Loading branch information
intitni committed Jan 22, 2024
1 parent 6706199 commit d339f97
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions ExtensionService/AppDelegate+Menu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,22 @@ extension AppDelegate: NSMenuDelegate {
.append(.text("Active Workspace: \(inspector.activeWorkspaceURL?.path ?? "N/A")"))
menu.items
.append(.text("Active Document: \(inspector.activeDocumentURL?.path ?? "N/A")"))

if let focusedWindow = inspector.focusedWindow {
menu.items.append(.text(
"Active Window: \(focusedWindow.uiElement.identifier)"
))
} else {
menu.items.append(.text("Active Window: N/A"))
}

if let focusedElement = inspector.focusedElement {
menu.items.append(.text(
"Focused Element: \(focusedElement.description)"
))
} else {
menu.items.append(.text("Focused Element: N/A"))
}

if let sourceEditor = inspector.focusedEditor {
menu.items.append(.text(
Expand Down
2 changes: 1 addition & 1 deletion Tool/Sources/XcodeInspector/XcodeWindowInspector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Combine
import Foundation

public class XcodeWindowInspector: ObservableObject {
let uiElement: AXUIElement
public let uiElement: AXUIElement

init(uiElement: AXUIElement) {
self.uiElement = uiElement
Expand Down

0 comments on commit d339f97

Please sign in to comment.