Skip to content

Commit 4947e80

Browse files
committed
Reinstate parse tree inspections
1 parent 46cf3e6 commit 4947e80

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

RetailCoder.VBE/Inspections/InspectionsUI.Designer.cs

Lines changed: 2 additions & 2 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,9 @@
559559
<value>An annotation comment is malformed.</value>
560560
</data>
561561
<data name="MalformedAnnotationInspectionName" xml:space="preserve">
562-
<value>Malformed annotation.</value>
562+
<value>Malformed annotation</value>
563563
</data>
564564
<data name="MalformedAnnotationInspectionResultFormat" xml:space="preserve">
565-
<value>The annotation '{0}' is malformed</value>
565+
<value>Malformed '{0}' annotation.</value>
566566
</data>
567567
</root>

RetailCoder.VBE/Inspections/MalformedAnnotationInspection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public MalformedAnnotationInspectionResult(IInspection inspection, QualifiedCont
6868

6969
public override string Description
7070
{
71-
get { return string.Format(Inspection.Description, ((VBAParser.AnnotationContext)Context).annotationName()); }
71+
get { return string.Format(Inspection.Description, ((VBAParser.AnnotationContext)Context).annotationName().GetText()); }
7272
}
7373
}
7474
}

RetailCoder.VBE/Root/RubberduckModule.cs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,25 @@ private void BindCodeInspectionTypes()
218218
// multibinding for IEnumerable<IInspection> dependency
219219
foreach (var inspection in inspections)
220220
{
221-
var binding = Bind<IInspection>().To(inspection).InSingletonScope();
222-
binding.Intercept().With<TimedCallLoggerInterceptor>();
223-
binding.Intercept().With<EnumerableCounterInterceptor<InspectionResultBase>>();
221+
if (typeof(IParseTreeInspection).IsAssignableFrom(inspection))
222+
{
223+
var binding = Bind<IParseTreeInspection>()
224+
.To(inspection)
225+
.InSingletonScope()
226+
.Named(inspection.FullName);
227+
228+
binding.Intercept().With<TimedCallLoggerInterceptor>();
229+
binding.Intercept().With<EnumerableCounterInterceptor<InspectionResultBase>>();
230+
231+
Bind<IInspection>().ToMethod(
232+
c => c.Kernel.Get<IParseTreeInspection>(inspection.FullName));
233+
}
234+
else
235+
{
236+
var binding = Bind<IInspection>().To(inspection).InSingletonScope();
237+
binding.Intercept().With<TimedCallLoggerInterceptor>();
238+
binding.Intercept().With<EnumerableCounterInterceptor<InspectionResultBase>>();
239+
}
224240
}
225241
}
226242

0 commit comments

Comments
 (0)