def METHOD_NAME(cursor, menu, mainwindow):
    """Return a list of context menu actions jumping to the definition."""
    import definition
    node = definition.refnode(cursor)
    if node:
        a = QAction(menu)
        def complete():
            target = definition.target(node)
            if target:
                if target.document is node.document:
                    a.setText(_("&Jump to definition (line {num})").format(
                        num = node.document.index(node.document.block(target.position)) + 1))
                else:
                    a.setText(_("&Jump to definition (in {filename})").format(
                        filename=util.homify(target.document.filename)))
                @a.triggered.connect
                def activate():
                    definition.goto_target(mainwindow, target)
            else:
                a.setText(_("&Jump to definition (unknown)"))
                a.setEnabled(False)
        QTimer.singleShot(0, complete)
        return [a]
    return []