How to add a custom XDebug Client menu to Sublime Text (on Mac)

aubreypwd

Aubrey Portwood

Posted on August 23, 2022

How to add a custom XDebug Client menu to Sublime Text (on Mac)

Image description

Note, this works with this package: XDebug Client

Edit your Application Support/Sublime Text/Packages/User/Main.sublime-menu file and add the following to it:

[
    {
        "caption": "XDebug",
        "mnemonic": "X",
        "id": "xDebug",
        "children":
        [
            {
                "caption": "Continue",
                "command": "xdebug_continue"
            },
            {
                "caption": "Evaluate",
                "command": "xdebug_evaluate"
            },
            {
                "caption": "Restart",
                "command": "xdebug_session_restart"
            },
            {
                "caption": "Stop",
                "command": "xdebug_session_stop"
            },
            {
                "caption": "Toggle Breakpoint",
                "command": "xdebug_breakpoint"
            },
            {
                "caption": "Clear All Breakpoints",
                "command": "xdebug_clear_all_breakpoints"
            },
            {
                "caption": "Start",
                "command": "xdebug_session_start"
            }
        ]
    }
]
Enter fullscreen mode Exit fullscreen mode

Now, at first all the menu items won't show, but that's because you haven't started a debugging session. Just add a breakpoint and start a session to see all the other menu items.

I wish SublimeText had a API for adding buttons for these, but I think this is as good as it's going to get!

See my configuration, as it may have been changed or improved.

Happy debugging!

💖 💪 🙅 🚩
aubreypwd
Aubrey Portwood

Posted on August 23, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related