Skip to content

Commit 8ef58a1

Browse files
author
Kapil Borle
committed
Fix typo in class name
1 parent 69f48e9 commit 8ef58a1

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

src/PowerShellEditorServices/Language/AstOperations.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Microsoft.PowerShell.EditorServices
2424
internal static class AstOperations
2525
{
2626
/// <summary>
27-
/// Gets completions for the symbol found in the Ast at
27+
/// Gets completions for the symbol found in the Ast at
2828
/// the given file offset.
2929
/// </summary>
3030
/// <param name="scriptAst">
@@ -47,14 +47,14 @@ internal static class AstOperations
4747
/// symbol at the given offset.
4848
/// </returns>
4949
static public async Task<CommandCompletion> GetCompletions(
50-
Ast scriptAst,
51-
Token[] currentTokens,
50+
Ast scriptAst,
51+
Token[] currentTokens,
5252
int fileOffset,
5353
PowerShellContext powerShellContext,
5454
CancellationToken cancellationToken)
5555
{
5656
var type = scriptAst.Extent.StartScriptPosition.GetType();
57-
var method =
57+
var method =
5858
#if CoreCLR
5959
type.GetMethod(
6060
"CloneWithNewOffset",
@@ -67,9 +67,9 @@ static public async Task<CommandCompletion> GetCompletions(
6767
new[] { typeof(int) }, null);
6868
#endif
6969

70-
IScriptPosition cursorPosition =
70+
IScriptPosition cursorPosition =
7171
(IScriptPosition)method.Invoke(
72-
scriptAst.Extent.StartScriptPosition,
72+
scriptAst.Extent.StartScriptPosition,
7373
new object[] { fileOffset });
7474

7575
Logger.Write(
@@ -138,7 +138,7 @@ static public async Task<CommandCompletion> GetCompletions(
138138
}
139139

140140
/// <summary>
141-
/// Finds the symbol at a given file location
141+
/// Finds the symbol at a given file location
142142
/// </summary>
143143
/// <param name="scriptAst">The abstract syntax tree of the given script</param>
144144
/// <param name="lineNumber">The line number of the cursor for the given script</param>
@@ -176,15 +176,15 @@ static public SymbolReference FindCommandAtPosition(Ast scriptAst, int lineNumbe
176176
/// <param name="AliasToCmdletDictionary">Dictionary maping aliases to cmdlets for finding alias references</param>
177177
/// <returns></returns>
178178
static public IEnumerable<SymbolReference> FindReferencesOfSymbol(
179-
Ast scriptAst,
180-
SymbolReference symbolReference,
179+
Ast scriptAst,
180+
SymbolReference symbolReference,
181181
Dictionary<String, List<String>> CmdletToAliasDictionary,
182182
Dictionary<String, String> AliasToCmdletDictionary)
183183
{
184184
// find the symbol evaluators for the node types we are handling
185-
FindReferencesVisitor referencesVisitor =
185+
FindReferencesVisitor referencesVisitor =
186186
new FindReferencesVisitor(
187-
symbolReference,
187+
symbolReference,
188188
CmdletToAliasDictionary,
189189
AliasToCmdletDictionary);
190190
scriptAst.Visit(referencesVisitor);
@@ -202,8 +202,8 @@ static public IEnumerable<SymbolReference> FindReferencesOfSymbol(
202202
/// <returns>A collection of SymbolReference objects that are refrences to the symbolRefrence
203203
/// not including aliases</returns>
204204
static public IEnumerable<SymbolReference> FindReferencesOfSymbol(
205-
ScriptBlockAst scriptAst,
206-
SymbolReference foundSymbol,
205+
ScriptBlockAst scriptAst,
206+
SymbolReference foundSymbol,
207207
bool needsAliases)
208208
{
209209
FindReferencesVisitor referencesVisitor =
@@ -214,7 +214,7 @@ static public IEnumerable<SymbolReference> FindReferencesOfSymbol(
214214
}
215215

216216
/// <summary>
217-
/// Finds the definition of the symbol
217+
/// Finds the definition of the symbol
218218
/// </summary>
219219
/// <param name="scriptAst">The abstract syntax tree of the given script</param>
220220
/// <param name="symbolReference">The symbol that we are looking for the definition of</param>
@@ -223,12 +223,12 @@ static public SymbolReference FindDefinitionOfSymbol(
223223
Ast scriptAst,
224224
SymbolReference symbolReference)
225225
{
226-
FindDeclartionVisitor declarationVisitor =
227-
new FindDeclartionVisitor(
226+
FindDeclarationVisitor declarationVisitor =
227+
new FindDeclarationVisitor(
228228
symbolReference);
229229
scriptAst.Visit(declarationVisitor);
230230

231-
return declarationVisitor.FoundDeclartion;
231+
return declarationVisitor.FoundDeclaration;
232232
}
233233

234234
/// <summary>

src/PowerShellEditorServices/Language/FindDeclartionVisitor.cs renamed to src/PowerShellEditorServices/Language/FindDeclarationVisitor.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
namespace Microsoft.PowerShell.EditorServices
1010
{
1111
/// <summary>
12-
/// The vistor used to find the defintion of a symbol
12+
/// The visitor used to find the definition of a symbol
1313
/// </summary>
14-
internal class FindDeclartionVisitor : AstVisitor
14+
internal class FindDeclarationVisitor : AstVisitor
1515
{
1616
private SymbolReference symbolRef;
1717
private string variableName;
1818

19-
public SymbolReference FoundDeclartion{ get; private set; }
19+
public SymbolReference FoundDeclaration{ get; private set; }
2020

21-
public FindDeclartionVisitor(SymbolReference symbolRef)
21+
public FindDeclarationVisitor(SymbolReference symbolRef)
2222
{
2323
this.symbolRef = symbolRef;
2424
if (this.symbolRef.SymbolType == SymbolType.Variable)
@@ -29,8 +29,8 @@ public FindDeclartionVisitor(SymbolReference symbolRef)
2929
}
3030

3131
/// <summary>
32-
/// Decides if the current function defintion is the right defition
33-
/// for the symbol being searched for. The defintion of the symbol will be a of type
32+
/// Decides if the current function definition is the right definition
33+
/// for the symbol being searched for. The definition of the symbol will be a of type
3434
/// SymbolType.Function and have the same name as the symbol
3535
/// </summary>
3636
/// <param name="functionDefinitionAst">A FunctionDefinitionAst in the script's AST</param>
@@ -56,7 +56,7 @@ public override AstVisitAction VisitFunctionDefinition(FunctionDefinitionAst fun
5656
if (symbolRef.SymbolType.Equals(SymbolType.Function) &&
5757
nameExtent.Text.Equals(symbolRef.ScriptRegion.Text, StringComparison.CurrentCultureIgnoreCase))
5858
{
59-
this.FoundDeclartion =
59+
this.FoundDeclaration =
6060
new SymbolReference(
6161
SymbolType.Function,
6262
nameExtent);
@@ -72,7 +72,7 @@ public override AstVisitAction VisitFunctionDefinition(FunctionDefinitionAst fun
7272
/// with the same name as that of symbolRef.
7373
/// </summary>
7474
/// <param name="assignmentStatementAst">An AssignmentStatementAst/param>
75-
/// <returns>A descion to stop searching if the right VariableExpressionAst was found,
75+
/// <returns>A decision to stop searching if the right VariableExpressionAst was found,
7676
/// or a decision to continue if it wasn't found</returns>
7777
public override AstVisitAction VisitAssignmentStatement(AssignmentStatementAst assignmentStatementAst)
7878
{
@@ -87,7 +87,7 @@ public override AstVisitAction VisitAssignmentStatement(AssignmentStatementAst a
8787
}
8888

8989
// TODO also find instances of set-variable
90-
FoundDeclartion = new SymbolReference(SymbolType.Variable, variableExprAst.Extent);
90+
FoundDeclaration = new SymbolReference(SymbolType.Variable, variableExprAst.Extent);
9191
return AstVisitAction.StopVisit;
9292
}
9393
}

0 commit comments

Comments
 (0)