Skip to content

Commit 76f1e7f

Browse files
committed
removing unused properties of the class
1 parent e7c1e87 commit 76f1e7f

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

src/PowerShellEditorServices/Services/PowerShell/Refactoring/IterativeFunctionVistor.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ internal class IterativeFunctionRename
1515
internal Queue<Ast> queue = new();
1616
internal bool ShouldRename;
1717
public List<TextChange> Modifications = new();
18-
public List<string> Log = new();
1918
internal int StartLineNumber;
2019
internal int StartColumnNumber;
2120
internal FunctionDefinitionAst TargetFunctionAst;
@@ -143,9 +142,6 @@ public void Visit(Ast root)
143142

144143
public void ProcessNode(Ast node, bool shouldRename)
145144
{
146-
Log.Add($"Proc node: {node.GetType().Name}, " +
147-
$"SL: {node.Extent.StartLineNumber}, " +
148-
$"SC: {node.Extent.StartColumnNumber}");
149145

150146
switch (node)
151147
{
@@ -194,7 +190,6 @@ public void ProcessNode(Ast node, bool shouldRename)
194190
}
195191
break;
196192
}
197-
Log.Add($"ShouldRename after proc: {shouldRename}");
198193
}
199194
}
200195
}

src/PowerShellEditorServices/Services/PowerShell/Refactoring/IterativeVariableVisitor.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,16 @@ internal class IterativeVariableRename
1414
{
1515
private readonly string OldName;
1616
private readonly string NewName;
17-
internal Stack<Ast> ScopeStack = new();
1817
internal bool ShouldRename;
1918
public List<TextChange> Modifications = new();
2019
internal int StartLineNumber;
2120
internal int StartColumnNumber;
2221
internal VariableExpressionAst TargetVariableAst;
23-
internal VariableExpressionAst DuplicateVariableAst;
2422
internal List<string> dotSourcedScripts = new();
2523
internal readonly Ast ScriptAst;
2624
internal bool isParam;
2725
internal bool AliasSet;
2826
internal FunctionDefinitionAst TargetFunction;
29-
internal List<string> Log = new();
3027

3128
public IterativeVariableRename(string NewName, int StartLineNumber, int StartColumnNumber, Ast ScriptAst)
3229
{
@@ -255,9 +252,6 @@ public void Visit(Ast root)
255252

256253
public void ProcessNode(Ast node)
257254
{
258-
Log.Add($"Proc node: {node.GetType().Name}, " +
259-
$"SL: {node.Extent.StartLineNumber}, " +
260-
$"SC: {node.Extent.StartColumnNumber}");
261255

262256
switch (node)
263257
{
@@ -343,7 +337,6 @@ public void ProcessNode(Ast node)
343337
{
344338
if (!WithinTargetsScope(TargetVariableAst, variableExpressionAst))
345339
{
346-
DuplicateVariableAst = variableExpressionAst;
347340
ShouldRename = false;
348341
}
349342

@@ -377,15 +370,14 @@ public void ProcessNode(Ast node)
377370
}
378371
break;
379372
}
380-
Log.Add($"ShouldRename after proc: {ShouldRename}");
381373
}
382374

383375
internal void NewSplattedModification(Ast Splatted)
384376
{
385-
// This Function should be passed a Splatted VariableExpressionAst which
377+
// This Function should be passed a splatted VariableExpressionAst which
386378
// is used by a CommandAst that is the TargetFunction.
387379

388-
// Find the Splats Top Assignment / Definition
380+
// Find the splats top assignment / definition
389381
Ast SplatAssignment = GetVariableTopAssignment(
390382
Splatted.Extent.StartLineNumber,
391383
Splatted.Extent.StartColumnNumber,
@@ -421,8 +413,8 @@ internal TextChange NewParameterAliasChange(VariableExpressionAst variableExpres
421413
{
422414
// Check if an Alias AttributeAst already exists and append the new Alias to the existing list
423415
// Otherwise Create a new Alias Attribute
424-
// Add the modidifcations to the changes
425-
// the Attribute will be appended before the variable or in the existing location of the Original Alias
416+
// Add the modifications to the changes
417+
// The Attribute will be appended before the variable or in the existing location of the original alias
426418
TextChange aliasChange = new();
427419
foreach (Ast Attr in paramAst.Attributes)
428420
{

0 commit comments

Comments
 (0)