xdebug / vscode-php-debug

PHP Debug Adapter for Visual Studio Code 🐞⛔
MIT License
768 stars 175 forks source link

How to specify PHP Xdebug extension in VSCode? #905

Open Loki3000 opened 1 year ago

Loki3000 commented 1 year ago

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?

zobo commented 1 year ago

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.

Loki3000 commented 1 year ago

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?

zobo commented 1 year ago

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 commented 1 year ago

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