Skip to content

Commit c8ff98b

Browse files
authored
Add section about phoenix debug
Too many people end up with broken config, e.g. #451 #659
1 parent 2e7ac6d commit c8ff98b

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ In order to debug modules in `.exs` files (such as tests), they must be specifie
109109
"name": "mix test",
110110
"request": "launch",
111111
"task": "test",
112-
"taskArgs": ["--trace"],
112+
"taskArgs": [
113+
"--trace"
114+
],
115+
"startApps": true,
113116
"projectDir": "${workspaceRoot}",
114117
"requireFiles": [
115118
"test/**/test_helper.exs",
@@ -127,6 +130,7 @@ In order to debug a single test or a single test file it is currently necessary
127130
"request": "launch",
128131
"task": "test",
129132
"taskArgs": ["tests/some_test.exs:123"],
133+
"startApps": true,
130134
"projectDir": "${workspaceRoot}",
131135
"requireFiles": [
132136
"test/**/test_helper.exs",
@@ -135,6 +139,23 @@ In order to debug a single test or a single test file it is currently necessary
135139
}
136140
```
137141

142+
### Phoenix apps
143+
144+
Use the following launch config to debug phoenix apps
145+
146+
```
147+
{
148+
"type": "mix_task",
149+
"name": "phx.server",
150+
"request": "launch",
151+
"task": "phx.server",
152+
"projectDir": "${workspaceRoot}"
153+
}
154+
```
155+
156+
Please make sure that `startApps` is not set to `true` as it prevents phoenix from starting correctly. On the other hand phoenix tests expects that the apps are already started so in that case set it to `true`.
157+
158+
138159
Please note that due to `:int` limitation NIF modules cannot be interpreted and need to be excluded via `excludeModules` option. This option can be also used to disable interpreting for some modules when it is not desirable e.g. when performance is not satisfactory.
139160

140161
```

0 commit comments

Comments
 (0)