fix debugging
This commit is contained in:
@@ -41,6 +41,7 @@ public class DebuggingService
|
||||
process.Start();
|
||||
|
||||
var debugProtocolHost = new DebugProtocolHost(process.StandardInput.BaseStream, process.StandardOutput.BaseStream, false);
|
||||
var initializedEventTcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
_debugProtocolHost = debugProtocolHost;
|
||||
debugProtocolHost.LogMessage += (sender, args) =>
|
||||
{
|
||||
@@ -62,6 +63,10 @@ public class DebuggingService
|
||||
{
|
||||
;
|
||||
});
|
||||
debugProtocolHost.RegisterEventType<InitializedEvent>(@event =>
|
||||
{
|
||||
initializedEventTcs.SetResult();
|
||||
});
|
||||
debugProtocolHost.RegisterEventType<ExitedEvent>(async void (@event) =>
|
||||
{
|
||||
await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding); // The VS Code Debug Protocol throws if you try to send a request from the dispatcher thread
|
||||
@@ -117,6 +122,8 @@ public class DebuggingService
|
||||
}
|
||||
};
|
||||
debugProtocolHost.SendRequestSync(attachRequest);
|
||||
// AttachRequest -> HandshakeRequest -> InitializedEvent
|
||||
await initializedEventTcs.Task;
|
||||
|
||||
foreach (var breakpoint in breakpointsByFile)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user