Skip to content

Commit 85ac9d8

Browse files
committed
#1942 - AssignedByValParameter new QuickFix
Updated per Pull request feedback. Moved CapitalizeFirstLetter to StringExtensions.cs
1 parent a6bf7e2 commit 85ac9d8

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

RetailCoder.VBE/Common/StringExtensions.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,12 @@ public static string Captialize(this string input)
1515
tokens[0] = CultureInfo.CurrentUICulture.TextInfo.ToTitleCase(tokens[0]);
1616
return string.Join(" ", tokens);
1717
}
18+
public static string CapitalizeFirstLetter(this string input)
19+
{
20+
if (input.Length == 0)
21+
{
22+
return string.Empty;
23+
}
24+
}
1825
}
1926
}

RetailCoder.VBE/Inspections/QuickFixes/AssignedByValParameterQuickFix.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Rubberduck.Parsing.Symbols;
99
using System.Windows.Forms;
1010
using Rubberduck.UI.Refactorings;
11+
using Rubberduck.Common;
1112

1213
namespace Rubberduck.Inspections.QuickFixes
1314
{
@@ -175,12 +176,7 @@ private string GetEndOfScopeStatementForDeclaration(string declaration)
175176
};
176177
private string AutoSuggestedName()
177178
{
178-
return "local" + CapitalizeFirstLetter(_target.IdentifierName);
179+
return "local" + this._target.IdentifierName.CapitalizeFirstLetter();
179180
}
180-
private string CapitalizeFirstLetter(string name)
181-
{
182-
return name.Substring(0, 1).ToUpper() + name.Substring(1);
183-
}
184-
185181
}
186182
}

0 commit comments

Comments
 (0)