File tree Expand file tree Collapse file tree
System.IO.Abstractions.Analyzers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public override void Initialize(AnalysisContext context)
2020 {
2121 var fileSystemContext = new FileSystemContext ( compilationStartContext . Compilation ) ;
2222
23- if ( ShouldAnalyze ( fileSystemContext ) )
23+ if ( fileSystemContext . HasReference )
2424 {
2525 AnalyzeCompilation ( compilationStartContext , fileSystemContext ) ;
2626 }
@@ -34,6 +34,4 @@ public override void Initialize(AnalysisContext context)
3434 /// <param name="fileSystemContext"> FileSystem Context </param>
3535 protected abstract void AnalyzeCompilation ( CompilationStartAnalysisContext compilationStartContext ,
3636 FileSystemContext fileSystemContext ) ;
37-
38- private static bool ShouldAnalyze ( FileSystemContext fileSystemContext ) => fileSystemContext . HasReference ;
3937}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ public class FileSystemContext
66{
77 public FileSystemContext ( Compilation compilation ) => FileSystemType = compilation . GetTypeByMetadataName ( Constants . FileSystem ) ;
88
9- public bool HasReference => FileSystemType != null ;
9+ public bool HasReference => FileSystemType is not null ;
1010
11- public INamedTypeSymbol FileSystemType { get ; }
11+ private INamedTypeSymbol FileSystemType { get ; }
1212}
You can’t perform that action at this time.
0 commit comments