File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Rubberduck.Inspections/Abstract Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Collections . Generic ;
3
3
using System . Linq ;
4
+ using NLog ;
4
5
using Rubberduck . Parsing . Inspections . Abstract ;
5
6
using Rubberduck . Parsing . VBA ;
6
7
7
8
namespace Rubberduck . Inspections . Abstract
8
9
{
9
10
public abstract class QuickFixBase : IQuickFix
10
11
{
12
+ private readonly ILogger _logger = LogManager . GetCurrentClassLogger ( ) ;
11
13
private HashSet < Type > _supportedInspections ;
12
14
public IReadOnlyCollection < Type > SupportedInspections => _supportedInspections . ToList ( ) ;
13
15
@@ -20,7 +22,12 @@ public void RegisterInspections(params Type[] inspections)
20
22
{
21
23
if ( ! inspections . All ( s => s . GetInterfaces ( ) . Any ( a => a == typeof ( IInspection ) ) ) )
22
24
{
25
+ #if DEBUG
23
26
throw new ArgumentException ( $ "Parameters must implement { nameof ( IInspection ) } ", nameof ( inspections ) ) ;
27
+ #else
28
+ inspections . Where ( s => s . GetInterfaces ( ) . All ( i => i != typeof ( IInspection ) ) ) . ToList ( )
29
+ . ForEach ( i => _logger . Error ( $ "Type { i . Name } does not implement { nameof ( IInspection ) } ") ) ;
30
+ #endif
24
31
}
25
32
26
33
_supportedInspections = inspections . ToHashSet ( ) ;
You can’t perform that action at this time.
0 commit comments