File tree Expand file tree Collapse file tree
PropertyChangedAnalyzers.Benchmarks
PropertyChangedAnalyzers.Test Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- namespace PropertyChangedAnalyzers . Benchmarks
1+ namespace PropertyChangedAnalyzers . Benchmarks
22{
33 using System ;
44 using System . Collections . Generic ;
@@ -9,11 +9,13 @@ namespace PropertyChangedAnalyzers.Benchmarks
99
1010 public class BenchmarkTests
1111 {
12- private static IReadOnlyList < DiagnosticAnalyzer > AllAnalyzers { get ; } = typeof ( KnownSymbol ) . Assembly
13- . GetTypes ( )
14- . Where ( typeof ( DiagnosticAnalyzer ) . IsAssignableFrom )
15- . Select ( t => ( DiagnosticAnalyzer ) Activator . CreateInstance ( t ) )
16- . ToArray ( ) ;
12+ private static IReadOnlyList < DiagnosticAnalyzer > AllAnalyzers { get ; } =
13+ typeof ( KnownSymbol )
14+ . Assembly
15+ . GetTypes ( )
16+ . Where ( t => typeof ( DiagnosticAnalyzer ) . IsAssignableFrom ( t ) && ! t . IsAbstract )
17+ . Select ( t => ( DiagnosticAnalyzer ) Activator . CreateInstance ( t ) )
18+ . ToArray ( ) ;
1719
1820 private static IReadOnlyList < Gu . Roslyn . Asserts . Benchmark > AllBenchmarks { get ; } = AllAnalyzers
1921 . Select ( x => Gu . Roslyn . Asserts . Benchmark . Create ( Code . ValidCodeProject , x ) )
Original file line number Diff line number Diff line change 1- namespace PropertyChangedAnalyzers . Benchmarks . Benchmarks
1+ namespace PropertyChangedAnalyzers . Benchmarks . Benchmarks
22{
33 using System ;
44 using System . Collections . Generic ;
55 using System . Collections . Immutable ;
66 using System . IO ;
77 using System . Linq ;
88 using System . Net ;
9+
910 using Gu . Roslyn . Asserts ;
11+
1012 using Microsoft . CodeAnalysis ;
1113 using Microsoft . CodeAnalysis . CSharp ;
1214 using Microsoft . CodeAnalysis . Diagnostics ;
@@ -24,11 +26,13 @@ public static class Code
2426 MetadataReference . CreateFromFile ( typeof ( Compilation ) . Assembly . Location ) ,
2527 } ;
2628
27- private static readonly IReadOnlyList < DiagnosticAnalyzer > AllAnalyzers = typeof ( KnownSymbol ) . Assembly
28- . GetTypes ( )
29- . Where ( typeof ( DiagnosticAnalyzer ) . IsAssignableFrom )
30- . Select ( t => ( DiagnosticAnalyzer ) Activator . CreateInstance ( t ) )
31- . ToArray ( ) ;
29+ private static readonly IReadOnlyList < DiagnosticAnalyzer > AllAnalyzers =
30+ typeof ( KnownSymbol )
31+ . Assembly
32+ . GetTypes ( )
33+ . Where ( t => typeof ( DiagnosticAnalyzer ) . IsAssignableFrom ( t ) && ! t . IsAbstract )
34+ . Select ( t => ( DiagnosticAnalyzer ) Activator . CreateInstance ( t ) )
35+ . ToArray ( ) ;
3236
3337 public static string ProjectDirectory { get ; } = ProjectFile . Find ( "PropertyChangedAnalyzers.Benchmarks.csproj" ) . DirectoryName ;
3438
Original file line number Diff line number Diff line change 1111
1212 public static class ValidWithAllAnalyzers
1313 {
14- private static readonly IReadOnlyList < DiagnosticAnalyzer > AllAnalyzers = typeof ( Descriptors )
14+ private static readonly IReadOnlyList < DiagnosticAnalyzer > AllAnalyzers =
15+ typeof ( Descriptors )
1516 . Assembly
1617 . GetTypes ( )
17- . Where ( typeof ( DiagnosticAnalyzer ) . IsAssignableFrom )
18+ . Where ( t => typeof ( DiagnosticAnalyzer ) . IsAssignableFrom ( t ) && ! t . IsAbstract )
1819 . Select ( t => ( DiagnosticAnalyzer ) Activator . CreateInstance ( t ) )
1920 . ToArray ( ) ;
2021
You can’t perform that action at this time.
0 commit comments