static CSharpSuppressionFixProvider() { typeInfo = Type.GetType("Microsoft.CodeAnalysis.CSharp.CodeFixes.Suppression.CSharpSuppressionCodeFixProvider, Microsoft.CodeAnalysis.CSharp.Features", true); if (typeInfo == null) { LoggingService.LogError("CSharpSuppressionCodeFixProvider not found."); } canBeSuppressedOrUnsuppressedMethod = typeInfo.GetMethod("CanBeSuppressedOrUnsuppressed"); if (canBeSuppressedOrUnsuppressedMethod == null) { LoggingService.LogError("CanBeSuppressedOrUnsuppressed not found."); } getFixAllProviderMethod = typeInfo.GetMethod("GetFixAllProvider"); if (getFixAllProviderMethod == null) { LoggingService.LogError("GetFixAllProvider not found."); } getSuppressionsAsync1Method = typeInfo.GetMethod("GetSuppressionsAsync", new [] { typeof(Project), typeof(IEnumerable <Diagnostic>), typeof(CancellationToken) }); if (getSuppressionsAsync1Method == null) { LoggingService.LogError("GetSuppressionsAsync1 not found."); } getSuppressionsAsync2Method = typeInfo.GetMethod("GetSuppressionsAsync", new [] { typeof(Document), typeof(TextSpan), typeof(IEnumerable <Diagnostic>), typeof(CancellationToken) }); if (getSuppressionsAsync2Method == null) { LoggingService.LogError("GetSuppressionsAsync2 not found."); } Instance = new CSharpSuppressionFixProvider(); }
public SuppressionFixerFixAllProviderInfo( FixAllProvider fixAllProvider, ISuppressionFixProvider suppressionFixer, IEnumerable <FixAllScope> supportedScopes) : base(fixAllProvider, supportedScopes) { this._canBeSuppressedOrTriaged = suppressionFixer.CanBeSuppressed; }
public SuppressionFixerFixAllProviderInfo( FixAllProvider fixAllProvider, ISuppressionFixProvider suppressionFixer, ImmutableArray <FixAllScope> supportedScopes) : base(fixAllProvider, supportedScopes) { _canBeSuppressedOrUnsuppressed = suppressionFixer.CanBeSuppressedOrUnsuppressed; }
/// <summary> /// Gets an optional <see cref="FixAllProviderInfo"/> for the given suppression fix provider. /// </summary> private static FixAllProviderInfo CreateWithSuppressionFixer(ISuppressionFixProvider provider) { var fixAllProvider = provider.GetFixAllProvider(); if (fixAllProvider == null) { return null; } var scopes = fixAllProvider.GetSupportedFixAllScopes(); if (scopes == null || scopes.IsEmpty()) { return null; } return new SuppressionFixerFixAllProviderInfo(fixAllProvider, provider, scopes); }
/// <summary> /// Gets an optional <see cref="FixAllProviderInfo"/> for the given suppression fix provider. /// </summary> private static FixAllProviderInfo CreateWithSuppressionFixer(ISuppressionFixProvider provider) { var fixAllProvider = provider.GetFixAllProvider(); if (fixAllProvider == null) { return(null); } var scopes = fixAllProvider.GetSupportedFixAllScopes(); if (scopes == null || scopes.IsEmpty()) { return(null); } return(new SuppressionFixerFixAllProviderInfo(fixAllProvider, provider, scopes)); }
static CSharpSuppressionFixProvider () { typeInfo = Type.GetType ("Microsoft.CodeAnalysis.CSharp.CodeFixes.Suppression.CSharpSuppressionCodeFixProvider, Microsoft.CodeAnalysis.CSharp.Features", true); if (typeInfo == null) LoggingService.LogError ("CSharpSuppressionCodeFixProvider not found."); canBeSuppressedOrUnsuppressedMethod = typeInfo.GetMethod ("CanBeSuppressedOrUnsuppressed"); if (canBeSuppressedOrUnsuppressedMethod == null) LoggingService.LogError ("CanBeSuppressedOrUnsuppressed not found."); getFixAllProviderMethod = typeInfo.GetMethod ("GetFixAllProvider"); if (getFixAllProviderMethod == null) LoggingService.LogError ("GetFixAllProvider not found."); getSuppressionsAsync1Method = typeInfo.GetMethod ("GetSuppressionsAsync", new [] { typeof(Project), typeof(IEnumerable<Diagnostic>), typeof(CancellationToken) }); if (getSuppressionsAsync1Method == null) LoggingService.LogError ("GetSuppressionsAsync1 not found."); getSuppressionsAsync2Method = typeInfo.GetMethod ("GetSuppressionsAsync", new [] { typeof(Document), typeof(TextSpan), typeof(IEnumerable<Diagnostic>), typeof(CancellationToken) }); if (getSuppressionsAsync2Method == null) LoggingService.LogError ("GetSuppressionsAsync2 not found."); Instance = new CSharpSuppressionFixProvider (); }
public WrapperCodeFixProvider(ISuppressionFixProvider suppressionFixProvider, IEnumerable<string> diagnosticIds) { _suppressionFixProvider = suppressionFixProvider; _originalDiagnosticIds = diagnosticIds.Distinct().ToImmutableArray(); }
public SuppressionFixerFixAllProviderInfo( FixAllProvider fixAllProvider, ISuppressionFixProvider suppressionFixer, IEnumerable<FixAllScope> supportedScopes) : base(fixAllProvider, supportedScopes) { _canBeSuppressedOrUnsuppressed = suppressionFixer.CanBeSuppressedOrUnsuppressed; }
public WrapperCodeFixProvider(ISuppressionFixProvider suppressionFixProvider, ImmutableArray<Diagnostic> originalDiagnostics) { _suppressionFixProvider = suppressionFixProvider; _originalDiagnosticIds = originalDiagnostics.Select(d => d.Id).Distinct().ToImmutableArray(); }
public WrapperCodeFixProvider(ISuppressionFixProvider suppressionFixProvider, ImmutableArray <Diagnostic> originalDiagnostics) { _suppressionFixProvider = suppressionFixProvider; _originalDiagnosticIds = originalDiagnostics.Select(d => d.Id).Distinct().ToImmutableArray(); }
public WrapperCodeFixProvider(ISuppressionFixProvider suppressionFixProvider, IEnumerable <string> diagnosticIds) { _suppressionFixProvider = suppressionFixProvider; _originalDiagnosticIds = diagnosticIds.Distinct().ToImmutableArray(); }