diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/Variable.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/Variable.cs index c029e1ce8..cf944b506 100644 --- a/src/PowerShellEditorServices.Protocol/DebugAdapter/Variable.cs +++ b/src/PowerShellEditorServices.Protocol/DebugAdapter/Variable.cs @@ -12,6 +12,11 @@ public class Variable // /** The variable's value. For structured objects this can be a multi line text, e.g. for a function the body of a function. */ public string Value { get; set; } + /// + /// Gets or sets the evaluatable name for the variable that will be evaluated by the debugger. + /// + public string EvaluateName { get; set; } + // /** If variablesReference is > 0, the variable is structured and its children can be retrieved by passing variablesReference to the VariablesRequest. */ public int VariablesReference { get; set; } @@ -21,6 +26,7 @@ public static Variable Create(VariableDetailsBase variable) { Name = variable.Name, Value = variable.ValueString ?? string.Empty, + EvaluateName = variable.Name, VariablesReference = variable.IsExpandable ? variable.Id : 0 diff --git a/src/PowerShellEditorServices/Debugging/DebugService.cs b/src/PowerShellEditorServices/Debugging/DebugService.cs index 0953e239c..ffd3f9f5e 100644 --- a/src/PowerShellEditorServices/Debugging/DebugService.cs +++ b/src/PowerShellEditorServices/Debugging/DebugService.cs @@ -603,7 +603,7 @@ await this.powerShellContext.ExecuteScriptString( // of command executions into string output. However, if null is returned // then return null so that no output gets displayed. string outputString = - results != null ? + results != null && results.Any() ? string.Join(Environment.NewLine, results) : null;