Skip to content

Commit

Permalink
Debugger cancel (#976)
Browse files Browse the repository at this point in the history
* implement cancel and progress notification in debugger

add progress notification and cancel support
remove debugExpressionTimeoutMs setting
add unexpected error handling
do not return evaluation errors as success responses
make completions async and cancellable
make evaluate async and cancellable
raise on invalid arguments

* disable sendTelemetry

* make variables request async
  • Loading branch information
lukaszsamson committed Sep 2, 2023
1 parent ac4194e commit 8815767
Show file tree
Hide file tree
Showing 5 changed files with 492 additions and 155 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ Below is a list of configuration options supported by the ElixirLS Debugger. Con
<dt>stackTraceMode</dt><dd>Debugger stacktrace mode - Allowed values are `all`, `no_tail`, and `false`.</dd>
<dt>requireFiles</dt><dd>A list of additional files that should be required and interpreted - This is especially useful for debugging tests.</dd>
<dt>debugInterpretModulesPatterns</dt><dd>A list of globs specifying modules that should be interpreted</dd>
<dt>debugExpressionTimeoutMs</dt><dd>Expression evaluator timeout in milliseconds - This defaults to 10 000.</dd>
<dt>projectDir</dt><dd>An absolute path to the directory where `mix.exs` is located - In VSCode, `${workspaceRoot}` can be used.</dd>
<dt>excludeModules</dt><dd>A list of modules that should not be interpreted</dd>
</dl>
Expand Down
6 changes: 4 additions & 2 deletions apps/elixir_ls_debugger/lib/debugger/protocol.basic.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule ElixirLS.Debugger.Protocol.Basic do
@moduledoc """
Macros for VS Code debug protocol messages
These macros can be used for pattern matching or for creating messages corresponding to the
These macros can be used for pattern matching or for creating messages corresponding to the
request, response, and event types as specified in VS Code debug protocol.
"""

Expand Down Expand Up @@ -49,7 +49,9 @@ defmodule ElixirLS.Debugger.Protocol.Basic do
"error" => %{
"id" => unquote(seq),
"format" => unquote(format),
"variables" => unquote(variables)
"variables" => unquote(variables),
"showUser" => false,
"sendTelemetry" => false
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions apps/elixir_ls_debugger/lib/debugger/protocol.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ defmodule ElixirLS.Debugger.Protocol do
end
end

defmacro cancel_req(seq, args) do
quote do
request(unquote(seq), "cancel", unquote(args))
end
end

defmacro launch_req(seq, config) do
quote do
request(unquote(seq), "launch", unquote(config))
Expand Down
Loading

0 comments on commit 8815767

Please sign in to comment.