Skip to content

Commit 5984913

Browse files
committed
included identifier name in inspection result for meaningful names; reworded a bit.
1 parent 27a470f commit 5984913

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

RetailCoder.VBE/Inspections/InspectionsUI.Designer.cs

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

RetailCoder.VBE/Inspections/InspectionsUI.resx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,15 @@
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120120
<data name="EmptyStringLiteralInspection" xml:space="preserve">
121-
<value>Empty String Literal Detected.</value>
121+
<value>Intent of empty string literal could be clarified with 'vbNullString'.</value>
122122
</data>
123123
<data name="EmptyStringLiteralInspectionQuickFix" xml:space="preserve">
124124
<value>Replace '""' with 'vbNullString'.</value>
125125
</data>
126126
<data name="UseMeaningfulNameInspection" xml:space="preserve">
127-
<value>Suboptimal Name Detected.</value>
127+
<value>Identifier '{0}' could probably use a better name.</value>
128128
</data>
129129
<data name="UseMeaningfulNameInspectionQuickFix" xml:space="preserve">
130-
<value>Rename</value>
130+
<value>Rename identifier</value>
131131
</data>
132132
</root>

RetailCoder.VBE/Inspections/UseMeaningfulNameInspection.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ namespace Rubberduck.Inspections
88
{
99
public class UseMeaningfulNameInspection : IInspection
1010
{
11+
private readonly IMessageBox _messageBox;
1112
private readonly ICodePaneWrapperFactory _wrapperFactory;
1213

13-
public UseMeaningfulNameInspection()
14+
public UseMeaningfulNameInspection(IMessageBox messageBox)
1415
{
16+
_messageBox = messageBox;
1517
_wrapperFactory = new CodePaneWrapperFactory();
1618
Severity = CodeInspectionSeverity.Suggestion;
1719
}
@@ -29,7 +31,7 @@ public IEnumerable<CodeInspectionResultBase> GetInspectionResults(RubberduckPars
2931
char.IsDigit(declaration.IdentifierName.Last()) ||
3032
!declaration.IdentifierName.Any(c => new[] {'a', 'e', 'i', 'o', 'u', 'y'}.Contains(c))
3133
))
32-
.Select(issue => new UseMeaningfulNameInspectionResult(this, issue, state, _wrapperFactory, new MessageBox()))
34+
.Select(issue => new UseMeaningfulNameInspectionResult(this, issue, state, _wrapperFactory, _messageBox))
3335
.ToList();
3436

3537
return issues;

0 commit comments

Comments
 (0)