File tree Expand file tree Collapse file tree
System.IO.Abstractions.Analyzers/CodeFixes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,12 @@ namespace System.IO.Abstractions.Analyzers.CodeFixes;
88[ ExportCodeFixProvider ( LanguageNames . CSharp , Name = nameof ( DirectoryCodeFix ) ) ]
99public class DirectoryCodeFix : BaseInvokeCodeFix
1010{
11+ [ ImportingConstructor ]
12+ [ Obsolete ( "This exported object must be obtained through the MEF export provider." , true ) ]
13+ public DirectoryCodeFix ( )
14+ {
15+ }
16+
1117 protected override string DiagnosticId => Constants . Io0003 ;
1218
1319 protected override string Title => "Use IFileSystem.Directory for improved testability" ;
Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ public class DirectoryInfoCodeFix : CodeFixProvider
1616{
1717 private const string Title = "Use IDirectoryInfoFactory instead creation DirectoryInfo for improved testability" ;
1818
19+ [ ImportingConstructor ]
20+ [ Obsolete ( "This exported object must be obtained through the MEF export provider." , true ) ]
21+ public DirectoryInfoCodeFix ( )
22+ {
23+ }
24+
1925 public override ImmutableArray < string > FixableDiagnosticIds => ImmutableArray . Create ( Constants . Io0007 ) ;
2026
2127 public override sealed FixAllProvider GetFixAllProvider ( ) => WellKnownFixAllProviders . BatchFixer ;
Original file line number Diff line number Diff line change @@ -8,6 +8,12 @@ namespace System.IO.Abstractions.Analyzers.CodeFixes;
88[ ExportCodeFixProvider ( LanguageNames . CSharp , Name = nameof ( FileCodeFix ) ) ]
99public class FileCodeFix : BaseInvokeCodeFix
1010{
11+ [ ImportingConstructor ]
12+ [ Obsolete ( "This exported object must be obtained through the MEF export provider." , true ) ]
13+ public FileCodeFix ( )
14+ {
15+ }
16+
1117 protected override string DiagnosticId => Constants . Io0002 ;
1218
1319 protected override string Title => "Use IFileSystem.File for improved testability" ;
Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ public class FileInfoCodeFix : CodeFixProvider
1616{
1717 private const string Title = "Use IFileInfoFactory instead creation FileInfo for improved testability" ;
1818
19+ [ ImportingConstructor ]
20+ [ Obsolete ( "This exported object must be obtained through the MEF export provider." , true ) ]
21+ public FileInfoCodeFix ( )
22+ {
23+ }
24+
1925 public override ImmutableArray < string > FixableDiagnosticIds => ImmutableArray . Create ( Constants . Io0004 ) ;
2026
2127 public override sealed FixAllProvider GetFixAllProvider ( ) => WellKnownFixAllProviders . BatchFixer ;
Original file line number Diff line number Diff line change @@ -15,6 +15,12 @@ public class FileServiceConstructorInitialCodeFix : CodeFixProvider
1515{
1616 private const string Title = "Create FileSystem in constructor and using System.IO.Abstractions" ;
1717
18+ [ ImportingConstructor ]
19+ [ Obsolete ( "This exported object must be obtained through the MEF export provider." , true ) ]
20+ public FileServiceConstructorInitialCodeFix ( )
21+ {
22+ }
23+
1824 public override sealed ImmutableArray < string > FixableDiagnosticIds =>
1925 ImmutableArray . Create ( Constants . Io0002 ,
2026 Constants . Io0003 ,
Original file line number Diff line number Diff line change @@ -15,6 +15,12 @@ public class FileServiceInterfaceInjectionCodeFix : CodeFixProvider
1515{
1616 private const string Title = "Inject IFileSystem and using System.IO.Abstractions" ;
1717
18+ [ ImportingConstructor ]
19+ [ Obsolete ( "This exported object must be obtained through the MEF export provider." , true ) ]
20+ public FileServiceInterfaceInjectionCodeFix ( )
21+ {
22+ }
23+
1824 public override sealed ImmutableArray < string > FixableDiagnosticIds =>
1925 ImmutableArray . Create ( Constants . Io0002 ,
2026 Constants . Io0003 ,
Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ public class FileStreamCodeFix : CodeFixProvider
1616{
1717 private const string Title = "Use IFileStreamFactory instead creation FileStream for improved testability" ;
1818
19+ [ ImportingConstructor ]
20+ [ Obsolete ( "This exported object must be obtained through the MEF export provider." , true ) ]
21+ public FileStreamCodeFix ( )
22+ {
23+ }
24+
1925 public override ImmutableArray < string > FixableDiagnosticIds => ImmutableArray . Create ( Constants . Io0005 ) ;
2026
2127 public override sealed FixAllProvider GetFixAllProvider ( ) => WellKnownFixAllProviders . BatchFixer ;
Original file line number Diff line number Diff line change @@ -8,6 +8,12 @@ namespace System.IO.Abstractions.Analyzers.CodeFixes;
88[ ExportCodeFixProvider ( LanguageNames . CSharp , Name = nameof ( PathCodeFix ) ) ]
99public class PathCodeFix : BaseInvokeCodeFix
1010{
11+ [ ImportingConstructor ]
12+ [ Obsolete ( "This exported object must be obtained through the MEF export provider." , true ) ]
13+ public PathCodeFix ( )
14+ {
15+ }
16+
1117 protected override string DiagnosticId => Constants . Io0006 ;
1218
1319 protected override string Title => "Use IFileSystem.Path for improved testability" ;
You can’t perform that action at this time.
0 commit comments