Skip to content

Commit 5a5e070

Browse files
committed
Correct IAnnotationFactory registration
1 parent 2868ed6 commit 5a5e070

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Rubberduck.CodeAnalysis/QuickFixes/AdjustAttributeValuesQuickFix.cs

Lines changed: 3 additions & 1 deletion
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 Rubberduck.Inspections.Abstract;
45
using Rubberduck.Inspections.Concrete;
56
using Rubberduck.Parsing.Annotations;
@@ -25,7 +26,8 @@ public override void Fix(IInspectionResult result, IRewriteSession rewriteSessio
2526
{
2627
var declaration = result.Target;
2728
IParseTreeAnnotation annotationInstance = result.Properties.Annotation;
28-
// FIXME consider dealing with the implicit assumption here?
29+
30+
Debug.Assert(annotationInstance.Annotation is IAttributeAnnotation);
2931
IAttributeAnnotation annotation = (IAttributeAnnotation)annotationInstance.Annotation;
3032
IReadOnlyList<string> attributeValues = result.Properties.AttributeValues;
3133

Rubberduck.Main/Root/RubberduckIoCInstaller.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ private void RegisterFactories(IWindsorContainer container, Assembly[] assemblie
304304
.Where(type => type.IsInterface
305305
&& type.Name.EndsWith("Factory")
306306
&& !type.Name.Equals("IFakesFactory")
307+
&& !type.Name.Equals("IAnnotationFactory")
307308
&& type.NotDisabledOrExperimental(_initialSettings))
308309
.WithService.Self()
309310
.Configure(c => c.AsFactory())
@@ -957,6 +958,9 @@ private void RegisterAnnotationProcessing(IWindsorContainer container)
957958
.WithServiceAllInterfaces()
958959
.LifestyleSingleton());
959960
}
961+
container.Register(Component.For<IAnnotationFactory>()
962+
.ImplementedBy<VBAParserAnnotationFactory>()
963+
.LifestyleSingleton());
960964
}
961965

962966
private void RegisterTypeLibApi(IWindsorContainer container)

0 commit comments

Comments
 (0)