Files
jadx/jadx-plugins/jadx-script/examples/scripts/gui/caret_mouse.jadx.kts
T
Yoav Sternberg f558203a9d feat(api): access node under caret/mouse and jump (PR #1903)
* Access node under caret/mouse and jump
* Apply lint
2023-06-09 15:50:57 +01:00

20 lines
575 B
Kotlin

import jadx.api.metadata.ICodeNodeRef
val jadx = getJadxInstance()
jadx.gui.ifAvailable {
addPopupMenuAction(
"Print enclosing symbols under caret or mouse",
enabled = { true },
keyBinding = "G",
action = ::runAction,
)
}
fun runAction(node: ICodeNodeRef) {
jadx.log.info { "Node under caret: ${jadx.gui.nodeUnderCaret}" }
jadx.log.info { "Enclosing node under caret: ${jadx.gui.enclosingNodeUnderCaret}" }
jadx.log.info { "Node under mouse: ${jadx.gui.nodeUnderMouse}" }
jadx.log.info { "Enclosing Node under mouse: ${jadx.gui.enclosingNodeUnderMouse}" }
}