Skip to content

Commit cb713f2

Browse files
dee-seeTylerLeonhardt
authored andcommitted
Fix multiple occurrences of the same typo (#778)
1 parent 78d96b8 commit cb713f2

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

src/PowerShellEditorServices/Language/FindReferencesVisitor.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internal class FindReferencesVisitor : AstVisitor
1919
private Dictionary<String, String> AliasToCmdletDictionary;
2020
private string symbolRefCommandName;
2121
private bool needsAliases;
22-
22+
2323
public List<SymbolReference> FoundReferences { get; set; }
2424

2525
/// <summary>
@@ -39,7 +39,7 @@ public FindReferencesVisitor(
3939
this.CmdletToAliasDictionary = CmdletToAliasDictionary;
4040
this.AliasToCmdletDictionary = AliasToCmdletDictionary;
4141

42-
// Try to get the symbolReference's command name of an alias,
42+
// Try to get the symbolReference's command name of an alias,
4343
// if a command name does not exists (if the symbol isn't an alias to a command)
4444
// set symbolRefCommandName to and empty string value
4545
AliasToCmdletDictionary.TryGetValue(symbolReference.ScriptRegion.Text, out symbolRefCommandName);
@@ -60,7 +60,7 @@ public FindReferencesVisitor(SymbolReference foundSymbol)
6060

6161
/// <summary>
6262
/// 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
6464
/// and have the same name as the symbol
6565
/// </summary>
6666
/// <param name="commandAst">A CommandAst in the script's AST</param>
@@ -74,7 +74,7 @@ public override AstVisitAction VisitCommand(CommandAst commandAst)
7474
{
7575
if (needsAliases)
7676
{
77-
// Try to get the commandAst's name and aliases,
77+
// Try to get the commandAst's name and aliases,
7878
// if a command does not exists (if the symbol isn't an alias to a command)
7979
// set command to and empty string value string command
8080
// 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)
8585
AliasToCmdletDictionary.TryGetValue(commandName, out command);
8686
if (alaises == null) { alaises = new List<string>(); }
8787
if (command == null) { command = string.Empty; }
88-
88+
8989
if (symbolRef.SymbolType.Equals(SymbolType.Function))
9090
{
9191
// 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
9393
// if the symbol's name is the same as the commandAst's cmdlet name (commandAst is a alias)
9494
if (commandName.Equals(symbolRef.SymbolName, StringComparison.CurrentCultureIgnoreCase) ||
9595
alaises.Contains(symbolRef.ScriptRegion.Text.ToLower()) ||
@@ -112,20 +112,20 @@ public override AstVisitAction VisitCommand(CommandAst commandAst)
112112
commandNameAst.Extent));
113113
}
114114
}
115-
115+
116116
}
117117
return base.VisitCommand(commandAst);
118118
}
119119

120120
/// <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.
122122
/// A reference of the symbol will be a of type SymbolType.Function and have the same name as the symbol
123123
/// </summary>
124124
/// <param name="functionDefinitionAst">A functionDefinitionAst in the script's AST</param>
125125
/// <returns>A visit action that continues the search for references</returns>
126126
public override AstVisitAction VisitFunctionDefinition(FunctionDefinitionAst functionDefinitionAst)
127127
{
128-
// Get the start column number of the function name,
128+
// Get the start column number of the function name,
129129
// instead of the the start column of 'function' and create new extent for the functionName
130130
int startColumnNumber =
131131
functionDefinitionAst.Extent.Text.IndexOf(
@@ -151,8 +151,8 @@ public override AstVisitAction VisitFunctionDefinition(FunctionDefinitionAst fun
151151
}
152152

153153
/// <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
156156
/// </summary>
157157
/// <param name="commandParameterAst">A commandParameterAst in the script's AST</param>
158158
/// <returns>A visit action that continues the search for references</returns>
@@ -169,8 +169,8 @@ public override AstVisitAction VisitCommandParameter(CommandParameterAst command
169169
}
170170

171171
/// <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
174174
/// </summary>
175175
/// <param name="variableExpressionAst">A variableExpressionAst in the script's AST</param>
176176
/// <returns>A visit action that continues the search for references</returns>
@@ -186,4 +186,4 @@ public override AstVisitAction VisitVariableExpression(VariableExpressionAst var
186186
return AstVisitAction.Continue;
187187
}
188188
}
189-
}
189+
}

src/PowerShellEditorServices/Language/FindSymbolsVisitor.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ public FindSymbolsVisitor()
2424
}
2525

