Skip to content

Commit a43f5d4

Browse files
committed
Fix bug
1 parent ffb9fe0 commit a43f5d4

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

RetailCoder.VBE/Root/RubberduckIoCInstaller.cs

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ private void RegisterConfiguration(IWindsorContainer container, Assembly[] assem
156156
{
157157
foreach (var assembly in assembliesToRegister)
158158
{
159-
var assemblyClasses = assembly.GetTypes()
160-
.Where(w => _initialSettings.EnableExperimentalFeatures || Attribute.IsDefined(w, typeof(ExperimentalAttribute)));
159+
var assemblyTypes = assembly.DefinedTypes
160+
.Where(w => _initialSettings.EnableExperimentalFeatures || !Attribute.IsDefined(w, typeof(ExperimentalAttribute)));
161161

162-
container.Register(Classes.From(assemblyClasses)
162+
container.Register(Classes.From(assemblyTypes)
163163
.InSameNamespaceAs<Configuration>()
164164
.WithService.AllInterfaces()
165165
.LifestyleSingleton());
@@ -189,10 +189,12 @@ private void ApplyDefaultInterfaceConvention(IWindsorContainer container, Assemb
189189
{
190190
foreach (var assembly in assembliesToRegister)
191191
{
192-
var assemblyClasses = assembly.GetTypes()
193-
.Where(w => _initialSettings.EnableExperimentalFeatures || Attribute.IsDefined(w, typeof(ExperimentalAttribute)));
192+
var assemblyTypes = assembly.DefinedTypes
193+
.Where(w => _initialSettings.EnableExperimentalFeatures || !Attribute.IsDefined(w, typeof(ExperimentalAttribute)));
194+
195+
assemblyTypes.Any(t => t.Name == nameof(IMessageBox));
194196

195-
container.Register(Classes.From(assemblyClasses)
197+
container.Register(Classes.From(assemblyTypes)
196198
.Where(type => type.Namespace != null
197199
&& !type.Namespace.StartsWith("Rubberduck.VBEditor.SafeComWrappers")
198200
&& !type.Name.Equals("SelectionChangeService")
@@ -209,10 +211,10 @@ private void RegisterFactories(IWindsorContainer container, Assembly[] assemblie
209211
{
210212
foreach (var assembly in assembliesToRegister)
211213
{
212-
var assemblyClasses = assembly.GetTypes()
213-
.Where(w => _initialSettings.EnableExperimentalFeatures || Attribute.IsDefined(w, typeof(ExperimentalAttribute)));
214+
var assemblyTypes = assembly.DefinedTypes
215+
.Where(w => _initialSettings.EnableExperimentalFeatures || !Attribute.IsDefined(w, typeof(ExperimentalAttribute)));
214216

215-
container.Register(Classes.From(assemblyClasses)
217+
container.Register(Types.From(assemblyTypes)
216218
.Where(type => type.IsInterface && type.Name.EndsWith("Factory"))
217219
.Configure(c => c.AsFactory())
218220
.LifestyleSingleton());
@@ -233,10 +235,10 @@ private void RegisterQuickFixes(IWindsorContainer container, Assembly[] assembli
233235
{
234236
foreach (var assembly in assembliesToRegister)
235237
{
236-
var assemblyClasses = assembly.GetTypes()
237-
.Where(w => _initialSettings.EnableExperimentalFeatures || Attribute.IsDefined(w, typeof(ExperimentalAttribute)));
238+
var assemblyTypes = assembly.DefinedTypes
239+
.Where(w => _initialSettings.EnableExperimentalFeatures || !Attribute.IsDefined(w, typeof(ExperimentalAttribute)));
238240

239-
container.Register(Classes.From(assemblyClasses)
241+
container.Register(Classes.From(assemblyTypes)
240242
.BasedOn<IQuickFix>()
241243
.WithService.Base()
242244
.WithService.Self()
@@ -248,10 +250,10 @@ private void RegisterInspections(IWindsorContainer container, Assembly[] assembl
248250
{
249251
foreach (var assembly in assembliesToRegister)
250252
{
251-
var assemblyClasses = assembly.GetTypes()
252-
.Where(w => _initialSettings.EnableExperimentalFeatures || Attribute.IsDefined(w, typeof(ExperimentalAttribute)));
253+
var assemblyTypes = assembly.DefinedTypes
254+
.Where(w => _initialSettings.EnableExperimentalFeatures || !Attribute.IsDefined(w, typeof(ExperimentalAttribute)));
253255

254-
container.Register(Classes.From(assemblyClasses)
256+
container.Register(Classes.From(assemblyTypes)
255257
.BasedOn<IInspection>()
256258
.WithService.Base()
257259
.LifestyleTransient());
@@ -262,10 +264,10 @@ private void RegisterParseTreeInspections(IWindsorContainer container, Assembly[
262264
{
263265
foreach (var assembly in assembliesToRegister)
264266
{
265-
var assemblyClasses = assembly.GetTypes()
266-
.Where(w => _initialSettings.EnableExperimentalFeatures || Attribute.IsDefined(w, typeof(ExperimentalAttribute)));
267+
var assemblyTypes = assembly.DefinedTypes
268+
.Where(w => _initialSettings.EnableExperimentalFeatures || !Attribute.IsDefined(w, typeof(ExperimentalAttribute)));
267269

268-
container.Register(Classes.From(assemblyClasses)
270+
container.Register(Classes.From(assemblyTypes)
269271
.BasedOn<IParseTreeInspection>()
270272
.WithService.Base()
271273
.WithService.Select(new[]{typeof(IInspection)})

Rubberduck.Inspections/Concrete/ConstantNotUsedInspection.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
using Rubberduck.Inspections.Abstract;
66
using Rubberduck.Inspections.Results;
77
using Rubberduck.Parsing;
8-
using Rubberduck.Parsing.Common;
98
using Rubberduck.Parsing.Inspections.Abstract;
109
using Rubberduck.Parsing.Inspections.Resources;
1110
using Rubberduck.Parsing.Symbols;
1211
using Rubberduck.Parsing.VBA;
1312

1413
namespace Rubberduck.Inspections.Concrete
1514
{
16-
[Experimental]
1715
public sealed class ConstantNotUsedInspection : InspectionBase
1816
{
1917
public ConstantNotUsedInspection(RubberduckParserState state)

0 commit comments

Comments
 (0)