6 instantiations of NotificationOption2
Microsoft.CodeAnalysis.BannedApiAnalyzers (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\NotificationOption2.cs (6)
21public static NotificationOption2 None => new(ReportDiagnostic.Suppress, false); 26public static NotificationOption2 Silent => new(ReportDiagnostic.Hidden, false); 31public static NotificationOption2 Suggestion => new(ReportDiagnostic.Info, false); 36public static NotificationOption2 Warning => new(ReportDiagnostic.Warn, false); 41public static NotificationOption2 Error => new(ReportDiagnostic.Error, false); 44=> new(Severity, isExplicitlySpecified);
72 references to NotificationOption2
Microsoft.CodeAnalysis.BannedApiAnalyzers (72)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\AddImport\AddImportPlacementOptions.cs (1)
14new(AddImportPlacement.OutsideNamespace, NotificationOption2.Silent);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (16)
20arg, defaultValue.Notification, out var value, out var notification)) 33arg, defaultValue.Notification, out var value, out var notification)) 54=> TryGetCodeStyleValueAndOptionalNotification(arg, defaultNotification: NotificationOption2.None, out value, out _); 59/// in <paramref name="value"/> and <see cref="NotificationOption2.Error"/> will be returned 64string arg, NotificationOption2 defaultNotification, [NotNullWhen(true)] out string? value, [NotNullWhen(true)] out NotificationOption2 notification) 81if (TryParseNotification(arg.AsSpan(firstColonIndex + 1), out var localNotification)) 96private static bool TryParseNotification(ReadOnlySpan<char> value, out NotificationOption2 notification) 101notification = NotificationOption2.None; 106notification = NotificationOption2.Silent; 109case EditorConfigSeverityStrings.Suggestion: notification = NotificationOption2.Suggestion; return true; 110case EditorConfigSeverityStrings.Warning: notification = NotificationOption2.Warning; return true; 111case EditorConfigSeverityStrings.Error: notification = NotificationOption2.Error; return true; 114notification = NotificationOption2.Silent; 156new(default, NotificationOption2.None); 174defaultCodeStyleOption.Notification, out var value, out var notification))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (15)
21NotificationOption2 Notification { get; } 23ICodeStyleOption2 WithNotification(NotificationOption2 notification); 41public static readonly CodeStyleOption2<bool> TrueWithSilentEnforcement = new(value: true, notification: NotificationOption2.Silent); 42public static readonly CodeStyleOption2<bool> FalseWithSilentEnforcement = new(value: false, notification: NotificationOption2.Silent); 43public static readonly CodeStyleOption2<bool> TrueWithSuggestionEnforcement = new(value: true, notification: NotificationOption2.Suggestion); 44public static readonly CodeStyleOption2<bool> FalseWithSuggestionEnforcement = new(value: false, notification: NotificationOption2.Suggestion); 49public static CodeStyleOption2<bool> GetCodeStyle(bool value, NotificationOption2 notification) 75internal sealed partial class CodeStyleOption2<T>(T value, NotificationOption2 notification) : ICodeStyleOption2, IEquatable<CodeStyleOption2<T>?> 77public static readonly CodeStyleOption2<T> Default = new(default!, NotificationOption2.Silent); 91public NotificationOption2 Notification { get; } = notification; 95ICodeStyleOption2 ICodeStyleOption2.WithNotification(NotificationOption2 notification) => new CodeStyleOption2<T>(Value, notification); 192DiagnosticSeverity.Hidden => NotificationOption2.Silent, 193DiagnosticSeverity.Info => NotificationOption2.Suggestion, 194DiagnosticSeverity.Warning => NotificationOption2.Warning, 195DiagnosticSeverity.Error => NotificationOption2.Error,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (11)
97defaultValue: new CodeStyleOption2<CollectionExpressionPreference>(CollectionExpressionPreference.WhenTypesLooselyMatch, NotificationOption2.Suggestion), 180defaultValue: new CodeStyleOption2<UnusedParametersPreference>(UnusedParametersPreference.AllMethods, NotificationOption2.Suggestion), 184if (CodeStyleHelpers.TryGetCodeStyleValueAndOptionalNotification(str, defaultValue.Notification, out var value, out var notification)) 209defaultValue: new CodeStyleOption2<AccessibilityModifiersRequired>(SyntaxFormattingOptions.CommonDefaults.AccessibilityModifiersRequired, NotificationOption2.Silent), 213if (CodeStyleHelpers.TryGetCodeStyleValueAndOptionalNotification(str, defaultValue.Notification, out var value, out var notificationOpt)) 259if (CodeStyleHelpers.TryGetCodeStyleValueAndOptionalNotification(str, defaultValue.Notification, out var value, out var notification)) 275new(ParenthesesPreference.AlwaysForClarity, NotificationOption2.Silent); 294defaultValue: new(ParenthesesPreference.NeverIfUnnecessary, NotificationOption2.Silent), 307defaultValue: new CodeStyleOption2<ForEachExplicitCastInSourcePreference>(ForEachExplicitCastInSourcePreference.WhenStronglyTyped, NotificationOption2.Suggestion), 311if (CodeStyleHelpers.TryGetCodeStyleValueAndOptionalNotification(str, defaultValue.Notification, out var value, out var notification)) 331defaultValue: new CodeStyleOption2<bool>(value: true, notification: NotificationOption2.Suggestion));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CollectionExpressionPreference.cs (1)
41optionString, defaultValue.Notification, out var value, out var notification))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\NotificationOption2.cs (9)
13/// <completionlist cref="NotificationOption2"/> 21public static NotificationOption2 None => new(ReportDiagnostic.Suppress, false); 26public static NotificationOption2 Silent => new(ReportDiagnostic.Hidden, false); 31public static NotificationOption2 Suggestion => new(ReportDiagnostic.Info, false); 36public static NotificationOption2 Warning => new(ReportDiagnostic.Warn, false); 41public static NotificationOption2 Error => new(ReportDiagnostic.Error, false); 43public NotificationOption2 WithIsExplicitlySpecified(bool isExplicitlySpecified) 46public static NotificationOption2 ForSeverity(ReportDiagnostic reportDiagnostic) 57public static NotificationOption2 ForSeverity(DiagnosticSeverity severity)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\VisualBasic\VisualBasicCodeStyleOptions.cs (3)
31"Dim,Const,WithEvents,Widening,Narrowing,Custom,Async,Iterator", NotificationOption2.Silent)); 46defaultValue: new CodeStyleOption2<UnusedValuePreference>(UnusedValuePreference.UnusedLocalVariable, NotificationOption2.Silent), 52defaultValue: new CodeStyleOption2<UnusedValuePreference>(UnusedValuePreference.UnusedLocalVariable, NotificationOption2.Suggestion),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticSeverityExtensions.cs (6)
11public static NotificationOption2 ToNotificationOption(this DiagnosticSeverity severity, bool isOverridenSeverity) 13var notificationOption = severity switch 15DiagnosticSeverity.Error => NotificationOption2.Error, 16DiagnosticSeverity.Warning => NotificationOption2.Warning, 17DiagnosticSeverity.Info => NotificationOption2.Suggestion, 18DiagnosticSeverity.Hidden => NotificationOption2.Silent,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\NotificationOptionExtensions.cs (1)
11public static string ToEditorConfigString(this NotificationOption2 notificationOption)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ReportDiagnosticExtensions.cs (7)
25public static NotificationOption2 ToNotificationOption(this ReportDiagnostic reportDiagnostic, DiagnosticSeverity defaultSeverity) 28var notificationOption = reportDiagnostic.WithDefaultSeverity(defaultSeverity) switch 30ReportDiagnostic.Error => NotificationOption2.Error, 31ReportDiagnostic.Warn => NotificationOption2.Warning, 32ReportDiagnostic.Info => NotificationOption2.Suggestion, 33ReportDiagnostic.Hidden => NotificationOption2.Silent, 34ReportDiagnostic.Suppress => NotificationOption2.None,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractMemberAccessExpressionSimplifier.cs (2)
37out NotificationOption2 notificationOption, 40notificationOption = NotificationOption2.Silent;