You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Docs] Move XDebug IDE integration closer to the top, explain the DevTools workflow is highly exploratory (#2975)
Updated the documentation to reflect changes in IDE integration for
debugging with Xdebug, including prerequisites and commands for VS Code.
Removed redundant sections and clarified the use of experimental flags.
cc @fellyph
Copy file name to clipboardExpand all lines: packages/docs/site/docs/developers/07-xdebug/02-getting-started.md
+46-42Lines changed: 46 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,9 +31,53 @@ This starts WordPress on `http://127.0.0.1:9400` with Xdebug enabled. Now you ca
31
31
Only one project can be debugged at a time.
32
32
:::
33
33
34
-
## Starting with DevTools
34
+
## Starting with IDE integration
35
+
36
+
Similar to the process with DevTools, let's use the same plugin code from before to debug with VS Code, and add the `--experimental-unsafe-ide-integration=vscode` flag. This flag will optimize the setup process for VS Code. If you're working with PhpStorm, add the `--experimental-unsafe-ide-integration=phpstorm` flag.
35
37
36
-
To debug with Chrome DevTools, add the `--experimental-devtools` flag:
38
+
:::info
39
+
This flag is marked as `unsafe` because it edits the IDE config files to set Xdebug path mappings and web server details. **CAUTION:** If there are bugs, this feature may cause your IDE configuration files to break. Please consider backing up your IDE configs before using this feature.
40
+
:::
41
+
42
+
To debug in VS Code, you'll need the following prerequisites:
43
+
44
+
1. An extension to add PHP profiling support, for example, [PHP Debug](https://marketplace.visualstudio.com/items?itemName=xdebug.php-debug) or another debugger extension to your preference.
45
+
2. Have a `.vscode/` folder.
46
+
3. Enable breakpoints in your IDE. Some IDEs come with this feature disabled, so be aware of this detail.
47
+
48
+
If everything is ready, you run the command:
49
+
50
+
```bash
51
+
npx @wp-playground/cli@latest server --xdebug --experimental-unsafe-ide-integration=vscode --auto-mount
52
+
```
53
+
If you don't have a `.vscode/launch.json` file, the terminal will create a file similar to this:
Now, you can go to your code, add the breakpoints, start the debugging session named by your IDE, and happy testing.
73
+
74
+

75
+
76
+
## Early Access: DevTools debugger
77
+
78
+
Playground CLI ships an **unstable, highly exploratory** workflow that enables debugging PHP programs using Chrome DevTools.
79
+
80
+
To try it, use the `--experimental-devtools` flag:
37
81
38
82
```bash
39
83
npx @wp-playground/cli@latest server --xdebug --experimental-devtools
@@ -99,46 +143,6 @@ The Playground CLI(`@wp-playground/cli`) will automatically detect the plugin fo
99
143
100
144

101
145
102
-
## Starting with IDE integration
103
-
104
-
Similar to the process with DevTools, let's use the same plugin code from before to debug with VS Code, and add the `--experimental-unsafe-ide-integration=vscode` flag. This flag will optimize the setup process for VS Code. If you're working with PhpStorm, add the `--experimental-unsafe-ide-integration=phpstorm` flag.
105
-
106
-
:::info
107
-
This flag is marked as `unsafe` because it edits the IDE config files to set Xdebug path mappings and web server details. **CAUTION:** If there are bugs, this feature may cause your IDE configuration files to break. Please consider backing up your IDE configs before using this feature.
108
-
:::
109
-
110
-
To debug in VS Code, you'll need the following prerequisites:
111
-
112
-
1. An extension to add PHP profiling support, for example, [PHP Debug](https://marketplace.visualstudio.com/items?itemName=xdebug.php-debug) or another debugger extension to your preference.
113
-
2. Have a `.vscode/` folder.
114
-
3. Enable breakpoints in your IDE. Some IDEs come with this feature disabled, so be aware of this detail.
115
-
116
-
If everything is ready, you run the command:
117
-
118
-
```bash
119
-
npx @wp-playground/cli@latest server --xdebug --experimental-unsafe-ide-integration=vscode --auto-mount
120
-
```
121
-
If you don't have a `.vscode/launch.json` file, the terminal will create a file similar to this:
Now, you can go to your code, add the breakpoints, start the debugging session named by your IDE, and happy testing.
141
-
142
-

143
147
144
148
This feature is in experimental mode. Until it's finished, we'll need your feedback. Please connect with us in the [#playground Slack channel](https://wordpress.slack.com/archives/C04EWKGDJ0K) and share your thoughts.
0 commit comments