From 5b1ea76dcdd7ce907928b5cc578279a08ca30d4b Mon Sep 17 00:00:00 2001 From: Matt Parker <61717342+MattParkerDev@users.noreply.github.com> Date: Sat, 30 Aug 2025 13:05:30 +1000 Subject: [PATCH] display variables --- .../Features/Debugging/DebuggingService.cs | 4 +++- .../Debug_/Tab/SubTabs/ThreadsVariablesSubTab.cs | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/SharpIDE.Application/Features/Debugging/DebuggingService.cs b/src/SharpIDE.Application/Features/Debugging/DebuggingService.cs index 28c6632..66699d1 100644 --- a/src/SharpIDE.Application/Features/Debugging/DebuggingService.cs +++ b/src/SharpIDE.Application/Features/Debugging/DebuggingService.cs @@ -151,14 +151,16 @@ public class DebuggingService var stackTrace = _debugProtocolHost.SendRequestSync(new StackTraceRequest { ThreadId = thread.Id }); var frame = stackTrace.StackFrames!.FirstOrDefault(); if (frame == null) continue; - // Infrastructure.dll!Infrastructure.DependencyInjection.AddInfrastructure(Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.Configuration.IConfiguration configuration) Line 23 var name = frame.Name; if (name == "[External Code]") continue; // TODO: handle this case + + // Infrastructure.dll!Infrastructure.DependencyInjection.AddInfrastructure(Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.Configuration.IConfiguration configuration) Line 23 // need to parse out the class name, method name, namespace, assembly name var methodName = name.Split('!')[1].Split('(')[0]; var className = methodName.Split('.').Reverse().Skip(1).First(); var namespaceName = string.Join('.', methodName.Split('.').Reverse().Skip(2).Reverse()); var assemblyName = name.Split('!')[0]; + methodName = methodName.Split('.').Reverse().First(); var frameModel = new StackFrameModel { Id = frame.Id, diff --git a/src/SharpIDE.Godot/Features/Debug_/Tab/SubTabs/ThreadsVariablesSubTab.cs b/src/SharpIDE.Godot/Features/Debug_/Tab/SubTabs/ThreadsVariablesSubTab.cs index a9bdfcb..ae60f45 100644 --- a/src/SharpIDE.Godot/Features/Debug_/Tab/SubTabs/ThreadsVariablesSubTab.cs +++ b/src/SharpIDE.Godot/Features/Debug_/Tab/SubTabs/ThreadsVariablesSubTab.cs @@ -58,5 +58,20 @@ public partial class ThreadsVariablesSubTab : Control } }); + var currentFrame = stoppedThread.StackFrames.First(); + var variableScenes = currentFrame.Scopes.SelectMany(s => s.Variables).Select(v => + { + var variableListItem = _threadListItemScene.Instantiate(); + variableListItem.GetNode