7 instantiations of NotificationOption2
Microsoft.CodeAnalysis.Workspaces (7)
CodeStyle\CodeStyleOption.cs (1)
34
: this(new CodeStyleOption2<T>(value, new
NotificationOption2
(notification.Severity, IsExplicitlySpecified: false)))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\NotificationOption2.cs (6)
21
public static NotificationOption2 None =>
new
(ReportDiagnostic.Suppress, false);
26
public static NotificationOption2 Silent =>
new
(ReportDiagnostic.Hidden, false);
31
public static NotificationOption2 Suggestion =>
new
(ReportDiagnostic.Info, false);
36
public static NotificationOption2 Warning =>
new
(ReportDiagnostic.Warn, false);
41
public static NotificationOption2 Error =>
new
(ReportDiagnostic.Error, false);
44
=>
new
(Severity, isExplicitlySpecified);
99 references to NotificationOption2
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions_Parsing.cs (4)
18
@default.Notification, out var value, out
var
notification))
52
optionString, @default.Notification, out var value, out
var
notification))
82
optionString, @default.Notification, out var value, out
var
notification))
114
out
var
notificationOption))
Microsoft.CodeAnalysis.EditorFeatures (1)
EditorConfigSettings\Data\CodeStyleSetting.cs (1)
36
var
notification = severity switch
Microsoft.CodeAnalysis.Features (3)
SimplifyThisOrMe\AbstractSimplifyThisOrMeDiagnosticAnalyzer.cs (1)
62
memberAccessExpression, semanticModel, simplifierOptions, out var thisExpression, out
var
notification, cancellationToken)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
379
var
notification = preferAutoProps.Notification;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (1)
182
var
notification = shouldUseCollectionExpression ? preferExpressionOption.Notification : preferInitializerOption.Notification;
Microsoft.CodeAnalysis.Workspaces (91)
CodeStyle\CodeStyleOption.cs (4)
20
NotificationOption2
Notification { get; }
22
ICodeStyleOption WithNotification(
NotificationOption2
notification);
47
NotificationOption2
ICodeStyleOption.Notification => UnderlyingOption.Notification;
49
ICodeStyleOption ICodeStyleOption.WithNotification(
NotificationOption2
notification) => new CodeStyleOption<T>(Value, (NotificationOption)notification);
CodeStyle\NotificationOption.cs (14)
10
/// <inheritdoc cref="
NotificationOption2
"/>
13
private readonly
NotificationOption2
_notificationOptionImpl;
26
/// <inheritdoc cref="
NotificationOption2
.Severity"/>
42
/// <inheritdoc cref="
NotificationOption2
.None"/>
43
public static readonly NotificationOption None = new(
NotificationOption2
.None);
45
/// <inheritdoc cref="
NotificationOption2
.Silent"/>
46
public static readonly NotificationOption Silent = new(
NotificationOption2
.Silent);
48
/// <inheritdoc cref="
NotificationOption2
.Suggestion"/>
49
public static readonly NotificationOption Suggestion = new(
NotificationOption2
.Suggestion);
51
/// <inheritdoc cref="
NotificationOption2
.Warning"/>
52
public static readonly NotificationOption Warning = new(
NotificationOption2
.Warning);
54
/// <inheritdoc cref="
NotificationOption2
.Error"/>
55
public static readonly NotificationOption Error = new(
NotificationOption2
.Error);
57
private NotificationOption(
NotificationOption2
notificationOptionImpl)
CodeStyle\NotificationOption2_operators.cs (1)
9
public static explicit operator NotificationOption(
NotificationOption2
notificationOption)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\AddImport\AddImportPlacementOptions.cs (1)
14
new(AddImportPlacement.OutsideNamespace,
NotificationOption2
.Silent);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (16)
19
arg, defaultValue.Notification, out var value, out
var
notification))
32
arg, 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
63
string arg,
NotificationOption2
defaultNotification, [NotNullWhen(true)] out string? value, [NotNullWhen(true)] out
NotificationOption2
notification)
80
if (TryParseNotification(arg.AsSpan(firstColonIndex + 1), out
var
localNotification))
95
private static bool TryParseNotification(ReadOnlySpan<char> value, out
NotificationOption2
notification)
100
notification =
NotificationOption2
.None;
105
notification =
NotificationOption2
.Silent;
108
case EditorConfigSeverityStrings.Suggestion: notification =
NotificationOption2
.Suggestion; return true;
109
case EditorConfigSeverityStrings.Warning: notification =
NotificationOption2
.Warning; return true;
110
case EditorConfigSeverityStrings.Error: notification =
NotificationOption2
.Error; return true;
113
notification =
NotificationOption2
.Silent;
155
new(default,
NotificationOption2
.None);
173
defaultCodeStyleOption.Notification, out var value, out
var
notification))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (15)
21
NotificationOption2
Notification { get; }
23
ICodeStyleOption2 WithNotification(
NotificationOption2
notification);
41
public static readonly CodeStyleOption2<bool> TrueWithSilentEnforcement = new(value: true, notification:
NotificationOption2
.Silent);
42
public static readonly CodeStyleOption2<bool> FalseWithSilentEnforcement = new(value: false, notification:
NotificationOption2
.Silent);
43
public static readonly CodeStyleOption2<bool> TrueWithSuggestionEnforcement = new(value: true, notification:
NotificationOption2
.Suggestion);
44
public static readonly CodeStyleOption2<bool> FalseWithSuggestionEnforcement = new(value: false, notification:
NotificationOption2
.Suggestion);
49
public static CodeStyleOption2<bool> GetCodeStyle(bool value,
NotificationOption2
notification)
75
internal sealed partial class CodeStyleOption2<T>(T value,
NotificationOption2
notification) : ICodeStyleOption2, IEquatable<CodeStyleOption2<T>?>
77
public static readonly CodeStyleOption2<T> Default = new(default!,
NotificationOption2
.Silent);
91
public
NotificationOption2
Notification { get; } = notification;
95
ICodeStyleOption2 ICodeStyleOption2.WithNotification(
NotificationOption2
notification) => new CodeStyleOption2<T>(Value, notification);
192
DiagnosticSeverity.Hidden =>
NotificationOption2
.Silent,
193
DiagnosticSeverity.Info =>
NotificationOption2
.Suggestion,
194
DiagnosticSeverity.Warning =>
NotificationOption2
.Warning,
195
DiagnosticSeverity.Error =>
NotificationOption2
.Error,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (11)
96
defaultValue: new CodeStyleOption2<CollectionExpressionPreference>(CollectionExpressionPreference.WhenTypesLooselyMatch,
NotificationOption2
.Suggestion),
179
defaultValue: new CodeStyleOption2<UnusedParametersPreference>(UnusedParametersPreference.AllMethods,
NotificationOption2
.Suggestion),
183
if (CodeStyleHelpers.TryGetCodeStyleValueAndOptionalNotification(str, defaultValue.Notification, out var value, out
var
notification))
208
defaultValue: new CodeStyleOption2<AccessibilityModifiersRequired>(SyntaxFormattingOptions.CommonDefaults.AccessibilityModifiersRequired,
NotificationOption2
.Silent),
212
if (CodeStyleHelpers.TryGetCodeStyleValueAndOptionalNotification(str, defaultValue.Notification, out var value, out
var
notificationOpt))
258
if (CodeStyleHelpers.TryGetCodeStyleValueAndOptionalNotification(str, defaultValue.Notification, out var value, out
var
notification))
274
new(ParenthesesPreference.AlwaysForClarity,
NotificationOption2
.Silent);
293
defaultValue: new(ParenthesesPreference.NeverIfUnnecessary,
NotificationOption2
.Silent),
306
defaultValue: new CodeStyleOption2<ForEachExplicitCastInSourcePreference>(ForEachExplicitCastInSourcePreference.WhenStronglyTyped,
NotificationOption2
.Suggestion),
310
if (CodeStyleHelpers.TryGetCodeStyleValueAndOptionalNotification(str, defaultValue.Notification, out var value, out
var
notification))
330
defaultValue: new CodeStyleOption2<bool>(value: true, notification:
NotificationOption2
.Suggestion));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CollectionExpressionPreference.cs (1)
41
optionString, defaultValue.Notification, out var value, out
var
notification))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\NotificationOption2.cs (9)
13
/// <completionlist cref="
NotificationOption2
"/>
21
public static
NotificationOption2
None => new(ReportDiagnostic.Suppress, false);
26
public static
NotificationOption2
Silent => new(ReportDiagnostic.Hidden, false);
31
public static
NotificationOption2
Suggestion => new(ReportDiagnostic.Info, false);
36
public static
NotificationOption2
Warning => new(ReportDiagnostic.Warn, false);
41
public static
NotificationOption2
Error => new(ReportDiagnostic.Error, false);
43
public
NotificationOption2
WithIsExplicitlySpecified(bool isExplicitlySpecified)
46
public static
NotificationOption2
ForSeverity(ReportDiagnostic reportDiagnostic)
57
public 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));
46
defaultValue: new CodeStyleOption2<UnusedValuePreference>(UnusedValuePreference.UnusedLocalVariable,
NotificationOption2
.Silent),
52
defaultValue: new CodeStyleOption2<UnusedValuePreference>(UnusedValuePreference.UnusedLocalVariable,
NotificationOption2
.Suggestion),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticSeverityExtensions.cs (6)
11
public static
NotificationOption2
ToNotificationOption(this DiagnosticSeverity severity, bool isOverridenSeverity)
13
var
notificationOption = severity switch
15
DiagnosticSeverity.Error =>
NotificationOption2
.Error,
16
DiagnosticSeverity.Warning =>
NotificationOption2
.Warning,
17
DiagnosticSeverity.Info =>
NotificationOption2
.Suggestion,
18
DiagnosticSeverity.Hidden =>
NotificationOption2
.Silent,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\NotificationOptionExtensions.cs (1)
11
public static string ToEditorConfigString(this
NotificationOption2
notificationOption)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ReportDiagnosticExtensions.cs (7)
83
public static
NotificationOption2
ToNotificationOption(this ReportDiagnostic reportDiagnostic, DiagnosticSeverity defaultSeverity)
86
var
notificationOption = reportDiagnostic.WithDefaultSeverity(defaultSeverity) switch
88
ReportDiagnostic.Error =>
NotificationOption2
.Error,
89
ReportDiagnostic.Warn =>
NotificationOption2
.Warning,
90
ReportDiagnostic.Info =>
NotificationOption2
.Suggestion,
91
ReportDiagnostic.Hidden =>
NotificationOption2
.Silent,
92
ReportDiagnostic.Suppress =>
NotificationOption2
.None,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractMemberAccessExpressionSimplifier.cs (2)
37
out
NotificationOption2
notificationOption,
40
notificationOption =
NotificationOption2
.Silent;