Skip to content

Commit f592555

Browse files
committed
Merge pull request #1544 from Hosch250/Issue1537
Issue1537
2 parents 20ee7eb + 1873d22 commit f592555

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

RetailCoder.VBE/Inspections/ObsoleteTypeHintInspection.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,20 @@ public override IEnumerable<InspectionResultBase> GetInspectionResults()
2222

2323
var declarations = from item in results
2424
where item.HasTypeHint()
25-
// bug: this inspection result only has one value. Why are we passing two in?
26-
select new ObsoleteTypeHintInspectionResult(this, string.Format(InspectionsUI.ObsoleteTypeHintInspectionResultFormat, InspectionsUI.Inspections_Declaration, item.DeclarationType.ToString().ToLower(), item.IdentifierName), new QualifiedContext(item.QualifiedName, item.Context), item);
27-
// todo: localize this InspectionResultFormat properly
25+
select
26+
new ObsoleteTypeHintInspectionResult(this,
27+
string.Format(InspectionsUI.ObsoleteTypeHintInspectionResultFormat,
28+
InspectionsUI.Inspections_Declaration, item.DeclarationType.ToString().ToLower(),
29+
item.IdentifierName), new QualifiedContext(item.QualifiedName, item.Context), item);
30+
2831
var references = from item in results.SelectMany(d => d.References)
2932
where item.HasTypeHint()
30-
select new ObsoleteTypeHintInspectionResult(this, string.Format(InspectionsUI.ObsoleteTypeHintInspectionResultFormat, InspectionsUI.Inspections_Usage, item.Declaration.DeclarationType.ToString().ToLower(), item.IdentifierName), new QualifiedContext(item.QualifiedModuleName, item.Context), item.Declaration);
33+
select
34+
new ObsoleteTypeHintInspectionResult(this,
35+
string.Format(InspectionsUI.ObsoleteTypeHintInspectionResultFormat,
36+
InspectionsUI.Inspections_Usage, item.Declaration.DeclarationType.ToString().ToLower(),
37+
item.IdentifierName), new QualifiedContext(item.QualifiedModuleName, item.Context),
38+
item.Declaration);
3139

3240
return declarations.Union(references);
3341
}

RetailCoder.VBE/Inspections/UntypedFunctionUsageInspectionResult.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Diagnostics;
34
using System.Linq;
45
using Antlr4.Runtime;
56
using Rubberduck.Parsing.Grammar;
@@ -72,6 +73,8 @@ public override void Fix()
7273

7374
private static string GetNewSignature(ParserRuleContext context)
7475
{
76+
Debug.Assert(context != null);
77+
7578
return context.children.Aggregate(string.Empty, (current, member) =>
7679
{
7780
var isIdentifierNode = member is VBAParser.IdentifierContext;

0 commit comments

Comments
 (0)