103 references to new
Microsoft.CodeAnalysis.CodeStyle (27)
AddImportPlacementOptions.cs (1)
23
new
(AddImportPlacement.OutsideNamespace, NotificationOption2.Silent);
CodeStyleHelpers.cs (4)
21
option = new
CodeStyleOption2
<string>(value, notification);
37
option = new
CodeStyleOption2
<bool>(isEnabled, notification);
154
new
(default, NotificationOption2.None);
174
return new
CodeStyleOption2
<UnusedValuePreference>(
CodeStyleOption2`1.cs (9)
44
public static readonly CodeStyleOption2<bool> TrueWithSilentEnforcement =
new
(value: true, notification: NotificationOption2.Silent);
45
public static readonly CodeStyleOption2<bool> FalseWithSilentEnforcement =
new
(value: false, notification: NotificationOption2.Silent);
46
public static readonly CodeStyleOption2<bool> TrueWithSuggestionEnforcement =
new
(value: true, notification: NotificationOption2.Suggestion);
47
public static readonly CodeStyleOption2<bool> FalseWithSuggestionEnforcement =
new
(value: false, notification: NotificationOption2.Suggestion);
59
_ =>
new
(value, notification)
80
public static readonly CodeStyleOption2<T> Default =
new
(default!, NotificationOption2.Silent);
104
ICodeStyleOption ICodeStyleOption.WithNotification(NotificationOption2 notification) => new
CodeStyleOption2
<T>(Value, notification);
126
return EqualityComparer<T>.Default.Equals(value, Value) ? this : new
CodeStyleOption2
<T>(value, Notification);
206
return new
CodeStyleOption2
<T>(value, severity switch
CodeStyleOptions2.cs (4)
177
return new
CodeStyleOption2
<UnusedParametersPreference>(s_unusedParametersPreferenceMap.GetValueOrDefault(value), notification);
207
return new
CodeStyleOption2
<AccessibilityModifiersRequired>(s_accessibilityModifiersRequiredMap.GetValueOrDefault(value), notificationOpt);
253
return new
CodeStyleOption2
<ParenthesesPreference>(s_parenthesesPreferenceMap.GetValueOrDefault(value), notification);
302
return new
CodeStyleOption2
<ForEachExplicitCastInSourcePreference>(
IdeAnalyzerOptions.cs (1)
23
new
(value: true, notification: NotificationOption2.Suggestion);
IdeCodeStyleOptions.cs (5)
14
new
(UnusedParametersPreference.AllMethods, NotificationOption2.Suggestion);
17
new
(SyntaxFormattingOptions.CommonDefaults.AccessibilityModifiersRequired, NotificationOption2.Silent);
20
new
(ParenthesesPreference.AlwaysForClarity, NotificationOption2.Silent);
23
new
(ParenthesesPreference.NeverIfUnnecessary, NotificationOption2.Silent);
26
new
(ForEachExplicitCastInSourcePreference.WhenStronglyTyped, NotificationOption2.Suggestion);
VisualBasicIdeCodeStyleOptions.cs (3)
16
new
(UnusedValuePreference.UnusedLocalVariable, NotificationOption2.Silent);
19
new
(UnusedValuePreference.UnusedLocalVariable, NotificationOption2.Suggestion);
22
new
("Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride," +
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (5)
OptionsCollection.cs (2)
53
=> Add(new OptionKey2(option), new
CodeStyleOption2
<T>(value, notification));
62
=> Add(new OptionKey2(option, _languageName), new
CodeStyleOption2
<T>(value, notification));
ParenthesesOptionsProvider.cs (3)
24
new
CodeStyleOption2
<ParenthesesPreference>(ParenthesesPreference.AlwaysForClarity, NotificationOption2.None);
27
new
CodeStyleOption2
<ParenthesesPreference>(ParenthesesPreference.AlwaysForClarity, NotificationOption2.Suggestion);
30
new
CodeStyleOption2
<ParenthesesPreference>(ParenthesesPreference.NeverIfUnnecessary, NotificationOption2.Suggestion);
Microsoft.CodeAnalysis.CSharp.CodeStyle (26)
CSharpCodeGenerationOptions.cs (3)
26
new
(ExpressionBodyPreference.Never, NotificationOption2.Silent);
29
new
(ExpressionBodyPreference.WhenPossible, NotificationOption2.Silent);
32
new
(NamespaceDeclarationPreference.BlockScoped, NotificationOption2.Silent);
CSharpCodeStyleOptions.cs (5)
92
new
(ExpressionBodyPreference.Never, NotificationOption2.Silent);
95
new
(ExpressionBodyPreference.Never, NotificationOption2.Suggestion);
98
new
(ExpressionBodyPreference.WhenPossible, NotificationOption2.Silent);
101
new
(ExpressionBodyPreference.WhenPossible, NotificationOption2.Suggestion);
104
new
(ExpressionBodyPreference.WhenOnSingleLine, NotificationOption2.Silent);
CSharpCodeStyleOptions_Parsing.cs (10)
24
? new
CodeStyleOption2
<ExpressionBodyPreference>(ExpressionBodyPreference.WhenPossible, notification)
25
: new
CodeStyleOption2
<ExpressionBodyPreference>(ExpressionBodyPreference.Never, notification);
30
return new
CodeStyleOption2
<ExpressionBodyPreference>(ExpressionBodyPreference.WhenOnSingleLine, notification);
57
"inside_namespace" => new
CodeStyleOption2
<AddImportPlacement>(AddImportPlacement.InsideNamespace, notification),
58
"outside_namespace" => new
CodeStyleOption2
<AddImportPlacement>(AddImportPlacement.OutsideNamespace, notification),
85
"block_scoped" =>
new
(NamespaceDeclarationPreference.BlockScoped, notification),
86
"file_scoped" =>
new
(NamespaceDeclarationPreference.FileScoped, notification),
118
? new
CodeStyleOption2
<PreferBracesPreference>(PreferBracesPreference.Always, notificationOption)
119
: new
CodeStyleOption2
<PreferBracesPreference>(PreferBracesPreference.None, notificationOption);
124
return new
CodeStyleOption2
<PreferBracesPreference>(PreferBracesPreference.WhenMultiline, notificationOption);
CSharpIdeCodeStyleOptions.cs (5)
32
new
(UnusedValuePreference.DiscardVariable, NotificationOption2.Silent);
35
new
(UnusedValuePreference.DiscardVariable, NotificationOption2.Suggestion);
38
new
(string.Join(",", s_preferredModifierOrderDefault.Select(SyntaxFacts.GetText)), NotificationOption2.Silent);
41
new
(AddImportPlacement.OutsideNamespace, NotificationOption2.Silent);
44
new
(ExpressionBodyPreference.WhenPossible, NotificationOption2.Silent);
CSharpSimplifierOptions.cs (1)
19
new
(PreferBracesPreference.Always, NotificationOption2.Silent);
CSharpSyntaxFormattingOptions.cs (2)
18
new
(NamespaceDeclarationPreference.BlockScoped, NotificationOption2.Silent);
21
new
(value: true, notification: NotificationOption2.Silent);
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (37)
AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest_OptionHelpers.cs (2)
22
=> SingleOption(option, new
CodeStyleOption2
<T>(enabled, notification));
28
=> SingleOption(option, new
CodeStyleOption2
<T>(enabled, notification));
CSharpIsAndCastCheckDiagnosticAnalyzerTests.cs (1)
655
var warningOption = new
CodeStyleOption2
<bool>(true, NotificationOption2.Warning);
MisplacedUsingDirectivesTests.cs (4)
33
new
(AddImportPlacement.OutsideNamespace, NotificationOption2.None);
36
new
(AddImportPlacement.InsideNamespace, NotificationOption2.None);
39
new
(AddImportPlacement.InsideNamespace, NotificationOption2.Error);
42
new
(AddImportPlacement.OutsideNamespace, NotificationOption2.Error);
RemoveUnnecessaryLambdaExpressionTests.cs (1)
113
Options = { { CSharpCodeStyleOptions.PreferMethodGroupConversion, new
CodeStyleOption2
<bool>(false, NotificationOption2.None) } }
RemoveUnusedParametersTests.cs (3)
36
new
CodeStyleOption2
<UnusedParametersPreference>(UnusedParametersPreference.NonPublicMethods, NotificationOption2.Suggestion));
117
new
CodeStyleOption2
<UnusedValuePreference>(UnusedValuePreference.DiscardVariable, NotificationOption2.None));
1471
new
CodeStyleOption2
<UnusedParametersPreference>(default, NotificationOption2.Suggestion));
RemoveUnusedValueAssignmentTests.cs (3)
36
new
CodeStyleOption2
<UnusedValuePreference>(UnusedValuePreference.DiscardVariable, NotificationOption2.None));
40
new
CodeStyleOption2
<UnusedValuePreference>(UnusedValuePreference.DiscardVariable, NotificationOption2.Suggestion));
44
new
CodeStyleOption2
<UnusedValuePreference>(UnusedValuePreference.UnusedLocalVariable, NotificationOption2.Suggestion));
RemoveUnusedValueExpressionStatementTests.cs (3)
29
new
CodeStyleOption2
<UnusedValuePreference>(UnusedValuePreference.DiscardVariable, NotificationOption2.None));
33
new
CodeStyleOption2
<UnusedValuePreference>(UnusedValuePreference.DiscardVariable, NotificationOption2.Silent));
37
new
CodeStyleOption2
<UnusedValuePreference>(UnusedValuePreference.UnusedLocalVariable, NotificationOption2.Silent));
UseExplicitTypeTests.cs (5)
31
private readonly CodeStyleOption2<bool> offWithSilent =
new
(false, NotificationOption2.Silent);
32
private readonly CodeStyleOption2<bool> onWithInfo =
new
(true, NotificationOption2.Suggestion);
33
private readonly CodeStyleOption2<bool> offWithInfo =
new
(false, NotificationOption2.Suggestion);
34
private readonly CodeStyleOption2<bool> offWithWarning =
new
(false, NotificationOption2.Warning);
35
private readonly CodeStyleOption2<bool> offWithError =
new
(false, NotificationOption2.Error);
UseImplicitTypeTests.cs (5)
32
private static readonly CodeStyleOption2<bool> onWithSilent =
new
(true, NotificationOption2.Silent);
33
private static readonly CodeStyleOption2<bool> onWithInfo =
new
(true, NotificationOption2.Suggestion);
34
private static readonly CodeStyleOption2<bool> offWithInfo =
new
(false, NotificationOption2.Suggestion);
35
private static readonly CodeStyleOption2<bool> onWithWarning =
new
(true, NotificationOption2.Warning);
36
private static readonly CodeStyleOption2<bool> onWithError =
new
(true, NotificationOption2.Error);
UseVarTestExtensions.cs (10)
19
private static readonly CodeStyleOption2<bool> onWithNone = new
CodeStyleOption2
<bool>(true, NotificationOption2.None);
20
private static readonly CodeStyleOption2<bool> offWithNone = new
CodeStyleOption2
<bool>(false, NotificationOption2.None);
21
private static readonly CodeStyleOption2<bool> onWithSilent = new
CodeStyleOption2
<bool>(true, NotificationOption2.Silent);
22
private static readonly CodeStyleOption2<bool> offWithSilent = new
CodeStyleOption2
<bool>(false, NotificationOption2.Silent);
23
private static readonly CodeStyleOption2<bool> onWithInfo = new
CodeStyleOption2
<bool>(true, NotificationOption2.Suggestion);
24
private static readonly CodeStyleOption2<bool> offWithInfo = new
CodeStyleOption2
<bool>(false, NotificationOption2.Suggestion);
25
private static readonly CodeStyleOption2<bool> onWithWarning = new
CodeStyleOption2
<bool>(true, NotificationOption2.Warning);
26
private static readonly CodeStyleOption2<bool> offWithWarning = new
CodeStyleOption2
<bool>(false, NotificationOption2.Warning);
27
private static readonly CodeStyleOption2<bool> offWithError = new
CodeStyleOption2
<bool>(false, NotificationOption2.Error);
28
private static readonly CodeStyleOption2<bool> onWithError = new
CodeStyleOption2
<bool>(true, NotificationOption2.Error);
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests (8)
AbstractVisualBasicDiagnosticProviderBasedUserDiagnosticTest_OptionHelpers.vb (2)
21
Return SingleOption(optionParam, New
CodeStyleOption2
(Of T)(enabled, notification))
29
Return SingleOption(optionParam, New
CodeStyleOption2
(Of T)(enabled, notification))
RemoveUnusedValueAssignmentTests.vb (3)
17
New
CodeStyleOption2
(Of UnusedValuePreference)(UnusedValuePreference.UnusedLocalVariable, NotificationOption2.None))
24
New
CodeStyleOption2
(Of UnusedValuePreference)(UnusedValuePreference.DiscardVariable, NotificationOption2.Suggestion))
31
New
CodeStyleOption2
(Of UnusedValuePreference)(UnusedValuePreference.UnusedLocalVariable, NotificationOption2.Suggestion))
RemoveUnusedValueExpressionStatementTests.vb (3)
17
New
CodeStyleOption2
(Of UnusedValuePreference)(UnusedValuePreference.UnusedLocalVariable, NotificationOption2.None))
24
New
CodeStyleOption2
(Of UnusedValuePreference)(UnusedValuePreference.DiscardVariable, NotificationOption2.Silent))
31
New
CodeStyleOption2
(Of UnusedValuePreference)(UnusedValuePreference.UnusedLocalVariable, NotificationOption2.Silent))