Skip to content

Commit

Permalink
Do not export IDE0079 (remove unnecessary suppressions) analyzer in C…
Browse files Browse the repository at this point in the history
…odeStyle layer

Fixes #47942
This is a special IDE-only analyzer that should not be exported in the CodeStyle NuGet package. We still want to retain the code in the shared analyzer layer to allow different analyzer hosts to be able to explicitly instantiate it and enforce it on command line from the CodeStyle package.
  • Loading branch information
mavasani committed Sep 22, 2020
1 parent c9977cd commit 315c5bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

namespace Microsoft.CodeAnalysis.CSharp.RemoveUnnecessarySuppressions
{
#if !CODE_STYLE // Not exported in CodeStyle layer: https://github.com/dotnet/roslyn/issues/47942
[DiagnosticAnalyzer(LanguageNames.CSharp)]
#endif
internal sealed class CSharpRemoveUnnecessaryInlineSuppressionsDiagnosticAnalyzer
: AbstractRemoveUnnecessaryInlineSuppressionsDiagnosticAnalyzer
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@

namespace Microsoft.CodeAnalysis.RemoveUnnecessarySuppressions
{
#if !CODE_STYLE // Not exported in CodeStyle layer: https://github.com/dotnet/roslyn/issues/47942
[ExportCodeFixProvider(LanguageNames.CSharp, LanguageNames.VisualBasic, Name = PredefinedCodeFixProviderNames.RemoveUnnecessaryPragmaSuppressions), Shared]
#endif
internal sealed class RemoveUnnecessaryInlineSuppressionsCodeFixProvider : SyntaxEditorBasedCodeFixProvider
{
[ImportingConstructor]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ Imports Microsoft.CodeAnalysis.VisualBasic.LanguageServices

Namespace Microsoft.CodeAnalysis.VisualBasic.RemoveUnnecessarySuppressions

#If Not CODE_STYLE Then ' Not exported in CodeStyle layer: https://github.com/dotnet/roslyn/issues/47942
<DiagnosticAnalyzer(LanguageNames.VisualBasic)>
Friend NotInheritable Class VisualBasicRemoveUnnecessaryInlineSuppressionsDiagnosticAnalyzer
#Else
Friend NotInheritable Class VisualBasicRemoveUnnecessaryInlineSuppressionsDiagnosticAnalyzer
#End If
Inherits AbstractRemoveUnnecessaryInlineSuppressionsDiagnosticAnalyzer

Protected Overrides ReadOnly Property CompilerErrorCodePrefix As String = "BC"
Expand Down

0 comments on commit 315c5bf

Please sign in to comment.