Skip to content

Commit d430459

Browse files
committed
Remove and cleanup TODO comments
1 parent 35eea13 commit d430459

2 files changed

Lines changed: 0 additions & 8 deletions

File tree

‎src/PowerShellEditorServices/Services/TextDocument/RenameService.cs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ or StringConstantExpressionAst
111111
};
112112
}
113113

114-
// TODO: We can probably merge these two methods with Generic Type constraints since they are factored into overloading
115-
116114
private static TextEdit[] RenameFunction(Ast target, Ast scriptAst, RenameParams renameParams)
117115
{
118116
RenameFunctionVisitor visitor = new(target, renameParams.NewName);

‎src/PowerShellEditorServices/Utility/AstExtensions.cs‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ public static bool TryFindFunctionDefinition(this Ast ast, CommandAst command, o
231231
if (!funcDef.Name.Equals(name, StringComparison.CurrentCultureIgnoreCase)) { return false; }
232232

233233
// If the function is recursive (calls itself), its parent is a match unless a more specific in-scope function definition comes next (this is a "bad practice" edge case)
234-
// TODO: Consider a simple "contains" match
235234
if (command.HasParent(funcDef)) { return true; }
236235

237236
return command.HasParent(funcDef.Parent); // The command is in the same scope as the function definition
@@ -323,7 +322,6 @@ public static IEnumerable<Ast> FindParents(this Ast ast, params Type[] types)
323322
/// <summary>
324323
/// Returns true if the Expression is part of a variable assignment
325324
/// </summary>
326-
/// TODO: Potentially check the name matches
327325
public static bool IsVariableAssignment(this VariableExpressionAst var)
328326
=> var.Parent is AssignmentStatementAst or ParameterAst;
329327

@@ -348,7 +346,6 @@ public static bool IsPotentialVariableReference(this Ast ast)
348346
/// <summary>
349347
/// Determines if a variable assignment is a scoped variable assignment, meaning that it can be considered the top assignment within the current scope. This does not include Variable assignments within the body of a scope which may or may not be the top only if one of these do not exist above it in the same scope.
350348
/// </summary>
351-
// TODO: Naming is hard, I feel like this could have a better name
352349
public static bool IsScopedVariableAssignment(this VariableExpressionAst var)
353350
{
354351
// foreach ($x in $y) { }
@@ -390,7 +387,6 @@ ast is VariableExpressionAst var
390387

391388
/// <summary>
392389
/// For a given splat reference, find its source splat assignment. If the reference is not a splat, an exception will be thrown. If no assignment is found, null will be returned.
393-
/// TODO: Support incremental splat references e.g. $x = @{}, $x.Method = 'GET'
394390
/// </summary>
395391
public static StringConstantExpressionAst? FindSplatAssignmentReference(this VariableExpressionAst varAst)
396392
{
@@ -455,7 +451,6 @@ public static bool TryGetFunction(this ParameterAst ast, out FunctionDefinitionA
455451
while (scope is not null)
456452
{
457453
// Check if the reference is a parameter in the current scope. This saves us from having to do a nested search later on.
458-
// TODO: Can probably be combined with below
459454
IEnumerable<ParameterAst>? parameters = scope switch
460455
{
461456
// Covers both function test() { param($x) } and function param($x)
@@ -472,7 +467,6 @@ public static bool TryGetFunction(this ParameterAst ast, out FunctionDefinitionA
472467
}
473468

474469
// Find any top level function definitions in the currentscope that might match the parameter
475-
// TODO: This could be less complicated
476470
if (reference is CommandParameterAst parameterAst)
477471
{
478472
string? commandName = (parameterAst.Parent as CommandAst)?.GetCommandName()?.ToLower();

0 commit comments

Comments
 (0)