Skip to content

Commit a32ee0a

Browse files
committed
Fix error_response macro compile
1 parent adfc80a commit a32ee0a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

apps/debug_adapter/lib/debug_adapter/protocol.basic.ex

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ defmodule ElixirLS.DebugAdapter.Protocol.Basic do
5858
send_telemetry,
5959
show_user
6060
) do
61+
message_value = Macro.expand_once(message, __CALLER__)
62+
error_id =
63+
case message_value do
64+
value when is_binary(value) -> ErrorDictionary.code(value)
65+
_ -> quote(do: ErrorDictionary.code(unquote(message)))
66+
end
67+
6168
quote do
6269
%{
6370
"type" => "response",
@@ -68,7 +75,7 @@ defmodule ElixirLS.DebugAdapter.Protocol.Basic do
6875
"message" => unquote(message),
6976
"body" => %{
7077
"error" => %{
71-
"id" => ElixirLS.DebugAdapter.ErrorDictionary.code(unquote(message)),
78+
"id" => unquote(error_id),
7279
"format" => unquote(format),
7380
"variables" => unquote(variables),
7481
"showUser" => unquote(show_user),

0 commit comments

Comments
 (0)