mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Merge pull request #89475 from rsubtil/feature-add_message_type_to_dap
Add output type to DAP `output` events
This commit is contained in:
@@ -601,12 +601,12 @@ Dictionary DebugAdapterParser::ev_continued() const {
|
||||
return event;
|
||||
}
|
||||
|
||||
Dictionary DebugAdapterParser::ev_output(const String &p_message) const {
|
||||
Dictionary DebugAdapterParser::ev_output(const String &p_message, RemoteDebugger::MessageType p_type) const {
|
||||
Dictionary event = prepare_base_event(), body;
|
||||
event["event"] = "output";
|
||||
event["body"] = body;
|
||||
|
||||
body["category"] = "stdout";
|
||||
body["category"] = (p_type == RemoteDebugger::MessageType::MESSAGE_TYPE_ERROR) ? "stderr" : "stdout";
|
||||
body["output"] = p_message + "\r\n";
|
||||
|
||||
return event;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#define DEBUG_ADAPTER_PARSER_H
|
||||
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/debugger/remote_debugger.h"
|
||||
#include "debug_adapter_protocol.h"
|
||||
#include "debug_adapter_types.h"
|
||||
|
||||
@@ -98,7 +99,7 @@ public:
|
||||
Dictionary ev_stopped_breakpoint(const int &p_id) const;
|
||||
Dictionary ev_stopped_step() const;
|
||||
Dictionary ev_continued() const;
|
||||
Dictionary ev_output(const String &p_message) const;
|
||||
Dictionary ev_output(const String &p_message, RemoteDebugger::MessageType p_type) const;
|
||||
Dictionary ev_custom_data(const String &p_msg, const Array &p_data) const;
|
||||
Dictionary ev_breakpoint(const DAP::Breakpoint &p_breakpoint, const bool &p_enabled) const;
|
||||
};
|
||||
|
||||
@@ -763,8 +763,8 @@ void DebugAdapterProtocol::notify_continued() {
|
||||
reset_stack_info();
|
||||
}
|
||||
|
||||
void DebugAdapterProtocol::notify_output(const String &p_message) {
|
||||
Dictionary event = parser->ev_output(p_message);
|
||||
void DebugAdapterProtocol::notify_output(const String &p_message, RemoteDebugger::MessageType p_type) {
|
||||
Dictionary event = parser->ev_output(p_message, p_type);
|
||||
for (List<Ref<DAPeer>>::Element *E = clients.front(); E; E = E->next()) {
|
||||
E->get()->res_queue.push_back(event);
|
||||
}
|
||||
@@ -828,8 +828,8 @@ void DebugAdapterProtocol::on_debug_stopped() {
|
||||
notify_terminated();
|
||||
}
|
||||
|
||||
void DebugAdapterProtocol::on_debug_output(const String &p_message) {
|
||||
notify_output(p_message);
|
||||
void DebugAdapterProtocol::on_debug_output(const String &p_message, int p_type) {
|
||||
notify_output(p_message, RemoteDebugger::MessageType(p_type));
|
||||
}
|
||||
|
||||
void DebugAdapterProtocol::on_debug_breaked(const bool &p_reallydid, const bool &p_can_debug, const String &p_reason, const bool &p_has_stackdump) {
|
||||
|
||||
@@ -86,7 +86,7 @@ private:
|
||||
void on_client_disconnected(const Ref<DAPeer> &p_peer);
|
||||
void on_debug_paused();
|
||||
void on_debug_stopped();
|
||||
void on_debug_output(const String &p_message);
|
||||
void on_debug_output(const String &p_message, int p_type);
|
||||
void on_debug_breaked(const bool &p_reallydid, const bool &p_can_debug, const String &p_reason, const bool &p_has_stackdump);
|
||||
void on_debug_breakpoint_toggled(const String &p_path, const int &p_line, const bool &p_enabled);
|
||||
void on_debug_stack_dump(const Array &p_stack_dump);
|
||||
@@ -139,7 +139,7 @@ public:
|
||||
void notify_stopped_breakpoint(const int &p_id);
|
||||
void notify_stopped_step();
|
||||
void notify_continued();
|
||||
void notify_output(const String &p_message);
|
||||
void notify_output(const String &p_message, RemoteDebugger::MessageType p_type);
|
||||
void notify_custom_data(const String &p_msg, const Array &p_data);
|
||||
void notify_breakpoint(const DAP::Breakpoint &p_breakpoint, const bool &p_enabled);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user