6 instantiations of NotificationOption2
Microsoft.CodeAnalysis.CodeStyle (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);
115 references to NotificationOption2
Microsoft.CodeAnalysis.CodeStyle (111)
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (10)
90protected bool ShouldSkipAnalysis(SemanticModelAnalysisContext context, NotificationOption2? notification) 93protected bool ShouldSkipAnalysis(SyntaxNodeAnalysisContext context, NotificationOption2? notification) 96protected bool ShouldSkipAnalysis(SyntaxTreeAnalysisContext context, CompilationOptions compilationOptions, NotificationOption2? notification) 99protected bool ShouldSkipAnalysis(CodeBlockAnalysisContext context, NotificationOption2? notification) 102protected bool ShouldSkipAnalysis(OperationAnalysisContext context, NotificationOption2? notification) 105protected bool ShouldSkipAnalysis(OperationBlockAnalysisContext context, NotificationOption2? notification) 112NotificationOption2? notification, 120ImmutableArray<NotificationOption2> notifications, 134foreach (var notification in notifications) 150NotificationOption2? notification,
src\Analyzers\Core\Analyzers\AddRequiredParentheses\AbstractAddRequiredParenthesesDiagnosticAnalyzer.cs (1)
132NotificationOption2 notificationOption, ImmutableArray<Location> additionalLocations,
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (8)
42NotificationOption2 notificationOption, 90NotificationOption2 notificationOption, 109NotificationOption2 notificationOption, 158NotificationOption2 notificationOption, 179NotificationOption2 notificationOption, 205NotificationOption2 notificationOption, 257NotificationOption2 notificationOption, 286static IEnumerable<string> GetEffectiveCustomTags(DiagnosticDescriptor descriptor, NotificationOption2 notificationOption, AnalyzerOptions analyzerOptions)
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (1)
167return DiagnosticHelper.Create(Descriptor, symbol.Locations.First(), NotificationOption2.ForSeverity(applicableRule.EnforcementLevel), options, additionalLocations: null, builder.ToImmutable(), failureReason);
src\Analyzers\Core\Analyzers\NewLines\ConsecutiveStatementPlacement\AbstractConsecutiveStatementPlacementDiagnosticAnalyzer.cs (2)
49private void Recurse(SyntaxTreeAnalysisContext context, NotificationOption2 notificationOption, SyntaxNode node, CancellationToken cancellationToken) 67private void ProcessBlockLikeStatement(SyntaxTreeAnalysisContext context, NotificationOption2 notificationOption, SyntaxNode block)
src\Analyzers\Core\Analyzers\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesDiagnosticAnalyzer.cs (2)
46NotificationOption2 notificationOption, 68private void CheckToken(SyntaxTreeAnalysisContext context, NotificationOption2 notificationOption, SyntaxToken token)
src\Analyzers\Core\Analyzers\OrderModifiers\AbstractOrderModifiersDiagnosticAnalyzer.cs (2)
63NotificationOption2 notificationOption, 69NotificationOption2 notificationOption,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
621NotificationOption2.ForSeverity(rule.DefaultSeverity),
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (8)
224(UnusedValuePreference preference, NotificationOption2 notification) GetPreferenceAndSeverity(CodeStyleOption2<UnusedValuePreference> option) 229return (default(UnusedValuePreference), NotificationOption2.None); 247private readonly NotificationOption2 _unusedParametersSeverity; 251NotificationOption2 unusedValueExpressionStatementSeverity, 253NotificationOption2 unusedValueAssignmentSeverity, 255NotificationOption2 unusedParametersSeverity) 270public NotificationOption2 UnusedValueExpressionStatementNotification { get; } 272public NotificationOption2 UnusedValueAssignmentSeverity { get; }
src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (2)
84protected static ImmutableArray<NotificationOption2> GetAllNotifications(SimplifierOptions options) 138NotificationOption2 notificationOption;
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
379var notification = preferAutoProps.Notification;
src\Analyzers\Core\Analyzers\UseAutoProperty\AnalysisResult.cs (1)
36NotificationOption2 Notification,
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (2)
182var notification = shouldUseCollectionExpression ? preferExpressionOption.Notification : preferInitializerOption.Notification; 260NotificationOption2.ForSeverity(s_unnecessaryCodeDescriptor.DefaultSeverity),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\AddImport\AddImportPlacementOptions.cs (1)
14new(AddImportPlacement.OutsideNamespace, NotificationOption2.Silent);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (16)
19arg, defaultValue.Notification, out var value, out var notification)) 32arg, defaultValue.Notification, out var value, out var notification)) 53=> TryGetCodeStyleValueAndOptionalNotification(arg, defaultNotification: NotificationOption2.None, out value, out _); 58/// in <paramref name="value"/> and <see cref="NotificationOption2.Error"/> will be returned 63string arg, NotificationOption2 defaultNotification, [NotNullWhen(true)] out string? value, [NotNullWhen(true)] out NotificationOption2 notification) 80if (TryParseNotification(arg.AsSpan(firstColonIndex + 1), out var localNotification)) 95private static bool TryParseNotification(ReadOnlySpan<char> value, out NotificationOption2 notification) 100notification = NotificationOption2.None; 105notification = NotificationOption2.Silent; 108case EditorConfigSeverityStrings.Suggestion: notification = NotificationOption2.Suggestion; return true; 109case EditorConfigSeverityStrings.Warning: notification = NotificationOption2.Warning; return true; 110case EditorConfigSeverityStrings.Error: notification = NotificationOption2.Error; return true; 113notification = NotificationOption2.Silent; 155new(default, NotificationOption2.None); 173defaultCodeStyleOption.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)
96defaultValue: new CodeStyleOption2<CollectionExpressionPreference>(CollectionExpressionPreference.WhenTypesLooselyMatch, NotificationOption2.Suggestion), 179defaultValue: new CodeStyleOption2<UnusedParametersPreference>(UnusedParametersPreference.AllMethods, NotificationOption2.Suggestion), 183if (CodeStyleHelpers.TryGetCodeStyleValueAndOptionalNotification(str, defaultValue.Notification, out var value, out var notification)) 208defaultValue: new CodeStyleOption2<AccessibilityModifiersRequired>(SyntaxFormattingOptions.CommonDefaults.AccessibilityModifiersRequired, NotificationOption2.Silent), 212if (CodeStyleHelpers.TryGetCodeStyleValueAndOptionalNotification(str, defaultValue.Notification, out var value, out var notificationOpt)) 258if (CodeStyleHelpers.TryGetCodeStyleValueAndOptionalNotification(str, defaultValue.Notification, out var value, out var notification)) 274new(ParenthesesPreference.AlwaysForClarity, NotificationOption2.Silent); 293defaultValue: new(ParenthesesPreference.NeverIfUnnecessary, NotificationOption2.Silent), 306defaultValue: new CodeStyleOption2<ForEachExplicitCastInSourcePreference>(ForEachExplicitCastInSourcePreference.WhenStronglyTyped, NotificationOption2.Suggestion), 310if (CodeStyleHelpers.TryGetCodeStyleValueAndOptionalNotification(str, defaultValue.Notification, out var value, out var notification)) 330defaultValue: 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)
83public static NotificationOption2 ToNotificationOption(this ReportDiagnostic reportDiagnostic, DiagnosticSeverity defaultSeverity) 86var notificationOption = reportDiagnostic.WithDefaultSeverity(defaultSeverity) switch 88ReportDiagnostic.Error => NotificationOption2.Error, 89ReportDiagnostic.Warn => NotificationOption2.Warning, 90ReportDiagnostic.Info => NotificationOption2.Suggestion, 91ReportDiagnostic.Hidden => NotificationOption2.Silent, 92ReportDiagnostic.Suppress => NotificationOption2.None,
Microsoft.CodeAnalysis.CSharp.CodeStyle (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions_Parsing.cs (4)
18@default.Notification, out var value, out var notification)) 52optionString, @default.Notification, out var value, out var notification)) 82optionString, @default.Notification, out var value, out var notification)) 114out var notificationOption))