using Ardalis.GuardClauses; using Godot; using SharpIDE.Application.Features.Debugging; using SharpIDE.Application.Features.Events; using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence; namespace SharpIDE.Godot.Features.Debug_.Tab.SubTabs; public partial class ThreadsVariablesSubTab : Control { private PackedScene _threadListItemScene = GD.Load("res://Features/Debug_/Tab/SubTabs/ThreadListItem.tscn"); private VBoxContainer _threadsVboxContainer = null!; private VBoxContainer _stackFramesVboxContainer = null!; private VBoxContainer _variablesVboxContainer = null!; public SharpIdeProjectModel Project { get; set; } = null!; private ThreadModel? _selectedThread = null!; // null when not at a stop point public override void _Ready() { _threadsVboxContainer = GetNode("%ThreadsPanel/VBoxContainer"); _stackFramesVboxContainer = GetNode("%StackFramesPanel/VBoxContainer"); _variablesVboxContainer = GetNode("%VariablesPanel/VBoxContainer"); GlobalEvents.Instance.DebuggerExecutionStopped += OnDebuggerExecutionStopped; } private async Task OnDebuggerExecutionStopped(ExecutionStopInfo stopInfo) { var result = await Singletons.RunService.GetInfoAtStopPoint(); var threadScenes = result.Threads.Select(s => { var threadListItem = _threadListItemScene.Instantiate(); threadListItem.GetNode