PHP Debug launch configurations
I noticed that the PHP Debug extension can use debug launch options from the settings.json global configuration, which avoids the need for launch.json workspace configuration. This would be especially useful for users of the IFS Browser, who might not have a local workspace.
https://code.visualstudio.com/Docs/editor/debugging#_global-launch-configuration
The Code for i extension could help to configure settings.json automatically if there was no workspace and it detected that a PHP file from the IFS was open. Another way could be if launch.json could be created in memory, as part of the extension, rather than a permanent object in a workspace file. Liam suggested:
I could add some UI that says something like “Do you want to configure debugging for PHP on IBM i?“, which would show if they are connected, have opened a .php file, and have xdebug installed. It could then prompt them for the xdebug token OR ignore it, then insert into the settings automatically
Example in settings.json with path mapping for IFS root:
"launch": {
"version": "0.2.0",
"configurations": [{
"name": "PHP: Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/": "streamfile:/"
}
}]
},
We would like to support two use cases:
- Xdebug cloud prompt for token
- Local network debugging
@alanseiden I assume port indicates local network debugging?
Can also you also share a launch configuration for Xdebug cloud using a token?
{
"name": "Connect to Xdebug Cloud",
"type": "php",
"request": "launch",
"xdebugCloudToken": "<guid looking thing>",
"pathMappings": {
"/": "streamfile:/"
}
},