2626
/// <summary>
27-
/// Adds each function defintion as a
27+
/// Adds each function definition as a
2828
/// </summary>
2929
/// <param name="functionDefinitionAst">A functionDefinitionAst object in the script's AST</param>
30-
/// <returns>A decision to stop searching if the right symbol was found,
30+
/// <returns>A decision to stop searching if the right symbol was found,
3131
/// or a decision to continue if it wasn't found</returns>
3232
public override AstVisitAction VisitFunctionDefinition(FunctionDefinitionAst functionDefinitionAst)
3333
{
@@ -39,8 +39,8 @@ public override AstVisitAction VisitFunctionDefinition(FunctionDefinitionAst fun
3939
EndColumnNumber = functionDefinitionAst.Extent.EndColumnNumber
4040
};
4141

42-
SymbolType symbolType =
43-
functionDefinitionAst.IsWorkflow ?
42+
SymbolType symbolType =
43+
functionDefinitionAst.IsWorkflow ?
4444
SymbolType.Workflow : SymbolType.Function;
4545

4646
this.SymbolReferences.Add(
@@ -55,7 +55,7 @@ public override AstVisitAction VisitFunctionDefinition(FunctionDefinitionAst fun
5555
/// Checks to see if this variable expression is the symbol we are looking for.
5656
/// </summary>
5757
/// <param name="variableExpressionAst">A VariableExpressionAst object in the script's AST</param>
58-
/// <returns>A descion to stop searching if the right symbol was found,
58+
/// <returns>A descion to stop searching if the right symbol was found,
5959
/// or a decision to continue if it wasn't found</returns>
6060
public override AstVisitAction VisitVariableExpression(VariableExpressionAst variableExpressionAst)
6161
{
@@ -71,7 +71,7 @@ public override AstVisitAction VisitVariableExpression(VariableExpressionAst var
7171

7272
return AstVisitAction.Continue;
7373
}
74-
74+
7575
private bool IsAssignedAtScriptScope(VariableExpressionAst variableExpressionAst)
7676
{
7777
Ast parent = variableExpressionAst.Parent;

src/PowerShellEditorServices/Language/FindSymbolsVisitor2.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ namespace Microsoft.PowerShell.EditorServices
1414
// PS versions in the new PSES-as-a-module world (issue #276)
1515

1616
///// <summary>
17-
///// The visitor used to find all the symbols (function and class defs) in the AST.
17+
///// The visitor used to find all the symbols (function and class defs) in the AST.
1818
///// </summary>
1919
///// <remarks>
2020
///// Requires PowerShell v5 or higher
2121
///// </remarks>
22-
/////
22+
/////
2323
//internal class FindSymbolsVisitor2 : AstVisitor2
2424
//{
2525
// private FindSymbolsVisitor findSymbolsVisitor;
@@ -38,10 +38,10 @@ namespace Microsoft.PowerShell.EditorServices
3838
// }
3939

4040
// /// <summary>
41-
// /// Adds each function defintion as a
41+
// /// Adds each function definition as a
4242
// /// </summary>
4343
// /// <param name="functionDefinitionAst">A functionDefinitionAst object in the script's AST</param>
44-
// /// <returns>A decision to stop searching if the right symbol was found,
44+
// /// <returns>A decision to stop searching if the right symbol was found,
4545
// /// or a decision to continue if it wasn't found</returns>
4646
// public override AstVisitAction VisitFunctionDefinition(FunctionDefinitionAst functionDefinitionAst)
4747
// {
@@ -52,7 +52,7 @@ namespace Microsoft.PowerShell.EditorServices
5252
// /// Checks to see if this variable expression is the symbol we are looking for.
5353
// /// </summary>
5454
// /// <param name="variableExpressionAst">A VariableExpressionAst object in the script's AST</param>
55-
// /// <returns>A descion to stop searching if the right symbol was found,
55+
// /// <returns>A descion to stop searching if the right symbol was found,
5656
// /// or a decision to continue if it wasn't found</returns>
5757
// public override AstVisitAction VisitVariableExpression(VariableExpressionAst variableExpressionAst)
5858
// {

src/PowerShellEditorServices/Language/GetDefinitionResult.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
namespace Microsoft.PowerShell.EditorServices
77
{
88
/// <summary>
9-
/// A class to contain the found defintion of a symbol.
10-
/// It contains the symbol reference of the defintion
9+
/// A class to contain the found definition of a symbol.
10+
/// It contains the symbol reference of the definition
1111
/// </summary>
1212
public class GetDefinitionResult
1313
{

test/PowerShellEditorServices.Test.Host/LanguageServerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ await this.SendRequest(
434434
}
435435

436436
[Fact]
437-
public async Task FindsDefintionOfVariable()
437+
public async Task FindsDefinitionOfVariable()
438438
{
439439
await this.SendOpenFileEvent("TestFiles\\FindReferences.ps1");
440440

0 commit comments

Comments
 (0)