@@ -428,6 +428,7 @@ function generateSessionEventsCode(schema: JSONSchema7): string {
428428// Generated code does not have XML doc comments; suppress CS1591 to avoid warnings.
429429#pragma warning disable CS1591
430430
431+ using System.Diagnostics;
431432using System.Text.Json;
432433using System.Text.Json.Serialization;
433434
@@ -438,6 +439,7 @@ namespace GitHub.Copilot.SDK;
438439 lines . push ( `/// <summary>` ) ;
439440 lines . push ( `/// Base class for all session events with polymorphic JSON serialization.` ) ;
440441 lines . push ( `/// </summary>` ) ;
442+ lines . push ( `[DebuggerDisplay("{DebuggerDisplay,nq}")]` ) ;
441443 lines . push ( `[JsonPolymorphic(` , ` TypeDiscriminatorPropertyName = "type",` , ` UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FailSerialization)]` ) ;
442444 for ( const variant of [ ...variants ] . sort ( ( a , b ) => a . typeName . localeCompare ( b . typeName ) ) ) {
443445 lines . push ( `[JsonDerivedType(typeof(${ variant . className } ), "${ variant . typeName } ")]` ) ;
@@ -449,7 +451,8 @@ namespace GitHub.Copilot.SDK;
449451 lines . push ( ` /// <summary>` , ` /// The event type discriminator.` , ` /// </summary>` ) ;
450452 lines . push ( ` [JsonIgnore]` , ` public abstract string Type { get; }` , "" ) ;
451453 lines . push ( ` public static SessionEvent FromJson(string json) =>` , ` JsonSerializer.Deserialize(json, SessionEventsJsonContext.Default.SessionEvent)!;` , "" ) ;
452- lines . push ( ` public string ToJson() =>` , ` JsonSerializer.Serialize(this, SessionEventsJsonContext.Default.SessionEvent);` , `}` , "" ) ;
454+ lines . push ( ` public string ToJson() =>` , ` JsonSerializer.Serialize(this, SessionEventsJsonContext.Default.SessionEvent);` , "" ) ;
455+ lines . push ( ` [DebuggerBrowsable(DebuggerBrowsableState.Never)]` , ` private string DebuggerDisplay => ToJson();` , `}` , "" ) ;
453456
454457 // Event classes with XML docs
455458 for ( const variant of variants ) {
0 commit comments