This is based on the instructions at https://ddev.readthedocs.io/en/stable/users/debugging-profiling/step-debugging/#visual-studio-code-vs-code-debugging-setup If there's something in this gist that doesn't work, check the docs in case things have changed.
- Create a
.vscode/
directory in your project root. - Create a
launch.json
file inside that.vscode/
directory with the contents from https://ddev.readthedocs.io/en/stable/users/snippets/launch.json - Create a
tasks.json
file inside that.vscode/
directory with the contents from https://ddev.readthedocs.io/en/stable/users/snippets/tasks.json
The .vscode/launch.json
file tells vscode how to listen to xdebug, and also tells it to enable/disable xdebug for you.