Skip to content

Commit 44b530c

Browse files
committed
Add config option controlling wether to break on Kernel.dbg/3
1 parent 2be5d6c commit 44b530c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ Below is a list of configuration options supported by the ElixirLS Debugger. Con
337337
<dt>projectDir</dt><dd>An absolute path to the directory where `mix.exs` is located - In VSCode, `${workspaceRoot}` can be used.</dd>
338338
<dt>excludeModules</dt><dd>A list of modules that should not be interpreted</dd>
339339
<dt>exitAfterTaskReturns</dt><dd>Should the debug session stop when mix task returns. Tasks that return early while the code continues running asynchronously require `false` setting. Defaults to `true`.</dd>
340+
<dt>breakOnDbg</dt><dd>Should the debugger break on Kernel.dbg/2 macro. Defaults to `true`.</dd>
340341
</dl>
341342

342343
## Troubleshooting

apps/elixir_ls_debugger/lib/debugger/server.ex

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,15 @@ defmodule ElixirLS.Debugger.Server do
192192
{:reply, {:ok, false}, state}
193193
end
194194

195+
def handle_call(
196+
{:dbg, _binding, %Macro.Env{}, _stacktrace},
197+
_from,
198+
state = %__MODULE__{config: %{"breakOnDbg" => false}}
199+
) do
200+
# auto continue
201+
{:reply, {:ok, false}, state}
202+
end
203+
195204
def handle_call({:dbg, binding, %Macro.Env{} = env, stacktrace}, from, state = %__MODULE__{}) do
196205
{pid, _ref} = from
197206
ref = Process.monitor(pid)

0 commit comments

Comments
 (0)