fix debugging
This commit is contained in:
@@ -41,6 +41,7 @@ public class DebuggingService
|
|||||||
process.Start();
|
process.Start();
|
||||||
|
|
||||||
var debugProtocolHost = new DebugProtocolHost(process.StandardInput.BaseStream, process.StandardOutput.BaseStream, false);
|
var debugProtocolHost = new DebugProtocolHost(process.StandardInput.BaseStream, process.StandardOutput.BaseStream, false);
|
||||||
|
var initializedEventTcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||||
_debugProtocolHost = debugProtocolHost;
|
_debugProtocolHost = debugProtocolHost;
|
||||||
debugProtocolHost.LogMessage += (sender, args) =>
|
debugProtocolHost.LogMessage += (sender, args) =>
|
||||||
{
|
{
|
||||||
@@ -62,6 +63,10 @@ public class DebuggingService
|
|||||||
{
|
{
|
||||||
;
|
;
|
||||||
});
|
});
|
||||||
|
debugProtocolHost.RegisterEventType<InitializedEvent>(@event =>
|
||||||
|
{
|
||||||
|
initializedEventTcs.SetResult();
|
||||||
|
});
|
||||||
debugProtocolHost.RegisterEventType<ExitedEvent>(async void (@event) =>
|
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
|
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);
|
debugProtocolHost.SendRequestSync(attachRequest);
|
||||||
|
// AttachRequest -> HandshakeRequest -> InitializedEvent
|
||||||
|
await initializedEventTcs.Task;
|
||||||
|
|
||||||
foreach (var breakpoint in breakpointsByFile)
|
foreach (var breakpoint in breakpointsByFile)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user