Skip to content

Conversation

@mho22
Copy link
Collaborator

@mho22 mho22 commented Nov 26, 2025

Motivation for the change, related issues

Based on issue #2763 and following pull request #2777

This pull request generates the IDE configuration files inside the developer's IDE.

Implementation details

  • It first clears all the configs named PHP.wasm CLI - Listen for Xdebug in VSCode and PHPStorm config files.

  • If --xdebug and --experimental-unsafe-ide-integration options are present, we add IDE configs in the related configs.

  • PHPStorm : it adds a new server with name PHP.wasm CLI - Listen for Xdebug in .idea/workspace.xml.

  • VSCode : it adds a new configuration with name PHP.wasm CLI - Listen for Xdebug in .vscode/launch.json.

  • Correction of an error in Playground CLI console.logs.

  • Creation of a new distinct package named @php-wasm/cli-util which is integrated into PHP.wasm CLI and Playground CLI with the xdebug-path-mappings.

Next steps are reported in the Xdebug Follow-up issue.

Testing Instructions (or ideally a Blueprint)

CI

🧪 test-php-wasm-cli-util

cc @fellyph

@mho22 mho22 closed this Dec 1, 2025
@mho22 mho22 force-pushed the add-xdebug-path-mappings-in-php-wasm-cli branch from bfe7f30 to 2235e13 Compare December 1, 2025 14:53
@mho22 mho22 reopened this Dec 1, 2025
@mho22 mho22 marked this pull request as ready for review December 1, 2025 16:35
@mho22 mho22 requested a review from a team as a code owner December 1, 2025 16:35
@mho22
Copy link
Collaborator Author

mho22 commented Dec 1, 2025

@adamziel I created a new package named @php-wasm/cli-util. What do you think?

@mho22 mho22 requested a review from adamziel December 4, 2025 17:57
});

it('should not duplicate configuration if it already exists', () => {
const json = '{\n "configurations": []\n}';
Copy link
Collaborator

Choose a reason for hiding this comment

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

tangential and unrelated to this PR, but a test where json is just {} would be useful. Similarly, a test where it's an unexpected value such as "" or {}

"author": "The WordPress contributors",
"contributors": [
{
"name": "Adam Zielinski",
Copy link
Collaborator

@adamziel adamziel Dec 5, 2025

Choose a reason for hiding this comment

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

We're long past the point where it's just me. Let's just remove the contributors key entirely, "author" will do.

@@ -0,0 +1,46 @@
{
"name": "@php-wasm/cli-util",
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpick:

Suggested change
"name": "@php-wasm/cli-util",
"name": "@php-wasm/cli-utils",

Copy link
Collaborator

@adamziel adamziel left a comment

Choose a reason for hiding this comment

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

I've left a few nitpicks but it's solid otherwise. Feel free to merge after addressing them. Thank you! ❤️

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.

3 participants