Explorar el Código

DAP: Cast request's `seq` value to int

Artemy Fedotov hace 2 meses
padre
commit
054934e486
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      editor/debugger/debug_adapter/debug_adapter_protocol.cpp

+ 5 - 0
editor/debugger/debug_adapter/debug_adapter_protocol.cpp

@@ -851,6 +851,11 @@ bool DebugAdapterProtocol::process_message(const String &p_text) {
 	Dictionary params = json.get_data();
 	Dictionary params = json.get_data();
 	bool completed = true;
 	bool completed = true;
 
 
+	// While JSON does not distinguish floats and ints, "seq" is an integer by specification. See https://github.com/godotengine/godot/issues/108288
+	if (params.has("seq")) {
+		params["seq"] = (int)params["seq"];
+	}
+
 	if (OS::get_singleton()->get_ticks_msec() - _current_peer->timestamp > _request_timeout) {
 	if (OS::get_singleton()->get_ticks_msec() - _current_peer->timestamp > _request_timeout) {
 		Dictionary response = parser->prepare_error_response(params, DAP::ErrorType::TIMEOUT);
 		Dictionary response = parser->prepare_error_response(params, DAP::ErrorType::TIMEOUT);
 		_current_peer->res_queue.push_front(response);
 		_current_peer->res_queue.push_front(response);