提交 8305bae9 编写于 作者: S Sam Harwell

Map 'none' in .editorconfig to ReportDiagnostic.Suppress

Fixes #26972
上级 26de379c
......@@ -95,6 +95,9 @@ public static bool TryParseNotification(string value, out NotificationOption not
switch (value.Trim())
{
case EditorConfigSeverityStrings.None:
notification = NotificationOption.None;
return true;
case EditorConfigSeverityStrings.Silent:
notification = NotificationOption.Silent;
return true;
......
......@@ -29,6 +29,7 @@ public DiagnosticSeverity Value
set => Severity = value.ToReportDiagnostic();
}
public static readonly NotificationOption None = new NotificationOption(WorkspacesResources.None, ReportDiagnostic.Suppress);
public static readonly NotificationOption Silent = new NotificationOption(WorkspacesResources.None, ReportDiagnostic.Hidden);
public static readonly NotificationOption Suggestion = new NotificationOption(WorkspacesResources.Suggestion, ReportDiagnostic.Info);
public static readonly NotificationOption Warning = new NotificationOption(WorkspacesResources.Warning, ReportDiagnostic.Warn);
......
......@@ -50,6 +50,8 @@ private static ReportDiagnostic ParseEnforcementLevel(string ruleSeverity)
switch (ruleSeverity)
{
case EditorConfigSeverityStrings.None:
return ReportDiagnostic.Suppress;
case EditorConfigSeverityStrings.Silent:
return ReportDiagnostic.Hidden;
......
*REMOVED*static readonly Microsoft.CodeAnalysis.CodeStyle.NotificationOption.None -> Microsoft.CodeAnalysis.CodeStyle.NotificationOption
Microsoft.CodeAnalysis.CodeStyle.NotificationOption.Severity.get -> Microsoft.CodeAnalysis.ReportDiagnostic
Microsoft.CodeAnalysis.CodeStyle.NotificationOption.Severity.set -> void
abstract Microsoft.CodeAnalysis.Editing.SyntaxGenerator.AliasImportDeclaration(string aliasIdentifierName, Microsoft.CodeAnalysis.SyntaxNode name) -> Microsoft.CodeAnalysis.SyntaxNode
......
......@@ -13,13 +13,13 @@ namespace Microsoft.CodeAnalysis.UnitTests.CodeStyle
public class EditorConfigCodeStyleParserTests
{
[Theory]
[InlineData("true:none", true, ReportDiagnostic.Hidden)]
[InlineData("true:none", true, ReportDiagnostic.Suppress)]
[InlineData("true:silent", true, ReportDiagnostic.Hidden)]
[InlineData("true:suggestion", true, ReportDiagnostic.Info)]
[InlineData("true:warning", true, ReportDiagnostic.Warn)]
[InlineData("true:error", true, ReportDiagnostic.Error)]
[InlineData("true", false, ReportDiagnostic.Hidden)]
[InlineData("false:none", false, ReportDiagnostic.Hidden)]
[InlineData("false:none", false, ReportDiagnostic.Suppress)]
[InlineData("false:silent", false, ReportDiagnostic.Hidden)]
[InlineData("false:suggestion", false, ReportDiagnostic.Info)]
[InlineData("false:warning", false, ReportDiagnostic.Warn)]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册