vscode-php-debug icon indicating copy to clipboard operation
vscode-php-debug copied to clipboard

How to specify PHP Xdebug extension in VSCode?

Open Loki3000 opened this issue 1 year ago • 4 comments

PHP version: 8.2.7 Xdebug version: 3.2.1 VS Code extension version: 1.32.1

Your launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for Xdebug",
            "type": "php",
            "request": "launch",
            "port": 9003
        },
        ...
    ]
}

I have two installed extensions: xdebug.php-debug and devsense.phptools-vscode. Both support PHP debugging.

How can I specify which one to use for debugging?

If both are enabled, every debug session is caught by devsense.phptools-vscode, but I prefer to use xdebug.php-debug for debugging.

If devsense.phptools-vscode is disabled, - everything works well, and step-debugging works through xdebug.php-debug.

Unfortunately, I need devsense.phptools-vscode enabled for other functions.

Is there a way to specify which extension to use for debugging?

Perhaps it's possible to set extension priority or something similar?

Loki3000 avatar Jun 12 '23 07:06 Loki3000

This has bugged me too for a long time. I am not sure if I can do anything about it in the extension alone. I will open a case with vscode.

zobo avatar Jun 12 '23 07:06 zobo

Thank you for participating! If you're right and the extensions are included in alphabetical order, can I try changing the extension name locally? Will it work?

Loki3000 avatar Jun 12 '23 08:06 Loki3000

I do not think that would be that trivial - you'd probably need to repackage it. Let's give some time to the wonderful VSC team to give some feedback.

zobo avatar Jun 12 '23 09:06 zobo

Ref: https://github.com/DEVSENSE/phptools-docs/issues/355

zobo avatar Jul 28 '23 14:07 zobo