Forge
csharpdeeb25a2
1using CascadeIDE.Contracts;
2
3namespace CascadeIDE.Cockpit.ComputingUnits.IdeHealth;
4
5/// <summary>
6/// CCU «сводка отладки» (ADR 0097): вычисляет человекочитаемую часть debug-сегмента для project scope.
7/// </summary>
8[ComputingUnit]
9public sealed class IdeHealthDebugSummaryUnit : ICockpitComputeUnit
10{
11 /// <summary>Единственный экземпляр юнита (без состояния).</summary>
12 public static IdeHealthDebugSummaryUnit Default { get; } = new();
13
14 private IdeHealthDebugSummaryUnit()
15 {
16 }
17
18 public string Summarize(in Services.DebugSessionSnapshot snapshot)
19 {
20 if (!snapshot.HasActiveSession)
21 return "idle";
22
23 if (!snapshot.IsExecutionStopped)
24 return "running…";
25
26 var variableCount = snapshot.VariableRootScopes.Sum(scope => scope.Roots.Count);
27 return $"paused · frames {snapshot.StackFrames.Count}, vars {variableCount}";
28 }
29}
30
View only · write via MCP/CIDE