@@ -43,7 +43,7 @@ public IterativeVariableRename(string NewName, int StartLineNumber, int StartCol
4343 isParam = true ;
4444 Ast parent = Node ;
4545 // 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 ) ) ;
4747 if ( parent != null )
4848 {
4949 TargetFunction = ( FunctionDefinitionAst ) parent ;
@@ -60,7 +60,7 @@ public static Ast GetVariableTopAssignment(int StartLineNumber, int StartColumnN
6060 {
6161
6262 // Look up the target object
63- Ast node = Utilities . GetAstNodeByLineAndColumn ( StartLineNumber , StartColumnNumber ,
63+ Ast node = Utilities . GetAstAtPositionOfType ( StartLineNumber , StartColumnNumber ,
6464 ScriptAst , typeof ( VariableExpressionAst ) , typeof ( CommandParameterAst ) , typeof ( StringConstantExpressionAst ) ) ;
6565
6666 string name = node switch
@@ -77,7 +77,7 @@ public static Ast GetVariableTopAssignment(int StartLineNumber, int StartColumnN
7777 if ( node is StringConstantExpressionAst )
7878 {
7979 Ast parent = node ;
80- parent = Utilities . LookForParentOfType ( parent , typeof ( AssignmentStatementAst ) ) ;
80+ parent = Utilities . GetAstParentOfType ( parent , typeof ( AssignmentStatementAst ) ) ;
8181 if ( parent is not null and AssignmentStatementAst assignmentStatementAst )
8282 {
8383 splatAssignment = ( VariableExpressionAst ) assignmentStatementAst . Left . Find (
@@ -181,7 +181,7 @@ internal static Ast GetAstParentScope(Ast node)
181181 {
182182 Ast parent = node ;
183183 // 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 ) ) ;
185185 if ( parent is ScriptBlockAst && parent . Parent != null && parent . Parent is FunctionDefinitionAst )
186186 {
187187 parent = parent . Parent ;
0 commit comments