View Source edb_dap_server (edb v0.4.0)
Handling of DAP requests, responses and events
For details see https://microsoft.github.io/debug-adapter-protocol/specification
Summary
Types
-type action() :: {event, edb_dap_event:event()} | {reverse_request, edb_dap_reverse_request:request()} | terminate.
-type cast_request() :: {handle_message, edb_dap:request() | edb_dap:response()} | {handle_response, edb_dap:response()} | terminate.
-type client_info() :: edb_dap_request_initialize:arguments().
-type error() :: {method_not_found, edb_dap:command()} | {invalid_params, Reason :: binary()} | {user_error, Id :: integer(), Msg :: iodata()} | {internal_error, #{class := error | exit | throw, reason := term(), stacktrace := erlang:stacktrace()}}.
-type state() :: #{state := started} | #{state := initialized, client_info := client_info()} | #{state := launching, client_info := client_info(), shell_process_id => number(), notification_ref := reference(), cwd := binary()} | #{state := configuring, type := attach_type(), client_info := client_info(), node := node(), cwd := binary()} | #{state := attached, type := attach_type(), client_info := client_info(), node := node(), cwd := binary(), subscription := edb:event_subscription()} | #{state := terminating}.
Functions
-spec handle_cast(cast_request(), state()) -> {noreply, state()} | {stop, normal, state()}.
-spec handle_info(Event, state()) -> {noreply, state()} when Event :: {reference(), edb_dap_internal_events:reverse_attach_result()} | edb:event_envelope(edb:event()).
-spec handle_message(Message) -> ok when Message :: edb_dap:request() | edb_dap:response().
-spec init(noargs) -> {ok, state()}.
-spec start_link() -> {ok, pid()}.