diff --git a/src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs b/src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs
index 41713bd3d9c5b7687d6b0f0b7e55993ced1bfb8d..961ac64e1f5d5789ecb202cbd213fea376685e69 100644
--- a/src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs
+++ b/src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs
@@ -10770,7 +10770,7 @@ long M(int i)
// and info diagnostic is logged with programmatic suppression information.
var suppressor = new DiagnosticSuppressorForId("CS0078");
output = VerifyOutput(srcDirectory, srcFile, expectedInfoCount: 1, expectedWarningCount: 0, expectedErrorCount: 0,
- additionalFlags: new[] { "/warnAsError", "/features:DiagnosticSuppressor" },
+ additionalFlags: new[] { "/warnAsError" },
includeCurrentAssemblyAsAnalyzerReference: false,
analyzers: suppressor);
Assert.DoesNotContain($"error CS0078", output, StringComparison.Ordinal);
@@ -10824,21 +10824,20 @@ void M(int i)
suppressor.SuppressionDescriptor.Justification);
output = VerifyOutput(srcDirectory, srcFile, expectedInfoCount: 1, expectedWarningCount: 0, includeCurrentAssemblyAsAnalyzerReference: false,
- analyzers: suppressor,
- additionalFlags: new[] { "/features:DiagnosticSuppressor" });
+ analyzers: suppressor);
Assert.DoesNotContain($"warning CS1522", output, StringComparison.Ordinal);
Assert.Contains($"info SP0001", output, StringComparison.Ordinal);
Assert.Contains(suppressionMessage, output, StringComparison.Ordinal);
// Verify that compiler warning CS1522 is reported as error for /warnaserror.
output = VerifyOutput(srcDirectory, srcFile, expectedErrorCount: 1,
- additionalFlags: new[] { "/warnAsError", "/features:DiagnosticSuppressor" }, includeCurrentAssemblyAsAnalyzerReference: false);
+ additionalFlags: new[] { "/warnAsError" }, includeCurrentAssemblyAsAnalyzerReference: false);
Assert.Contains("error CS1522", output, StringComparison.Ordinal);
// Verify that compiler warning CS1522 is suppressed with diagnostic suppressor even with /warnaserror
// and info diagnostic is logged with programmatic suppression information.
output = VerifyOutput(srcDirectory, srcFile, expectedInfoCount: 1, expectedWarningCount: 0, expectedErrorCount: 0,
- additionalFlags: new[] { "/warnAsError", "/features:DiagnosticSuppressor" },
+ additionalFlags: new[] { "/warnAsError" },
includeCurrentAssemblyAsAnalyzerReference: false,
analyzers: suppressor);
Assert.DoesNotContain($"error CS1522", output, StringComparison.Ordinal);
@@ -10879,21 +10878,20 @@ class C
suppressor.SuppressionDescriptor.Justification);
output = VerifyOutput(srcDirectory, srcFile, expectedInfoCount: 1, expectedWarningCount: 0, includeCurrentAssemblyAsAnalyzerReference: false,
- analyzers: suppressor,
- additionalFlags: new[] { "/features:DiagnosticSuppressor" });
+ analyzers: suppressor);
Assert.DoesNotContain($"warning CS0169", output, StringComparison.Ordinal);
Assert.Contains("info SP0001", output, StringComparison.Ordinal);
Assert.Contains(suppressionMessage, output, StringComparison.Ordinal);
// Verify that compiler warning CS0169 is reported as error for /warnaserror.
output = VerifyOutput(srcDirectory, srcFile, expectedErrorCount: 1,
- additionalFlags: new[] { "/warnAsError", "/features:DiagnosticSuppressor" }, includeCurrentAssemblyAsAnalyzerReference: false);
+ additionalFlags: new[] { "/warnAsError" }, includeCurrentAssemblyAsAnalyzerReference: false);
Assert.Contains("error CS0169", output, StringComparison.Ordinal);
// Verify that compiler warning CS0169 is suppressed with diagnostic suppressor even with /warnaserror
// and info diagnostic is logged with programmatic suppression information.
output = VerifyOutput(srcDirectory, srcFile, expectedInfoCount: 1, expectedWarningCount: 0, expectedErrorCount: 0,
- additionalFlags: new[] { "/warnAsError", "/features:DiagnosticSuppressor" },
+ additionalFlags: new[] { "/warnAsError" },
includeCurrentAssemblyAsAnalyzerReference: false,
analyzers: suppressor);
Assert.DoesNotContain($"error CS0169", output, StringComparison.Ordinal);
@@ -10921,8 +10919,7 @@ class { }";
// Verify that compiler syntax error CS1001 cannot be suppressed with diagnostic suppressor.
output = VerifyOutput(srcDirectory, srcFile, expectedErrorCount: 1, includeCurrentAssemblyAsAnalyzerReference: false,
- analyzers: new DiagnosticSuppressorForId("CS1001"),
- additionalFlags: new[] { "/features:DiagnosticSuppressor" });
+ analyzers: new DiagnosticSuppressorForId("CS1001"));
Assert.Contains("error CS1001", output, StringComparison.Ordinal);
CleanupAllGeneratedFiles(srcFile.Path);
@@ -10948,8 +10945,7 @@ class C
// Verify that compiler error CS0246 cannot be suppressed with diagnostic suppressor.
output = VerifyOutput(srcDirectory, srcFile, expectedErrorCount: 1, includeCurrentAssemblyAsAnalyzerReference: false,
- analyzers: new DiagnosticSuppressorForId("CS0246"),
- additionalFlags: new[] { "/features:DiagnosticSuppressor" });
+ analyzers: new DiagnosticSuppressorForId("CS0246"));
Assert.Contains("error CS0246", output, StringComparison.Ordinal);
CleanupAllGeneratedFiles(srcFile.Path);
@@ -10986,15 +10982,14 @@ class C { }";
var analyzerAndSuppressor = new DiagnosticAnalyzer[] { analyzer, suppressor };
output = VerifyOutput(srcDirectory, srcFile, expectedInfoCount: 1, expectedWarningCount: 0,
includeCurrentAssemblyAsAnalyzerReference: false,
- analyzers: analyzerAndSuppressor,
- additionalFlags: new[] { "/features:DiagnosticSuppressor" });
+ analyzers: analyzerAndSuppressor);
Assert.DoesNotContain($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal);
Assert.Contains("info SP0001", output, StringComparison.Ordinal);
Assert.Contains(suppressionMessage, output, StringComparison.Ordinal);
// Verify that analyzer warning is reported as error for /warnaserror.
output = VerifyOutput(srcDirectory, srcFile, expectedErrorCount: 1,
- additionalFlags: new[] { "/warnAsError", "/features:DiagnosticSuppressor" },
+ additionalFlags: new[] { "/warnAsError" },
includeCurrentAssemblyAsAnalyzerReference: false,
analyzers: analyzer);
Assert.Contains($"error {analyzer.Descriptor.Id}", output, StringComparison.Ordinal);
@@ -11002,7 +10997,7 @@ class C { }";
// Verify that analyzer warning is suppressed with diagnostic suppressor even with /warnaserror
// and info diagnostic is logged with programmatic suppression information.
output = VerifyOutput(srcDirectory, srcFile, expectedInfoCount: 1, expectedWarningCount: 0,
- additionalFlags: new[] { "/warnAsError", "/features:DiagnosticSuppressor" },
+ additionalFlags: new[] { "/warnAsError" },
includeCurrentAssemblyAsAnalyzerReference: false,
analyzers: analyzerAndSuppressor);
Assert.DoesNotContain($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal);
@@ -11015,8 +11010,7 @@ class C { }";
analyzerAndSuppressor = new DiagnosticAnalyzer[] { analyzer, suppressor };
output = VerifyOutput(srcDirectory, srcFile, expectedWarningCount: 1,
includeCurrentAssemblyAsAnalyzerReference: false,
- analyzers: analyzerAndSuppressor,
- additionalFlags: new[] { "/features:DiagnosticSuppressor" });
+ analyzers: analyzerAndSuppressor);
Assert.Contains($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal);
CleanupAllGeneratedFiles(srcFile.Path);
@@ -11044,8 +11038,7 @@ class C { }";
var analyzerAndSuppressor = new DiagnosticAnalyzer[] { analyzer, suppressor };
output = VerifyOutput(srcDirectory, srcFile, expectedErrorCount: 1,
includeCurrentAssemblyAsAnalyzerReference: false,
- analyzers: analyzerAndSuppressor,
- additionalFlags: new[] { "/features:DiagnosticSuppressor" });
+ analyzers: analyzerAndSuppressor);
Assert.Contains($"error {analyzer.Descriptor.Id}", output, StringComparison.Ordinal);
CleanupAllGeneratedFiles(srcFile.Path);
diff --git a/src/Compilers/CSharp/Test/Semantic/Diagnostics/DiagnosticSuppressorTests.cs b/src/Compilers/CSharp/Test/Semantic/Diagnostics/DiagnosticSuppressorTests.cs
index 2fa0a50f2c502393a35582a91931d8a61cf997be..89994af6b23cdcbc8db7d9ae0da5f373be64129a 100644
--- a/src/Compilers/CSharp/Test/Semantic/Diagnostics/DiagnosticSuppressorTests.cs
+++ b/src/Compilers/CSharp/Test/Semantic/Diagnostics/DiagnosticSuppressorTests.cs
@@ -42,7 +42,7 @@ void M(int i)
}
}";
- var compilation = CreateCompilation(source, parseOptions: TestOptions.RegularWithDiagnosticSuppressorFeature);
+ var compilation = CreateCompilation(source);
compilation.VerifyDiagnostics(
// (7,9): warning CS1522: Empty switch block
// {
@@ -65,7 +65,7 @@ class C
// warning CS0169: The field 'C.f' is never used
private readonly int f;
}";
- var compilation = CreateCompilation(source, parseOptions: TestOptions.RegularWithDiagnosticSuppressorFeature);
+ var compilation = CreateCompilation(source);
compilation.VerifyDiagnostics(
// (5,26): warning CS0169: The field 'C.f' is never used
// private readonly int f;
@@ -85,7 +85,7 @@ public void TestNoSuppression_CompilerSyntaxError()
string source = @"
class { }";
- var compilation = CreateCompilation(source, parseOptions: TestOptions.RegularWithDiagnosticSuppressorFeature);
+ var compilation = CreateCompilation(source);
compilation.VerifyDiagnostics(
// (2,7): error CS1001: Identifier expected
@@ -106,7 +106,7 @@ class C
void M(UndefinedType x) { }
}";
- var compilation = CreateCompilation(source, parseOptions: TestOptions.RegularWithDiagnosticSuppressorFeature);
+ var compilation = CreateCompilation(source);
compilation.VerifyDiagnostics(
// (4,12): error CS0246: The type or namespace name 'UndefinedType' could not be found (are you missing a using directive or an assembly reference?)
@@ -123,7 +123,7 @@ public void TestSuppression_MultipleDiagnostics()
{
string source1 = @"class C1 { }";
string source2 = @"class C2 { }";
- var compilation = CreateCompilation(new[] { source1, source2 }, parseOptions: TestOptions.RegularWithDiagnosticSuppressorFeature);
+ var compilation = CreateCompilation(new[] { source1, source2 });
compilation.VerifyDiagnostics();
var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true);
@@ -141,7 +141,7 @@ public void TestSuppression_MultipleDiagnostics()
public void TestSuppression_MultipleSuppressors_SameDiagnostic()
{
string source = @"class C1 { }";
- var compilation = CreateCompilation(source, parseOptions: TestOptions.RegularWithDiagnosticSuppressorFeature);
+ var compilation = CreateCompilation(source);
compilation.VerifyDiagnostics();
var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true);
@@ -161,7 +161,7 @@ public void TestSuppression_MultipleSuppressors_SameDiagnostic()
public void TestSuppression_MultipleSuppressors_DifferentDiagnostic()
{
string source = @"class C1 { private readonly int f; }";
- var compilation = CreateCompilation(source, parseOptions: TestOptions.RegularWithDiagnosticSuppressorFeature);
+ var compilation = CreateCompilation(source);
compilation.VerifyDiagnostics(
// (1,33): warning CS0169: The field 'C1.f' is never used
// class C1 { private readonly int f; }
@@ -184,7 +184,7 @@ public void TestSuppression_MultipleSuppressors_DifferentDiagnostic()
public void TestNoSuppression_SpecificOptionsTurnsOffSuppressor()
{
string source = @"class C1 { }";
- var compilation = CreateCompilation(source, parseOptions: TestOptions.RegularWithDiagnosticSuppressorFeature);
+ var compilation = CreateCompilation(source);
compilation.VerifyDiagnostics();
var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true);
@@ -200,34 +200,12 @@ public void TestNoSuppression_SpecificOptionsTurnsOffSuppressor()
VerifySuppressedDiagnostics(compilation, analyzersAndSuppressors);
}
- [Fact, WorkItem(20242, "https://github.com/dotnet/roslyn/issues/20242")]
- public void TestDiagnosticOnMissingFeatureFlag()
- {
- string source = @"class C1 { }";
- var compilation = CreateCompilation(source);
- compilation.VerifyDiagnostics();
-
- var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true);
- var analyzerDiagnostic = Diagnostic(analyzer.Descriptor.Id, source);
- VerifyAnalyzerDiagnostics(compilation, new DiagnosticAnalyzer[] { analyzer }, analyzerDiagnostic);
-
- var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.Id, "SPR1001") };
- var expectedDiagnostics = new[]
- {
- analyzerDiagnostic,
- Diagnostic("AD0001").WithArguments("Microsoft.CodeAnalysis.CommonDiagnosticAnalyzers+DiagnosticSuppressorForId",
- "System.ArgumentException",
- CodeAnalysisResources.DiagnosticSuppressorFeatureDisabled).WithLocation(1, 1)
- };
- VerifyAnalyzerDiagnostics(compilation, analyzersAndSuppressors, expectedDiagnostics);
- }
-
[Fact, WorkItem(20242, "https://github.com/dotnet/roslyn/issues/20242")]
public void TestSuppression_AnalyzerDiagnostics_SeveritiesAndConfigurableMatrix()
{
string source = @"
class C { }";
- var compilation = CreateCompilation(source, parseOptions: TestOptions.RegularWithDiagnosticSuppressorFeature);
+ var compilation = CreateCompilation(source);
compilation.VerifyDiagnostics();
var configurations = new[] { false, true };
@@ -286,7 +264,7 @@ public void TestExceptionFromSuppressor()
string source = @"
class C { }";
- var compilation = CreateCompilation(source, parseOptions: TestOptions.RegularWithDiagnosticSuppressorFeature);
+ var compilation = CreateCompilation(source);
compilation.VerifyDiagnostics();
var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true);
@@ -315,7 +293,7 @@ public void TestUnsupportedSuppressionReported()
string source = @"
class C { }";
- var compilation = CreateCompilation(source, parseOptions: TestOptions.RegularWithDiagnosticSuppressorFeature);
+ var compilation = CreateCompilation(source);
compilation.VerifyDiagnostics();
const string supportedSuppressionId = "supportedId";
@@ -342,7 +320,7 @@ public void TestInvalidDiagnosticSuppressionReported()
{
string source = @"
class C { }";
- var compilation = CreateCompilation(source, parseOptions: TestOptions.RegularWithDiagnosticSuppressorFeature);
+ var compilation = CreateCompilation(source);
compilation.VerifyDiagnostics();
const string unsupportedSuppressedId = "UnsupportedId";
@@ -368,7 +346,7 @@ public void TestNonReportedDiagnosticCannotBeSuppressed()
{
string source = @"
class C { }";
- var compilation = CreateCompilation(source, parseOptions: TestOptions.RegularWithDiagnosticSuppressorFeature);
+ var compilation = CreateCompilation(source);
compilation.VerifyDiagnostics();
const string nonReportedDiagnosticId = "NonReportedId";
@@ -393,7 +371,7 @@ class C { }";
public void TestProgrammaticSuppressionInfo_DiagnosticSuppressor()
{
string source = @"class C1 { }";
- var compilation = CreateCompilation(source, parseOptions: TestOptions.RegularWithDiagnosticSuppressorFeature);
+ var compilation = CreateCompilation(source);
compilation.VerifyDiagnostics();
var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true);
diff --git a/src/Compilers/Core/Portable/CodeAnalysisResources.Designer.cs b/src/Compilers/Core/Portable/CodeAnalysisResources.Designer.cs
index 70ff75135da1371c37153c0f93938b86f0ce3120..7d5cb21fbc42f4c41520b1da0707c6bc2eb76659 100644
--- a/src/Compilers/Core/Portable/CodeAnalysisResources.Designer.cs
+++ b/src/Compilers/Core/Portable/CodeAnalysisResources.Designer.cs
@@ -458,15 +458,6 @@ internal class CodeAnalysisResources {
}
}
- ///
- /// Looks up a localized string similar to Feature 'DiagnosticSuppressor' is disabled..
- ///
- internal static string DiagnosticSuppressorFeatureDisabled {
- get {
- return ResourceManager.GetString("DiagnosticSuppressorFeatureDisabled", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Argument contains duplicate analyzer instances..
///
diff --git a/src/Compilers/Core/Portable/CodeAnalysisResources.resx b/src/Compilers/Core/Portable/CodeAnalysisResources.resx
index b65c5a5763ec72ed8af81cc3e3ec282bb98300f8..9328e25e04858af71adddf790f4ea1f932a15a8a 100644
--- a/src/Compilers/Core/Portable/CodeAnalysisResources.resx
+++ b/src/Compilers/Core/Portable/CodeAnalysisResources.resx
@@ -660,9 +660,6 @@
Invalid severity in analyzer config file.
-
- Feature 'DiagnosticSuppressor' is disabled.
-
Programmatic suppression of an analyzer diagnostic
diff --git a/src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalyzerDriver.cs b/src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalyzerDriver.cs
index 199bf994eac3802eb5f1cce36bac0df5055e75aa..e50e34d19612c5bcf64a4e976625082c82958ad8 100644
--- a/src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalyzerDriver.cs
+++ b/src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalyzerDriver.cs
@@ -25,9 +25,6 @@ internal abstract partial class AnalyzerDriver : IDisposable
// Protect against vicious analyzers that provide large values for SymbolKind.
private const int MaxSymbolKind = 100;
- // Feature flag for DiagnosticSuppressor feature
- internal const string DiagnosticSuppressorFeatureName = "DiagnosticSuppressor";
-
// Cache delegates for static methods
private static readonly Func s_IsCompilerAnalyzerFunc = IsCompilerAnalyzer;
diff --git a/src/Compilers/Core/Portable/DiagnosticAnalyzer/DiagnosticAnalysisContext.cs b/src/Compilers/Core/Portable/DiagnosticAnalyzer/DiagnosticAnalysisContext.cs
index fbd6f12c4d6ef02721a1ab93a71d38f4f5e1667e..c27d37a10ad94c629b4fa9f82b8f71d47e3dd6fe 100644
--- a/src/Compilers/Core/Portable/DiagnosticAnalyzer/DiagnosticAnalysisContext.cs
+++ b/src/Compilers/Core/Portable/DiagnosticAnalyzer/DiagnosticAnalysisContext.cs
@@ -1528,11 +1528,6 @@ public void ReportSuppression(Suppression suppression)
throw new ArgumentException(message);
}
- if (!Compilation.SyntaxTrees.Any(t => t.Options.Features.ContainsKey(AnalyzerDriver.DiagnosticSuppressorFeatureName)))
- {
- throw new ArgumentException(CodeAnalysisResources.DiagnosticSuppressorFeatureDisabled);
- }
-
if (suppression.Descriptor.IsDisabled(Compilation.Options))
{
// Suppression has been disabled by the end user through compilation options.
diff --git a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.cs.xlf b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.cs.xlf
index d22138e4de5870be13083899e6b1d04301e52f7d..c937f6db4141971d791851b1e03a2a39193fd454 100644
--- a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.cs.xlf
+++ b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.cs.xlf
@@ -19,11 +19,6 @@
{1}.
-
-
- Feature 'DiagnosticSuppressor' is disabled.
-
-
Suppressed diagnostic ID '{0}' does not match suppressable ID '{1}' for the given suppression descriptor.
diff --git a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.de.xlf b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.de.xlf
index 1ffb95b450454e8bbf695fe02f291528934600cc..e1ab670115998a247a653ba6100beeefaf76bf67 100644
--- a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.de.xlf
+++ b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.de.xlf
@@ -19,11 +19,6 @@
"{1}".
-
-
- Feature 'DiagnosticSuppressor' is disabled.
-
-
Suppressed diagnostic ID '{0}' does not match suppressable ID '{1}' for the given suppression descriptor.
diff --git a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.es.xlf b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.es.xlf
index 5c3ee9d48c76f093bb0915c23106411e29fad590..d7bb6a59216ad59be8cb08faa5274fe42c2ac7d5 100644
--- a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.es.xlf
+++ b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.es.xlf
@@ -19,11 +19,6 @@
'{1}'.
-
-
- Feature 'DiagnosticSuppressor' is disabled.
-
-
Suppressed diagnostic ID '{0}' does not match suppressable ID '{1}' for the given suppression descriptor.
diff --git a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.fr.xlf b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.fr.xlf
index 66f9c4870c0b4f1c525e04cd77301df53fdddf6f..4a7bf430f9209de51bd37393fcf6996dae120e2b 100644
--- a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.fr.xlf
+++ b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.fr.xlf
@@ -19,11 +19,6 @@
'{1}'.
-
-
- Feature 'DiagnosticSuppressor' is disabled.
-
-
Suppressed diagnostic ID '{0}' does not match suppressable ID '{1}' for the given suppression descriptor.
diff --git a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.it.xlf b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.it.xlf
index bbbb0179f64fa14126de1e29fd6f98e245f0a6d2..861bf631ce8ff35275805ddd39a36983d55f9893 100644
--- a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.it.xlf
+++ b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.it.xlf
@@ -19,11 +19,6 @@
'{1}'.
-
-
- Feature 'DiagnosticSuppressor' is disabled.
-
-
Suppressed diagnostic ID '{0}' does not match suppressable ID '{1}' for the given suppression descriptor.
diff --git a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.ja.xlf b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.ja.xlf
index 0f824e7f55fc677933ca3bbb002173f7e135cb79..935cc4f39d1618c03055b7c6c8b685dbb3e6326e 100644
--- a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.ja.xlf
+++ b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.ja.xlf
@@ -19,11 +19,6 @@
'{1}'。
-
-
- Feature 'DiagnosticSuppressor' is disabled.
-
-
Suppressed diagnostic ID '{0}' does not match suppressable ID '{1}' for the given suppression descriptor.
diff --git a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.ko.xlf b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.ko.xlf
index b5b92b6d8fe59bb06a70f62962b2e389c1238d13..ae0c9b74cda0d39e16e56a2352e50b934c95f563 100644
--- a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.ko.xlf
+++ b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.ko.xlf
@@ -19,11 +19,6 @@
'{1}'
-
-
- Feature 'DiagnosticSuppressor' is disabled.
-
-
Suppressed diagnostic ID '{0}' does not match suppressable ID '{1}' for the given suppression descriptor.
diff --git a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.pl.xlf b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.pl.xlf
index 0a7e3156f1a4017b1baf11a50a21a32fa54f2d41..c815dcb8c5fe6c177c7654bdb74cf2b987672baa 100644
--- a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.pl.xlf
+++ b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.pl.xlf
@@ -19,11 +19,6 @@
„{1}”.
-
-
- Feature 'DiagnosticSuppressor' is disabled.
-
-
Suppressed diagnostic ID '{0}' does not match suppressable ID '{1}' for the given suppression descriptor.
diff --git a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.pt-BR.xlf b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.pt-BR.xlf
index 5329f3b974e24c428982e728f9dba3e0c57370f9..9a9f74dbdb2337e094712d0d82b1ef5c1acf2a93 100644
--- a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.pt-BR.xlf
+++ b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.pt-BR.xlf
@@ -19,11 +19,6 @@
'{1}'.
-
-
- Feature 'DiagnosticSuppressor' is disabled.
-
-
Suppressed diagnostic ID '{0}' does not match suppressable ID '{1}' for the given suppression descriptor.
diff --git a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.ru.xlf b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.ru.xlf
index 0833b61fe2a849d6195c67bb0a8044eac89eca71..31e934ef5742eeeafa3f484b70f77f0a35f60c6e 100644
--- a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.ru.xlf
+++ b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.ru.xlf
@@ -19,11 +19,6 @@
"{1}".
-
-
- Feature 'DiagnosticSuppressor' is disabled.
-
-
Suppressed diagnostic ID '{0}' does not match suppressable ID '{1}' for the given suppression descriptor.
diff --git a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.tr.xlf b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.tr.xlf
index e4e79b770154d7240699068385781597665941d5..81a1779490d1f0152947c8f20ada6a5cffb0d782 100644
--- a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.tr.xlf
+++ b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.tr.xlf
@@ -19,11 +19,6 @@
'{1}'.
-
-
- Feature 'DiagnosticSuppressor' is disabled.
-
-
Suppressed diagnostic ID '{0}' does not match suppressable ID '{1}' for the given suppression descriptor.
diff --git a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.zh-Hans.xlf b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.zh-Hans.xlf
index 871a092330ade50dd9f4ffebf1fb0c466a933bf0..1b5d1e8cab659b63fa34f63b1a6a5111da2ceef4 100644
--- a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.zh-Hans.xlf
+++ b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.zh-Hans.xlf
@@ -19,11 +19,6 @@
“{1}”。
-
-
- Feature 'DiagnosticSuppressor' is disabled.
-
-
Suppressed diagnostic ID '{0}' does not match suppressable ID '{1}' for the given suppression descriptor.
diff --git a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.zh-Hant.xlf b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.zh-Hant.xlf
index 1bb389e919ddb0acee67e6fec87bc6caa90eca50..04f98da3f5a70b31ba21f746775997665b5bb8fd 100644
--- a/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.zh-Hant.xlf
+++ b/src/Compilers/Core/Portable/xlf/CodeAnalysisResources.zh-Hant.xlf
@@ -19,11 +19,6 @@
'{1}'。
-
-
- Feature 'DiagnosticSuppressor' is disabled.
-
-
Suppressed diagnostic ID '{0}' does not match suppressable ID '{1}' for the given suppression descriptor.
diff --git a/src/Compilers/Test/Utilities/CSharp/TestOptions.cs b/src/Compilers/Test/Utilities/CSharp/TestOptions.cs
index 6355db7e1fec4497ae2bf00169d9d609c41f62c1..1b881553e0753f0878873f32a181830819bdb289 100644
--- a/src/Compilers/Test/Utilities/CSharp/TestOptions.cs
+++ b/src/Compilers/Test/Utilities/CSharp/TestOptions.cs
@@ -43,8 +43,6 @@ public static class TestOptions
public static readonly CSharpParseOptions RegularWithoutRecursivePatterns = Regular7_3;
public static readonly CSharpParseOptions RegularWithRecursivePatterns = Regular8;
- public static readonly CSharpParseOptions RegularWithDiagnosticSuppressorFeature = Regular.WithDiagnosticSuppressorFeature();
-
public static readonly CSharpCompilationOptions ReleaseDll = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel: OptimizationLevel.Release);
public static readonly CSharpCompilationOptions ReleaseExe = new CSharpCompilationOptions(OutputKind.ConsoleApplication, optimizationLevel: OptimizationLevel.Release);
@@ -136,11 +134,6 @@ public static CSharpCompilationOptions WithSpecificDiagnosticOptions(this CSharp
{
return options.WithSpecificDiagnosticOptions(ImmutableDictionary.Empty.Add(key1, value).Add(key2, value));
}
-
- public static CSharpParseOptions WithDiagnosticSuppressorFeature(this CSharpParseOptions options)
- {
- return options.WithFeatures(options.Features.Concat(new[] { new KeyValuePair(AnalyzerDriver.DiagnosticSuppressorFeatureName, "true") }));
- }
}
}
diff --git a/src/Compilers/Test/Utilities/VisualBasic/TestOptions.vb b/src/Compilers/Test/Utilities/VisualBasic/TestOptions.vb
index b8208481066971f2fe4f6b94e9709fedcbce51b8..c0f53e7162ed79ae0b53f5bae74cd67243163762 100644
--- a/src/Compilers/Test/Utilities/VisualBasic/TestOptions.vb
+++ b/src/Compilers/Test/Utilities/VisualBasic/TestOptions.vb
@@ -11,7 +11,6 @@ Public Class TestOptions
Public Shared ReadOnly Regular As New VisualBasicParseOptions(kind:=SourceCodeKind.Regular, languageVersion:=LanguageVersion.VisualBasic16)
Public Shared ReadOnly Regular15_5 As VisualBasicParseOptions = Regular.WithLanguageVersion(LanguageVersion.VisualBasic15_5)
Public Shared ReadOnly RegularWithLegacyStrongName As VisualBasicParseOptions = Regular.WithFeature("UseLegacyStrongNameProvider")
- Public Shared ReadOnly RegularWithDiagnosticSuppressorFeature As VisualBasicParseOptions = Regular.WithDiagnosticSuppressorFeature()
Public Shared ReadOnly ReleaseDll As VisualBasicCompilationOptions = New VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel:=OptimizationLevel.Release).WithParseOptions(Regular)
Public Shared ReadOnly ReleaseExe As VisualBasicCompilationOptions = New VisualBasicCompilationOptions(OutputKind.ConsoleApplication, optimizationLevel:=OptimizationLevel.Release).WithParseOptions(Regular)
@@ -62,9 +61,4 @@ Friend Module TestOptionExtensions
Next
Return options.WithFeatures(options.Features.Concat(list))
End Function
-
-
- Public Function WithDiagnosticSuppressorFeature(options As VisualBasicParseOptions) As VisualBasicParseOptions
- Return options.WithFeatures(options.Features.Concat({New KeyValuePair(Of String, String)(AnalyzerDriver.DiagnosticSuppressorFeatureName, "true")}))
- End Function
End Module
diff --git a/src/Compilers/VisualBasic/Test/CommandLine/CommandLineTests.vb b/src/Compilers/VisualBasic/Test/CommandLine/CommandLineTests.vb
index 72d4e6fc636db512afaed4eb95a55bbc1b3ee1ae..a1f9064511d2a467012e6c655dc1b3680a321a2b 100644
--- a/src/Compilers/VisualBasic/Test/CommandLine/CommandLineTests.vb
+++ b/src/Compilers/VisualBasic/Test/CommandLine/CommandLineTests.vb
@@ -9377,8 +9377,7 @@ End Class"
Dim suppressors = ImmutableArray.Create(Of DiagnosticAnalyzer)(suppressor)
output = VerifyOutput(dir, file, expectedInfoCount:=1, expectedWarningCount:=0,
includeCurrentAssemblyAsAnalyzerReference:=False,
- analyzers:=suppressors,
- additionalFlags:={"/features:DiagnosticSuppressor"})
+ analyzers:=suppressors)
Assert.DoesNotContain("warning BC40008", output, StringComparison.Ordinal)
Assert.Contains("info SP0001", output, StringComparison.Ordinal)
Assert.Contains(suppressionMessage, output, StringComparison.Ordinal)
@@ -9410,7 +9409,7 @@ End Class"
Assert.Contains("warning BC40008", output, StringComparison.Ordinal)
' Verify that compiler warning BC40008 is reported as error for /warnaserror.
- output = VerifyOutput(dir, file, expectedErrorCount:=1, additionalFlags:={"/warnaserror+", "/features:DiagnosticSuppressor"},
+ output = VerifyOutput(dir, file, expectedErrorCount:=1, additionalFlags:={"/warnaserror+"},
includeCurrentAssemblyAsAnalyzerReference:=False)
Assert.Contains("error BC40008", output, StringComparison.Ordinal)
@@ -9420,7 +9419,7 @@ End Class"
Dim suppressors = ImmutableArray.Create(Of DiagnosticAnalyzer)(suppressor)
output = VerifyOutput(dir, file, expectedInfoCount:=1, expectedWarningCount:=0, expectedErrorCount:=0,
- additionalFlags:={"/warnaserror+", "/features:DiagnosticSuppressor"},
+ additionalFlags:={"/warnaserror+"},
includeCurrentAssemblyAsAnalyzerReference:=False,
analyzers:=suppressors)
Assert.DoesNotContain($"warning BC40008", output, StringComparison.Ordinal)
@@ -9458,8 +9457,7 @@ End Class"
Dim analyzers = ImmutableArray.Create(Of DiagnosticAnalyzer)(New DiagnosticSuppressorForId("BC30203"))
output = VerifyOutput(dir, file, expectedErrorCount:=1,
includeCurrentAssemblyAsAnalyzerReference:=False,
- analyzers:=analyzers,
- additionalFlags:={"/features:DiagnosticSuppressor"})
+ analyzers:=analyzers)
Assert.Contains("error BC30203", output, StringComparison.Ordinal)
CleanupAllGeneratedFiles(file.Path)
@@ -9497,15 +9495,14 @@ End Class"
Dim analyzerAndSuppressor = ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer, suppressor)
output = VerifyOutput(dir, file, expectedInfoCount:=1, expectedWarningCount:=0,
includeCurrentAssemblyAsAnalyzerReference:=False,
- analyzers:=analyzerAndSuppressor,
- additionalFlags:={"/features:DiagnosticSuppressor"})
+ analyzers:=analyzerAndSuppressor)
Assert.DoesNotContain($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal)
Assert.Contains("info SP0001", output, StringComparison.Ordinal)
Assert.Contains(suppressionMessage, output, StringComparison.Ordinal)
' Verify that analyzer warning is reported as error for /warnaserror.
output = VerifyOutput(dir, file, expectedErrorCount:=1,
- additionalFlags:={"/warnaserror+", "/features:DiagnosticSuppressor"},
+ additionalFlags:={"/warnaserror+"},
includeCurrentAssemblyAsAnalyzerReference:=False,
analyzers:=analyzers)
Assert.Contains($"error {analyzer.Descriptor.Id}", output, StringComparison.Ordinal)
@@ -9513,7 +9510,7 @@ End Class"
' Verify that analyzer warning is suppressed with diagnostic suppressor even with /warnaserror
' and info diagnostic is logged with programmatic suppression information.
output = VerifyOutput(dir, file, expectedInfoCount:=1, expectedWarningCount:=0, expectedErrorCount:=0,
- additionalFlags:={"/warnaserror+", "/features:DiagnosticSuppressor"},
+ additionalFlags:={"/warnaserror+"},
includeCurrentAssemblyAsAnalyzerReference:=False,
analyzers:=analyzerAndSuppressor)
Assert.DoesNotContain($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal)
@@ -9526,8 +9523,7 @@ End Class"
analyzerAndSuppressor = ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer, suppressor)
output = VerifyOutput(dir, file, expectedWarningCount:=1,
includeCurrentAssemblyAsAnalyzerReference:=False,
- analyzers:=analyzerAndSuppressor,
- additionalFlags:={"/features:DiagnosticSuppressor"})
+ analyzers:=analyzerAndSuppressor)
Assert.Contains($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal)
CleanupAllGeneratedFiles(file.Path)
@@ -9556,8 +9552,7 @@ End Class"
Dim analyzerAndSuppressor = ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer, suppressor)
output = VerifyOutput(dir, file, expectedErrorCount:=1,
includeCurrentAssemblyAsAnalyzerReference:=False,
- analyzers:=analyzerAndSuppressor,
- additionalFlags:={"/features:DiagnosticSuppressor"})
+ analyzers:=analyzerAndSuppressor)
Assert.Contains($"error {analyzer.Descriptor.Id}", output, StringComparison.Ordinal)
CleanupAllGeneratedFiles(file.Path)