private void DebugService_BreakpointUpdated(object sender, BreakpointUpdatedEventArgs e) { string reason = "changed"; if (_debugStateService.IsSetBreakpointInProgress) { // Don't send breakpoint update notifications when setting // breakpoints on behalf of the client. return; } switch (e.UpdateType) { case BreakpointUpdateType.Set: reason = "new"; break; case BreakpointUpdateType.Removed: reason = "removed"; break; } var breakpoint = new OmniSharp.Extensions.DebugAdapter.Protocol.Models.Breakpoint { Verified = e.UpdateType != BreakpointUpdateType.Disabled }; if (e.Breakpoint is LineBreakpoint) { breakpoint = LspDebugUtils.CreateBreakpoint(BreakpointDetails.Create(e.Breakpoint)); } else if (e.Breakpoint is CommandBreakpoint) { _logger.LogTrace("Function breakpoint updated event is not supported yet"); return; } else { _logger.LogError($"Unrecognized breakpoint type {e.Breakpoint.GetType().FullName}"); return; } _debugAdapterServer.SendNotification(EventNames.Breakpoint, new BreakpointEvent { Reason = reason, Breakpoint = breakpoint }); }
private void OnBreakpointUpdated(object sender, BreakpointUpdatedEventArgs e) { // Don't send breakpoint update notifications when setting // breakpoints on behalf of the client. if (_debugStateService.IsSetBreakpointInProgress) { return; } if (e.Breakpoint is LineBreakpoint) { OmniSharp.Extensions.DebugAdapter.Protocol.Models.Breakpoint breakpoint = LspDebugUtils.CreateBreakpoint( BreakpointDetails.Create(e.Breakpoint, e.UpdateType) ); string reason = e.UpdateType switch { BreakpointUpdateType.Set => BreakpointEventReason.New, BreakpointUpdateType.Removed => BreakpointEventReason.Removed, BreakpointUpdateType.Enabled => BreakpointEventReason.Changed, BreakpointUpdateType.Disabled => BreakpointEventReason.Changed, _ => "InvalidBreakpointUpdateTypeEnum" }; _debugAdapterServer.SendNotification( EventNames.Breakpoint, new BreakpointEvent { Breakpoint = breakpoint, Reason = reason } ); } else if (e.Breakpoint is CommandBreakpoint) { _logger.LogTrace("Function breakpoint updated event is not supported yet"); } else { _logger.LogError($"Unrecognized breakpoint type {e.Breakpoint.GetType().FullName}"); } }