Closed GniLudio closed 8 months ago
But the protocol specifies that source must be of type Source. (and not string)
https://microsoft.github.io/debug-adapter-protocol/specification#arrow_left-output-event
category?: 'console' | 'important' | 'stdout' | 'stderr' | 'telemetry' | string;
as you could see, by protocol, category
could be not specified, could be one of "fixed" array string (console
, important
, stdout
, stderr
or telemetry
) or some custom string.
I am not sure you could provide as part of text protocol message something not "string" but c# object (binary?) data...
Ahh, I see you point.
/**
* The source location where the output was produced.
*/
source?: Source;
Probably, should be removed from event for now at all in order to prevent wrong parsing. Will also add this in feature request list.
Thanks.
How long is it likely to take for this to be resolved?
Here is "fast fix", that will remove source:
diff --git a/src/protocols/vscodeprotocol.cpp b/src/protocols/vscodeprotocol.cpp
index 5e6d6d9..2b32e06 100644
--- a/src/protocols/vscodeprotocol.cpp
+++ b/src/protocols/vscodeprotocol.cpp
@@ -332,7 +332,7 @@ void VSCodeProtocol::EmitOutputEvent(OutputCategory category, string_view output
const string_view& name = categories[category];
EscapedString<JSON_escape_rules> escaped_text(output);
- EscapedString<JSON_escape_rules> escaped_source(source);
+ EscapedString<JSON_escape_rules> escaped_source(string_view{});
std::lock_guard<std::mutex> lock(m_outMutex);
will emit:
<- (E) {"seq":21, "event":"output","type":"event","body":{"category":"stdout","output":"Hello, World!\n"}}
Hello, World!
Upd patch for better fix
This should be fixed in latest release. Feel free to reopen if you see any more related issues.
When I try to launch the following program using the debug adapter protocol it sends an
OutputEvent
with"source":"category"
. HelloCS1.zipBut the protocol specifies that
source
must be of typeSource
. (and notstring
) Output Event SpecificationEvent Message
log.txt (
--engineLogging
)Manual Logs