Skip to content

[MOOSE-190]: Add shared debug settings#351

Open
MlKilderkin wants to merge 3 commits intomainfrom
feature/MOOSE-190/shared-settings
Open

[MOOSE-190]: Add shared debug settings#351
MlKilderkin wants to merge 3 commits intomainfrom
feature/MOOSE-190/shared-settings

Conversation

@MlKilderkin
Copy link
Copy Markdown
Contributor

@MlKilderkin MlKilderkin commented Apr 21, 2026

What does this do/fix?

  • Add composer run phpstorm-workspace-php-debugphp ./dev/scripts/inject-phpstorm-php-debug-workspace.php to inject/replace the PhpStorm PhpServers block in .idea/workspace.xml (PHP-only; no Python). Prompts before overwriting a different block; supports PHPSTORM_PHP_DEBUG_OVERWRITE=1 when stdin is not a TTY.
  • Add composer run sync-vscode-launch → copies dev/configs/.vscode/launch.json to .vscode/launch.json and creates .vscode if missing (overwrites an existing launch.json).
  • Update docs/development-tools.md with both commands, overwrite warnings, and the PHP Debug (xdebug.php-debug) requirement for VS Code

Note: There is no direct way to export PHPStorm settings for debug only. All PHP Debug servers info are stored in .idea/workspace.xml alongside other user settings
This information won't work. It refers to specific debug configuration templates like running PHPUnit tests or similar
Due to that a new command phpstorm-workspace-php-debug is introduced

QA

Links to relevant issues

Copy link
Copy Markdown
Collaborator

@dpellenwood dpellenwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MlKilderkin , thanks for doing this. I think we should keep the simple VS Code config, but leave instructions for PHPStorm instead. Thoughts?

Comment on lines +2 to +11
/**
* Inject or replace the PhpStorm PhpServers block in .idea/workspace.xml.
* Intended for Docker/Xdebug path mappings (e.g. $PROJECT_DIR$ -> /app).
*
* Run manually: composer run phpstorm-workspace-php-debug
*
* If workspace.xml already contains a different PhpServers block, asks for
* confirmation before overwriting. Non-interactive runs must set:
* PHPSTORM_PHP_DEBUG_OVERWRITE=1
*/
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a shame that the debug mappings can't be added via a shared config. I appreciate you going deep to try and automate this. But, I think this is more effort than it's worth. We can leave the documentation and a Loom demo link for how to configure PHPStorm for xDebug rather than a complex script of this nature. Imho, this is too brittle/complex to be worth keeping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants