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
Copy file name to clipboardExpand all lines: doc/editors.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,3 +19,49 @@
19
19
#### PHPStan
20
20
21
21
-[Configuration and usage with PhpStorm](https://www.jetbrains.com/help/phpstorm/using-phpstan.html).
22
+
23
+
## Visual Studio Code
24
+
25
+
### Debugging
26
+
27
+
#### Requirements
28
+
29
+
- PHP Debug (`xdebug.php-debug`) extension for VSCode by *Xdebug*.
30
+
31
+
#### Setup
32
+
33
+
Create file `.vscode/launch.json` with contents:
34
+
35
+
{
36
+
// Use IntelliSense to learn about possible attributes.
37
+
// Hover to view descriptions of existing attributes.
38
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
39
+
"version": "0.2.0",
40
+
"configurations": [
41
+
{
42
+
"name": "Listen for Xdebug",
43
+
"type": "php",
44
+
"request": "launch",
45
+
"port": 9003,
46
+
"pathMappings": {
47
+
"/app": "${workspaceRoot}"
48
+
}
49
+
}
50
+
]
51
+
}
52
+
53
+
To make it possible to go directly to a line and file in VSCode by clicking on the filenames that Xdebug shows in stack traces in Symfony Profiler in `./etc/frankenphp/conf.d/20-app.dev.ini` comment out line starting with `xdebug.file_link_format=` and add this bellow it:
Path to app in container `/app` will be mapped to `<PATH_TO_APP_ON_HOST>` outside container.
58
+
59
+
After making changes to `20-app.dev.ini` run `make restart`.
60
+
61
+
#### Debug
62
+
63
+
In VSCode [set breakpoint](https://code.visualstudio.com/docs/editor/debugging#_breakpoints), after that in menu click on `Run > Start Debugging`.
64
+
65
+
Add the `XDEBUG_SESSION=1` query parameter to the URL of the page you want to debug (e.g. [http://localhost/?XDEBUG_SESSION=1](http://localhost/?XDEBUG_SESSION=1)), or use [other available triggers](https://xdebug.org/docs/step_debug#activate_debugger)
66
+
67
+
Alternatively, you can use [the **Xdebug extension**](https://xdebug.org/docs/step_debug#browser-extensions) for your preferred web browser.
0 commit comments