Skip to content

Commit 0bd5490

Browse files
committed
Remove unused scope argument from AddToAutoVariables
1 parent 26f978c commit 0bd5490

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/PowerShellEditorServices/Services/DebugAdapter/DebugService.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -700,17 +700,9 @@ private async Task<VariableContainerDetails> FetchVariableContainerAsync(string
700700
return scopeVariableContainer;
701701
}
702702

703-
private bool AddToAutoVariables(PSObject psvariable, string scope)
703+
// TODO: This function needs explanation, thought, and improvement.
704+
private bool AddToAutoVariables(PSObject psvariable)
704705
{
705-
if ((scope == VariableContainerDetails.GlobalScopeName)
706-
|| (scope == VariableContainerDetails.ScriptScopeName))
707-
{
708-
// We don't A) have a good way of distinguishing built-in from user created variables
709-
// and B) globalScopeVariables.Children.ContainsKey() doesn't work for built-in variables
710-
// stored in a child variable container within the globals variable container.
711-
return false;
712-
}
713-
714706
string variableName = psvariable.Properties["Name"].Value as string;
715707
object variableValue = psvariable.Properties["Value"].Value;
716708

@@ -831,7 +823,7 @@ private async Task FetchStackFramesAsync(string scriptNameOverride)
831823
var variableDetails = new VariableDetails(psVarName, psVarValue) { Id = nextVariableId++ };
832824
variables.Add(variableDetails);
833825

834-
if (AddToAutoVariables(new PSObject(entry.Value), scope: null))
826+
if (AddToAutoVariables(new PSObject(entry.Value)))
835827
{
836828
autoVariables.Children.Add(variableDetails.Name, variableDetails);
837829
}

0 commit comments

Comments
 (0)