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