Open westonruter opened 2 years ago
cc @noahtallen
Well, I was able to get it to work by configuring the PhpStorm server to have the name localhost
, and then to set the host as localhost
instead of host.docker.internal
. So this may not be needed.
I remember there was a weird thing with the automatic client detection settings here: https://github.com/WordPress/gutenberg/blob/d5915916abc45e6682f4bdb70888aa41e98aa395/packages/env/lib/init-config.js#L165-L168
It feels a bit weird to make the IDE configurable in .wp-env.json, just because different devs might use different IDEs for the same project. Would it make sense to allow it to be passed in from the environment? E.g. if something is on process.env
, add it to the Xdebug settings?
It feels a bit weird to make the IDE configurable in .wp-env.json, just because different devs might use different IDEs for the same project.
I was thinking perhaps it could be supplied via .wp-env.override.json
.
Would it make sense to allow it to be passed in from the environment? E.g. if something is on
process.env
, add it to the Xdebug settings?
I like that.
What problem does this address?
I'm attempting to configure wp-env with Xdebug for PhpStorm/IntelliJ. As I understand, this requires an IDE key for PhpStorm to make the connection with the Debugger. For example, when I have created a server in PhpStorm called
amp
:I can then run PHPUnit for my plugin with the following command and Xdebug will stop execution at any IDE-specified breakpoints:
Note the
PHP_IDE_CONFIG=serverName=amp
environment variable being defined. So that works for the tests environment. However, I'm not having luck with the development environment. I think this is because thexdebug.idekey
is undefined in the development instance. The only mention of this configuration I found in the project is https://github.com/WordPress/gutenberg/issues/20636#issuecomment-666335104 but it was hardcoded toVSCODE
and it didn't end up getting merged.For context, see https://github.com/ampproject/amp-wp/pull/6802 for attempting to standardize the AMP plugin development environment to use wp-env.
What is your proposed solution?
There could be a way to specify the
xdebug.idekey
in the.wp-env
file.