@@ -396,6 +396,7 @@ function generateSessionEventsCode(schema: JSONSchema7): string {
396396// Generated code does not have XML doc comments; suppress CS1591 to avoid warnings.
397397#pragma warning disable CS1591
398398
399+ using System.Diagnostics;
399400using System.Text.Json;
400401using System.Text.Json.Serialization;
401402
@@ -406,6 +407,7 @@ namespace GitHub.Copilot.SDK;
406407 lines . push ( `/// <summary>` ) ;
407408 lines . push ( `/// Base class for all session events with polymorphic JSON serialization.` ) ;
408409 lines . push ( `/// </summary>` ) ;
410+ lines . push ( `[DebuggerDisplay("{DebuggerDisplay,nq}")]` ) ;
409411 lines . push ( `[JsonPolymorphic(` , ` TypeDiscriminatorPropertyName = "type",` , ` UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FailSerialization)]` ) ;
410412 for ( const variant of [ ...variants ] . sort ( ( a , b ) => a . typeName . localeCompare ( b . typeName ) ) ) {
411413 lines . push ( `[JsonDerivedType(typeof(${ variant . className } ), "${ variant . typeName } ")]` ) ;
@@ -417,7 +419,8 @@ namespace GitHub.Copilot.SDK;
417419 lines . push ( ` /// <summary>` , ` /// The event type discriminator.` , ` /// </summary>` ) ;
418420 lines . push ( ` [JsonIgnore]` , ` public abstract string Type { get; }` , "" ) ;
419421 lines . push ( ` public static SessionEvent FromJson(string json) =>` , ` JsonSerializer.Deserialize(json, SessionEventsJsonContext.Default.SessionEvent)!;` , "" ) ;
420- lines . push ( ` public string ToJson() =>` , ` JsonSerializer.Serialize(this, SessionEventsJsonContext.Default.SessionEvent);` , `}` , "" ) ;
422+ lines . push ( ` public string ToJson() =>` , ` JsonSerializer.Serialize(this, SessionEventsJsonContext.Default.SessionEvent);` , "" ) ;
423+ lines . push ( ` [DebuggerBrowsable(DebuggerBrowsableState.Never)]` , ` private string DebuggerDisplay => ToJson();` , `}` , "" ) ;
421424
422425 // Event classes with XML docs
423426 for ( const variant of variants ) {
0 commit comments