@@ -25,7 +25,7 @@ namespace Microsoft.PowerShell.EditorServices.Services;
25
25
public class RenameServiceOptions
26
26
{
27
27
public bool createFunctionAlias { get ; set ; }
28
- public bool createVariableAlias { get ; set ; }
28
+ public bool createParameterAlias { get ; set ; }
29
29
public bool acceptDisclaimer { get ; set ; }
30
30
}
31
31
@@ -99,7 +99,7 @@ or CommandAst
99
99
or ParameterAst
100
100
or CommandParameterAst
101
101
or AssignmentStatementAst
102
- => RenameVariable ( tokenToRename , scriptFile . ScriptAst , request , options . createVariableAlias ) ,
102
+ => RenameVariable ( tokenToRename , scriptFile . ScriptAst , request , options . createParameterAlias ) ,
103
103
104
104
_ => throw new InvalidOperationException ( "This should not happen as PrepareRename should have already checked for viability. File an issue if you see this." )
105
105
} ;
@@ -126,7 +126,7 @@ internal static TextEdit[] RenameFunction(Ast target, Ast scriptAst, RenameParam
126
126
return visitor . VisitAndGetEdits ( scriptAst ) ;
127
127
}
128
128
129
- internal static TextEdit [ ] RenameVariable ( Ast symbol , Ast scriptAst , RenameParams requestParams , bool createAlias )
129
+ internal static TextEdit [ ] RenameVariable ( Ast symbol , Ast scriptAst , RenameParams requestParams , bool createParameterAlias )
130
130
{
131
131
if ( symbol is not ( VariableExpressionAst or ParameterAst or CommandParameterAst or StringConstantExpressionAst ) )
132
132
{
@@ -138,7 +138,7 @@ internal static TextEdit[] RenameVariable(Ast symbol, Ast scriptAst, RenameParam
138
138
symbol . Extent . StartLineNumber ,
139
139
symbol . Extent . StartColumnNumber ,
140
140
scriptAst ,
141
- createAlias
141
+ createParameterAlias
142
142
) ;
143
143
return visitor . VisitAndGetEdits ( ) ;
144
144
@@ -418,15 +418,15 @@ internal class RenameVariableVisitor : RenameVisitorBase
418
418
internal bool isParam ;
419
419
internal bool AliasSet ;
420
420
internal FunctionDefinitionAst TargetFunction ;
421
- internal bool CreateAlias ;
421
+ internal bool CreateParameterAlias ;
422
422
423
- public RenameVariableVisitor ( string NewName , int StartLineNumber , int StartColumnNumber , Ast ScriptAst , bool CreateAlias )
423
+ public RenameVariableVisitor ( string NewName , int StartLineNumber , int StartColumnNumber , Ast ScriptAst , bool CreateParameterAlias )
424
424
{
425
425
this . NewName = NewName ;
426
426
this . StartLineNumber = StartLineNumber ;
427
427
this . StartColumnNumber = StartColumnNumber ;
428
428
this . ScriptAst = ScriptAst ;
429
- this . CreateAlias = CreateAlias ;
429
+ this . CreateParameterAlias = CreateParameterAlias ;
430
430
431
431
VariableExpressionAst Node = ( VariableExpressionAst ) GetVariableTopAssignment ( StartLineNumber , StartColumnNumber , ScriptAst ) ;
432
432
if ( Node != null )
@@ -800,7 +800,7 @@ private void ProcessVariableExpressionAst(VariableExpressionAst variableExpressi
800
800
} ;
801
801
// If the variables parent is a parameterAst Add a modification
802
802
if ( variableExpressionAst . Parent is ParameterAst paramAst && ! AliasSet &&
803
- CreateAlias )
803
+ CreateParameterAlias )
804
804
{
805
805
TextEdit aliasChange = NewParameterAliasChange ( variableExpressionAst , paramAst ) ;
806
806
Edits . Add ( aliasChange ) ;
0 commit comments