clear debug panel trees on debugger continue

This commit is contained in:
Matt Parker
2025-12-14 19:11:55 +10:00
parent c122af1e92
commit 5eac3ce445
3 changed files with 10 additions and 3 deletions

View File

@@ -27,10 +27,11 @@ public partial class ThreadsVariablesSubTab : Control
_stackFramesTree = GetNode<Tree>("%StackFramesTree");
_variablesTree = GetNode<Tree>("%VariablesTree");
GlobalEvents.Instance.DebuggerExecutionStopped.Subscribe(OnDebuggerExecutionStopped);
GlobalEvents.Instance.DebuggerExecutionContinued.Subscribe(ClearAllTrees);
_threadsTree.ItemSelected += OnThreadSelected;
_stackFramesTree.ItemSelected += OnStackFrameSelected;
_variablesTree.ItemCollapsed += OnVariablesItemExpandedOrCollapsed;
Project.ProjectStoppedRunning.Subscribe(ProjectStoppedRunning);
Project.ProjectStoppedRunning.Subscribe(ClearAllTrees);
}
private void OnVariablesItemExpandedOrCollapsed(TreeItem item)
@@ -64,10 +65,11 @@ public partial class ThreadsVariablesSubTab : Control
public override void _ExitTree()
{
GlobalEvents.Instance.DebuggerExecutionStopped.Unsubscribe(OnDebuggerExecutionStopped);
Project.ProjectStoppedRunning.Unsubscribe(ProjectStoppedRunning);
GlobalEvents.Instance.DebuggerExecutionContinued.Unsubscribe(ClearAllTrees);
Project.ProjectStoppedRunning.Unsubscribe(ClearAllTrees);
}
private async Task ProjectStoppedRunning()
private async Task ClearAllTrees()
{
await this.InvokeAsync(() =>
{