@@ -19,7 +19,7 @@ internal class FindReferencesVisitor : AstVisitor
19
19
private Dictionary < String , String > AliasToCmdletDictionary ;
20
20
private string symbolRefCommandName ;
21
21
private bool needsAliases ;
22
-
22
+
23
23
public List < SymbolReference > FoundReferences { get ; set ; }
24
24
25
25
/// <summary>
@@ -39,7 +39,7 @@ public FindReferencesVisitor(
39
39
this . CmdletToAliasDictionary = CmdletToAliasDictionary ;
40
40
this . AliasToCmdletDictionary = AliasToCmdletDictionary ;
41
41
42
- // Try to get the symbolReference's command name of an alias,
42
+ // Try to get the symbolReference's command name of an alias,
43
43
// if a command name does not exists (if the symbol isn't an alias to a command)
44
44
// set symbolRefCommandName to and empty string value
45
45
AliasToCmdletDictionary . TryGetValue ( symbolReference . ScriptRegion . Text , out symbolRefCommandName ) ;
@@ -60,7 +60,7 @@ public FindReferencesVisitor(SymbolReference foundSymbol)
60
60
61
61
/// <summary>
62
62
/// Decides if the current command is a reference of the symbol being searched for.
63
- /// A reference of the symbol will be a of type SymbolType.Function
63
+ /// A reference of the symbol will be a of type SymbolType.Function
64
64
/// and have the same name as the symbol
65
65
/// </summary>
66
66
/// <param name="commandAst">A CommandAst in the script's AST</param>
@@ -74,7 +74,7 @@ public override AstVisitAction VisitCommand(CommandAst commandAst)
74
74
{
75
75
if ( needsAliases )
76
76
{
77
- // Try to get the commandAst's name and aliases,
77
+ // Try to get the commandAst's name and aliases,
78
78
// if a command does not exists (if the symbol isn't an alias to a command)
79
79
// set command to and empty string value string command
80
80
// if the aliases do not exist (if the symvol isn't a command that has aliases)
@@ -85,11 +85,11 @@ public override AstVisitAction VisitCommand(CommandAst commandAst)
85
85
AliasToCmdletDictionary . TryGetValue ( commandName , out command ) ;
86
86
if ( alaises == null ) { alaises = new List < string > ( ) ; }
87
87
if ( command == null ) { command = string . Empty ; }
88
-
88
+
89
89
if ( symbolRef . SymbolType . Equals ( SymbolType . Function ) )
90
90
{
91
91
// Check if the found symbol's name is the same as the commandAst's name OR
92
- // if the symbol's name is an alias for this commandAst's name (commandAst is a cmdlet) OR
92
+ // if the symbol's name is an alias for this commandAst's name (commandAst is a cmdlet) OR
93
93
// if the symbol's name is the same as the commandAst's cmdlet name (commandAst is a alias)
94
94
if ( commandName . Equals ( symbolRef . SymbolName , StringComparison . CurrentCultureIgnoreCase ) ||
95
95
alaises . Contains ( symbolRef . ScriptRegion . Text . ToLower ( ) ) ||
@@ -112,20 +112,20 @@ public override AstVisitAction VisitCommand(CommandAst commandAst)
112
112
commandNameAst . Extent ) ) ;
113
113
}
114
114
}
115
-
115
+
116
116
}
117
117
return base . VisitCommand ( commandAst ) ;
118
118
}
119
119
120
120
/// <summary>
121
- /// Decides if the current function defintion is a reference of the symbol being searched for.
121
+ /// Decides if the current function definition is a reference of the symbol being searched for.
122
122
/// A reference of the symbol will be a of type SymbolType.Function and have the same name as the symbol
123
123
/// </summary>
124
124
/// <param name="functionDefinitionAst">A functionDefinitionAst in the script's AST</param>
125
125
/// <returns>A visit action that continues the search for references</returns>
126
126
public override AstVisitAction VisitFunctionDefinition ( FunctionDefinitionAst functionDefinitionAst )
127
127
{
128
- // Get the start column number of the function name,
128
+ // Get the start column number of the function name,
129
129
// instead of the the start column of 'function' and create new extent for the functionName
130
130
int startColumnNumber =
131
131
functionDefinitionAst . Extent . Text . IndexOf (
@@ -151,8 +151,8 @@ public override AstVisitAction VisitFunctionDefinition(FunctionDefinitionAst fun
151
151
}
152
152
153
153
/// <summary>
154
- /// Decides if the current function defintion is a reference of the symbol being searched for.
155
- /// A reference of the symbol will be a of type SymbolType.Parameter and have the same name as the symbol
154
+ /// Decides if the current function definition is a reference of the symbol being searched for.
155
+ /// A reference of the symbol will be a of type SymbolType.Parameter and have the same name as the symbol
156
156
/// </summary>
157
157
/// <param name="commandParameterAst">A commandParameterAst in the script's AST</param>
158
158
/// <returns>A visit action that continues the search for references</returns>
@@ -169,8 +169,8 @@ public override AstVisitAction VisitCommandParameter(CommandParameterAst command
169
169
}
170
170
171
171
/// <summary>
172
- /// Decides if the current function defintion is a reference of the symbol being searched for.
173
- /// A reference of the symbol will be a of type SymbolType.Variable and have the same name as the symbol
172
+ /// Decides if the current function definition is a reference of the symbol being searched for.
173
+ /// A reference of the symbol will be a of type SymbolType.Variable and have the same name as the symbol
174
174
/// </summary>
175
175
/// <param name="variableExpressionAst">A variableExpressionAst in the script's AST</param>
176
176
/// <returns>A visit action that continues the search for references</returns>
@@ -186,4 +186,4 @@ public override AstVisitAction VisitVariableExpression(VariableExpressionAst var
186
186
return AstVisitAction . Continue ;
187
187
}
188
188
}
189
- }
189
+ }
0 commit comments