Kindari / SublimeXdebug

Xdebug Interface for Sublime Text 2
Other
366 stars 66 forks source link

SublimeXDebug

Simple client to connect with XDebug.

Features

Screenshot

Quick start

Use Shift+f8 to show a list of actions:

Once the XDebug connection is captured, using the same shortcut shows these XDebug actions:

Debugger control menu

Shortcut keys

Session based debugging

This plugin can initiate and terminate a debugging session by launching your default web browser with the XDEBUG_SESSION_START or XDEBUG_SESSION_STOP parameters. The debug URL is defined in your .sublime-project file like this:

{
    "folders":
    [
        {
            "path": "..."
        },
    ],

    "settings": {
        "xdebug": { "url": "http://your.web.server" }
    }
}

If you don't configure the URL, the plugin will still listen for debugging connections from XDebug, but you will need to trigger XDebug for a remote session. The IDE Key should be "sublime.xdebug".

Gutter icon color

You can change the color of the gutter icons by adding the following scopes to your theme file: xdebug.breakpoint, xdebug.current. Icons from Font Awesome.

Installing XDebug

Of course, SublimeXDebug won't do anything if you don't install and configure XDebug first.

Here's how I setup XDebug on Ubuntu 12.04:

Troubleshooting

XDebug won't stop at breakpoints on empty lines. The breakpoint must be on a line of PHP code.

If your window doesn't remove the debugging views when you stop debugging, then you can revert to a single document view by pressing Shift+Alt+1

The debugger assumes XDebug is configured to connect on port 9000.

Fixing pyexpat module errors. In Ubuntu you might need to do the following because Ubuntu stopped shipping Python 2.6 libraries a long time ago:

$ sudo apt-get install python2.6
$ ln -s /usr/lib/python2.6 [Sublime Text dir]/lib/

On Ubuntu 12.04, Python 2.6 isn't available, so here's what worked for me:

In theory, it should work with any XDebug client, but I've only tested with PHP.