@@ -43,7 +43,7 @@ public IterativeVariableRename(string NewName, int StartLineNumber, int StartCol
43
43
isParam = true ;
44
44
Ast parent = Node ;
45
45
// Look for a target function that the parameterAst will be within if it exists
46
- parent = Utilities . LookForParentOfType ( parent , typeof ( FunctionDefinitionAst ) ) ;
46
+ parent = Utilities . GetAstParentOfType ( parent , typeof ( FunctionDefinitionAst ) ) ;
47
47
if ( parent != null )
48
48
{
49
49
TargetFunction = ( FunctionDefinitionAst ) parent ;
@@ -60,7 +60,7 @@ public static Ast GetVariableTopAssignment(int StartLineNumber, int StartColumnN
60
60
{
61
61
62
62
// Look up the target object
63
- Ast node = Utilities . GetAstNodeByLineAndColumn ( StartLineNumber , StartColumnNumber ,
63
+ Ast node = Utilities . GetAstAtPositionOfType ( StartLineNumber , StartColumnNumber ,
64
64
ScriptAst , typeof ( VariableExpressionAst ) , typeof ( CommandParameterAst ) , typeof ( StringConstantExpressionAst ) ) ;
65
65
66
66
string name = node switch
@@ -77,7 +77,7 @@ public static Ast GetVariableTopAssignment(int StartLineNumber, int StartColumnN
77
77
if ( node is StringConstantExpressionAst )
78
78
{
79
79
Ast parent = node ;
80
- parent = Utilities . LookForParentOfType ( parent , typeof ( AssignmentStatementAst ) ) ;
80
+ parent = Utilities . GetAstParentOfType ( parent , typeof ( AssignmentStatementAst ) ) ;
81
81
if ( parent is not null and AssignmentStatementAst assignmentStatementAst )
82
82
{
83
83
splatAssignment = ( VariableExpressionAst ) assignmentStatementAst . Left . Find (
@@ -181,7 +181,7 @@ internal static Ast GetAstParentScope(Ast node)
181
181
{
182
182
Ast parent = node ;
183
183
// Walk backwards up the tree looking for a ScriptBLock of a FunctionDefinition
184
- parent = Utilities . LookForParentOfType ( parent , typeof ( ScriptBlockAst ) , typeof ( FunctionDefinitionAst ) ) ;
184
+ parent = Utilities . GetAstParentOfType ( parent , typeof ( ScriptBlockAst ) , typeof ( FunctionDefinitionAst ) ) ;
185
185
if ( parent is ScriptBlockAst && parent . Parent != null && parent . Parent is FunctionDefinitionAst )
186
186
{
187
187
parent = parent . Parent ;
0 commit comments