@@ -7,7 +7,7 @@ namespace BlocklyNet.Scripting.Debugger;
77/// <summary>
88/// Describes the current debug context.
99/// </summary>
10- public class ScriptDebugContext ( string scriptId , Block block , ScriptDebuggerStopReason reason , Context context ) : IScriptPosition
10+ public class ScriptDebugContext ( string scriptId , Block block , ScriptDebuggerStopReason reason , Context context , ScriptDebugger debugger ) : IScriptPosition
1111{
1212 /// <summary>
1313 /// Current position.
@@ -42,7 +42,7 @@ public List<ScriptDebugVariableScope> GetVariables()
4242 {
4343 List < ScriptDebugVariableScope > list = [ ] ;
4444
45- list . AddRange ( GetVariables ( Context ) ) ;
45+ list . AddRange ( GetVariables ( Context , debugger ) ) ;
4646
4747 return list ;
4848 }
@@ -51,8 +51,9 @@ public List<ScriptDebugVariableScope> GetVariables()
5151 /// Get variables of a context.
5252 /// </summary>
5353 /// <param name="context">Context to inspect.</param>
54+ /// <param name="debugger">Corresponding script debugger.</param>
5455 /// <returns>List of variables.</returns>
55- private static List < ScriptDebugVariableScope > GetVariables ( Context context )
56+ private static List < ScriptDebugVariableScope > GetVariables ( Context context , ScriptDebugger debugger )
5657 {
5758 List < ScriptDebugVariableScope > list = [ ] ;
5859
@@ -61,6 +62,7 @@ private static List<ScriptDebugVariableScope> GetVariables(Context context)
6162 list . Add ( new ( )
6263 {
6364 Context = current ,
65+ Debugger = debugger ,
6466 Procedure = current is ProcedureContext procedure ? procedure . Name : null ,
6567 ScriptId = script . Request . ScriptId ,
6668 Variables = [
0 commit comments