210 references to CodeStyleOption2
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
ConvertNamespace\ConvertNamespaceCommandHandler.cs (1)
45new(NamespaceDeclarationPreference.FileScoped, NotificationOption2.Suggestion);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (82)
CodeActions\IntroduceVariable\IntroduceVariableTests.cs (1)
30private readonly CodeStyleOption2<bool> onWithInfo = new CodeStyleOption2<bool>(true, NotificationOption2.Suggestion);
Completion\CompletionProviders\PartialMethodCompletionProviderTests.cs (2)
785new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.WhenPossible, NotificationOption2.Silent)); 816new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.WhenPossible, NotificationOption2.Silent));
ConvertForEachToFor\ConvertForEachToForTests.cs (1)
28private readonly CodeStyleOption2<bool> onWithSilent = new CodeStyleOption2<bool>(true, NotificationOption2.Silent);
ConvertForToForEach\ConvertForToForEachTests.cs (1)
25private readonly CodeStyleOption2<bool> onWithSilent = new CodeStyleOption2<bool>(true, NotificationOption2.Silent);
CSharpIsAndCastCheckDiagnosticAnalyzerTests.cs (1)
655var warningOption = new CodeStyleOption2<bool>(true, NotificationOption2.Warning);
Diagnostics\PreferFrameworkType\PreferFrameworkTypeTests.cs (2)
31private readonly CodeStyleOption2<bool> onWithInfo = new CodeStyleOption2<bool>(true, NotificationOption2.Suggestion); 32private readonly CodeStyleOption2<bool> offWithInfo = new CodeStyleOption2<bool>(false, NotificationOption2.Suggestion);
EditorConfigSettings\Updater\SettingsUpdaterTests.cs (1)
102var option = new CodeStyleOption2<AddImportPlacement>(AddImportPlacement.InsideNamespace, NotificationOption2.Warning);
Formatting\CodeCleanupTests.cs (5)
802=> AssertCodeCleanupResult(expected, code, new(AddImportPlacement.OutsideNamespace, NotificationOption2.Silent), systemUsingsFirst, separateUsingGroups); 851new CodeStyleOption2<AddImportPlacement>(AddImportPlacement.InsideNamespace, NotificationOption2.Error); 854new CodeStyleOption2<AddImportPlacement>(AddImportPlacement.OutsideNamespace, NotificationOption2.Error); 857new CodeStyleOption2<AddImportPlacement>(AddImportPlacement.InsideNamespace, NotificationOption2.None); 860new CodeStyleOption2<AddImportPlacement>(AddImportPlacement.OutsideNamespace, NotificationOption2.None);
Formatting\CSharpNewDocumentFormattingServiceTests.cs (12)
43{ CSharpCodeStyleOptions.NamespaceDeclarations, new CodeStyleOption2<NamespaceDeclarationPreference>(NamespaceDeclarationPreference.FileScoped, NotificationOption2.Error) } 65{ CSharpCodeStyleOptions.NamespaceDeclarations, new CodeStyleOption2<NamespaceDeclarationPreference>(NamespaceDeclarationPreference.FileScoped, NotificationOption2.Error) } 86{ CSharpCodeStyleOptions.NamespaceDeclarations, new CodeStyleOption2<NamespaceDeclarationPreference>(NamespaceDeclarationPreference.FileScoped, NotificationOption2.Error) } 110{ CSharpCodeStyleOptions.NamespaceDeclarations, new CodeStyleOption2<NamespaceDeclarationPreference>(NamespaceDeclarationPreference.BlockScoped, NotificationOption2.Error) } 125{ CSharpCodeStyleOptions.PreferredUsingDirectivePlacement, new CodeStyleOption2<AddImportPlacement>(AddImportPlacement.OutsideNamespace, NotificationOption2.Error) } 171{ CodeStyleOptions2.AccessibilityModifiersRequired, new CodeStyleOption2<AccessibilityModifiersRequired>(AccessibilityModifiersRequired.Always, NotificationOption2.Error) } 194{ CSharpCodeStyleOptions.NamespaceDeclarations, new CodeStyleOption2<NamespaceDeclarationPreference>(NamespaceDeclarationPreference.FileScoped, NotificationOption2.Error) }, 195{ CodeStyleOptions2.AccessibilityModifiersRequired, new CodeStyleOption2<AccessibilityModifiersRequired>(AccessibilityModifiersRequired.Always, NotificationOption2.Error) } 237{ CodeStyleOptions2.AccessibilityModifiersRequired, new CodeStyleOption2<AccessibilityModifiersRequired>(AccessibilityModifiersRequired.Always, NotificationOption2.Error) } 255{ CSharpCodeStyleOptions.PreferredUsingDirectivePlacement, new CodeStyleOption2<AddImportPlacement>(AddImportPlacement.InsideNamespace, NotificationOption2.Error) } 272{ CSharpCodeStyleOptions.PreferTopLevelStatements, new CodeStyleOption2<bool>(value: true, notification: NotificationOption2.Suggestion) } 294{ CSharpCodeStyleOptions.PreferTopLevelStatements, new CodeStyleOption2<bool>(value: false, notification: NotificationOption2.Suggestion) }
GenerateVariable\GenerateVariableTests.cs (1)
41private readonly CodeStyleOption2<bool> onWithInfo = new(true, NotificationOption2.Suggestion);
InitializeParameter\AddParameterCheckTests.cs (1)
2057{ CSharpCodeStyleOptions.PreferBraces, new CodeStyleOption2<PreferBracesPreference>((PreferBracesPreference)preferBraces, NotificationOption2.Silent) },
IntroduceVariable\IntroduceLocalForExpressionTests.cs (2)
21private static readonly CodeStyleOption2<bool> onWithInfo = new(true, NotificationOption2.Suggestion); 22private static readonly CodeStyleOption2<bool> offWithInfo = new(false, NotificationOption2.Suggestion);
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 (4)
36new CodeStyleOption2<UnusedParametersPreference>(UnusedParametersPreference.NonPublicMethods, NotificationOption2.Suggestion)); 117new CodeStyleOption2<UnusedValuePreference>(UnusedValuePreference.DiscardVariable, NotificationOption2.None)); 1471new CodeStyleOption2<UnusedParametersPreference>(default, NotificationOption2.Suggestion)); 1502new CodeStyleOption2<UnusedParametersPreference>((UnusedParametersPreference)2, 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));
SimplifyTypeNames\SimplifyTypeNamesTests.cs (3)
7139private readonly CodeStyleOption2<bool> offWithSilent = new CodeStyleOption2<bool>(false, NotificationOption2.Silent); 7140private readonly CodeStyleOption2<bool> onWithInfo = new CodeStyleOption2<bool>(true, NotificationOption2.Suggestion); 7141private readonly CodeStyleOption2<bool> onWithError = new CodeStyleOption2<bool>(true, NotificationOption2.Error);
Squiggles\ErrorSquiggleProducerTests.cs (1)
124new CodeStyleOption2<bool>(value: true, notification: NotificationOption2.Error));
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);
UseExpressionBody\Refactoring\UseExpressionBodyForConstructorsRefactoringTests.cs (2)
29=> this.Option(CSharpCodeStyleOptions.PreferExpressionBodiedConstructors, new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.WhenPossible, NotificationOption2.None)); 35=> this.Option(CSharpCodeStyleOptions.PreferExpressionBodiedConstructors, new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.Never, NotificationOption2.None));
UseExpressionBody\Refactoring\UseExpressionBodyForConversionOperatorsRefactoringTests.cs (2)
29=> this.Option(CSharpCodeStyleOptions.PreferExpressionBodiedOperators, new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.WhenPossible, NotificationOption2.None)); 35=> this.Option(CSharpCodeStyleOptions.PreferExpressionBodiedOperators, new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.Never, NotificationOption2.None));
UseExpressionBody\Refactoring\UseExpressionBodyForIndexersRefactoringTests.cs (2)
30=> this.Option(CSharpCodeStyleOptions.PreferExpressionBodiedIndexers, new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.WhenPossible, NotificationOption2.None)); 36=> this.Option(CSharpCodeStyleOptions.PreferExpressionBodiedIndexers, new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.Never, NotificationOption2.None));
UseExpressionBody\Refactoring\UseExpressionBodyForLocalFunctionsRefactoringTests.cs (2)
29=> Option(CSharpCodeStyleOptions.PreferExpressionBodiedLocalFunctions, new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.WhenPossible, NotificationOption2.None)); 35=> Option(CSharpCodeStyleOptions.PreferExpressionBodiedLocalFunctions, new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.Never, NotificationOption2.None));
UseExpressionBody\Refactoring\UseExpressionBodyForMethodsRefactoringTests.cs (2)
28=> this.Option(CSharpCodeStyleOptions.PreferExpressionBodiedMethods, new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.WhenPossible, NotificationOption2.None)); 34=> this.Option(CSharpCodeStyleOptions.PreferExpressionBodiedMethods, new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.Never, NotificationOption2.None));
UseExpressionBody\Refactoring\UseExpressionBodyForOperatorsRefactoringTests.cs (2)
29=> this.Option(CSharpCodeStyleOptions.PreferExpressionBodiedOperators, new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.WhenPossible, NotificationOption2.None)); 35=> this.Option(CSharpCodeStyleOptions.PreferExpressionBodiedOperators, new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.Never, NotificationOption2.None));
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);
UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzerTests.cs (1)
29{ CSharpCodeStyleOptions.PreferPatternMatching, new CodeStyleOption2<bool>(false, NotificationOption2.None) }
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.CSharp.Workspaces (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.Workspaces.UnitTests (3)
CodeGeneration\AddImportsTests.cs (1)
82UsingDirectivePlacement = new CodeStyleOption2<AddImportPlacement>(placeImportsInsideNamespaces ? AddImportPlacement.InsideNamespace : AddImportPlacement.OutsideNamespace, NotificationOption2.None),
CodeStyle\CSharpEditorConfigCodeStyleParserTests.cs (2)
57var defaultValue = new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.Never, NotificationOption2.Error); 73var defaultValue = new CodeStyleOption2<AddImportPlacement>(AddImportPlacement.InsideNamespace, NotificationOption2.Error);
Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities (5)
CodeActions\AbstractCodeActionOrUserDiagnosticTest_OptionHelpers.cs (2)
20=> (new OptionKey2(option), new CodeStyleOption2<T>(enabled, notification)); 26=> (new OptionKey2(option, this.GetLanguage()), new CodeStyleOption2<T>(enabled, notification));
Diagnostics\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.EditorFeatures.UnitTests (1)
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (1)
131NamespaceDeclarations = new CodeStyleOption2<NamespaceDeclarationPreference>(NamespaceDeclarationPreference.FileScoped, NotificationOption2.Silent)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (6)
Simplification\BlockSimplificationTests.vb (1)
17{CSharpCodeStyleOptions.PreferBraces, New CodeStyleOption2(Of PreferBracesPreference)(PreferBracesPreference.None, NotificationOption2.Silent)}
Simplification\TypeNameSimplifierTest.vb (5)
2503{CodeStyleOptions2.QualifyFieldAccess, New CodeStyleOption2(Of Boolean)(True, NotificationOption2.Error)} 5878Return New OptionsCollection(languageName) From {{CodeStyleOptions2.QualifyFieldAccess, New CodeStyleOption2(Of Boolean)(True, NotificationOption2.Error)}} 5886Return New OptionsCollection(languageName) From {{CodeStyleOptions2.QualifyMethodAccess, New CodeStyleOption2(Of Boolean)(True, NotificationOption2.Error)}} 5890Return New OptionsCollection(languageName) From {{CodeStyleOptions2.QualifyEventAccess, New CodeStyleOption2(Of Boolean)(True, NotificationOption2.Error)}} 5894Return New OptionsCollection(languageName) From {{CodeStyleOptions2.QualifyPropertyAccess, New CodeStyleOption2(Of Boolean)(True, notification)}}
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (11)
Diagnostics\PreferFrameworkType\PreferFrameworkTypeTests.vb (2)
19Private ReadOnly onWithInfo As New CodeStyleOption2(Of Boolean)(True, NotificationOption2.Suggestion) 20Private ReadOnly offWithInfo As New CodeStyleOption2(Of Boolean)(False, NotificationOption2.Suggestion)
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))
SimplifyTypeNames\SimplifyTypeNamesTests.vb (2)
53Private ReadOnly onWithError As New CodeStyleOption2(Of Boolean)(True, NotificationOption2.Error) 54Private ReadOnly offWithSilent As New CodeStyleOption2(Of Boolean)(False, NotificationOption2.Silent)
Squiggles\ErrorSquiggleProducerTests.vb (1)
122CodeStyleOptions2.PreferIntrinsicPredefinedTypeKeywordInDeclaration, language, New CodeStyleOption2(Of Boolean)(value:=True, notification:=NotificationOption2.Error))
Microsoft.CodeAnalysis.Workspaces (28)
AddImportPlacementOptions.cs (1)
23new(AddImportPlacement.OutsideNamespace, NotificationOption2.Silent);
CodeStyle\CodeStyleOption.cs (1)
25: this(new CodeStyleOption2<T>(value, new NotificationOption2(notification.Severity)))
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.Workspaces.Test.Utilities (2)
OptionsCollection.cs (2)
53=> Add(new OptionKey2(option), new CodeStyleOption2<T>(value, notification)); 62=> Add(new OptionKey2(option, _languageName), new CodeStyleOption2<T>(value, notification));
Microsoft.CodeAnalysis.Workspaces.UnitTests (30)
Options\CodeStyleOptionTests.cs (16)
25var style = new CodeStyleOption2<int>(1, NotificationOption2.Error); 32var style = new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.WhenOnSingleLine, NotificationOption2.Error); 39var style = new CodeStyleOption2<string>("abc", NotificationOption2.Error); 47new CodeStyleOption2<bool>(true, NotificationOption2.Error).WithValue(false), 48new CodeStyleOption2<bool>(false, NotificationOption2.Error)); 55new CodeStyleOption2<int>(1, NotificationOption2.Error).WithValue(2), 56new CodeStyleOption2<int>(2, NotificationOption2.Error)); 63new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.Never, NotificationOption2.Error).WithValue(ExpressionBodyPreference.WhenPossible), 64new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.WhenPossible, NotificationOption2.Error)); 71new CodeStyleOption2<string>("abc", NotificationOption2.Error).WithValue("xyz"), 72new CodeStyleOption2<string>("xyz", NotificationOption2.Error)); 81var option = new CodeStyleOption2<bool>(false, NotificationOption2.Silent); 87option = new CodeStyleOption2<bool>(true, NotificationOption2.Silent); 100var option = new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.Never, NotificationOption2.Silent); 106option = new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.WhenPossible, NotificationOption2.Silent); 114option = new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.WhenOnSingleLine, NotificationOption2.Silent);
Options\DocumentOptionSetTests.cs (2)
25new CodeStyleOption2<bool>(true, NotificationOption2.Error))); 53new CodeStyleOption2<bool>(true, NotificationOption2.Error)));
Options\OptionKeyTests.cs (1)
174Assert.Equal(new CodeStyleOption2<bool>(true, NotificationOption2.Suggestion), result);
Remote\ServiceDescriptorTests.cs (7)
257QualifyFieldAccess = new CodeStyleOption2<bool>(true, NotificationOption2.Error) 263PreferExpressionBodiedIndexers = new CodeStyleOption2<ExpressionBodyPreference>(ExpressionBodyPreference.WhenOnSingleLine, NotificationOption2.Error) 274AllowStatementImmediatelyAfterBlock = new CodeStyleOption2<bool>(true, NotificationOption2.Error), 275PreferConditionalDelegateCall = new CodeStyleOption2<bool>(false, NotificationOption2.Error) 285QualifyFieldAccess = new CodeStyleOption2<bool>(true, NotificationOption2.Error) 295AllowStatementImmediatelyAfterBlock = new CodeStyleOption2<bool>(false, NotificationOption2.Error), 296PreferredModifierOrder = new CodeStyleOption2<string>("Public Private", NotificationOption2.Error)
WorkspaceServiceTests\GlobalOptionServiceTests.cs (4)
273var perLanguageOption2 = new PerLanguageOption2<CodeStyleOption2<bool>>("test", new CodeStyleOption2<bool>(false, NotificationOption2.Warning)).WithPublicOption("test", "test"); 275var newValueCodeStyleOption2 = new CodeStyleOption2<bool>(!perLanguageOption2.DefaultValue.Value, perLanguageOption2.DefaultValue.Notification); 289var option2 = new Option2<CodeStyleOption2<bool>>("test", new CodeStyleOption2<bool>(false, NotificationOption2.Warning)).WithPublicOption("test", "test"); 291var newValueCodeStyleOption2 = new CodeStyleOption2<bool>(!option2.DefaultValue.Value, option2.DefaultValue.Notification);
Microsoft.VisualStudio.IntegrationTest.Utilities (1)
InProcess\VisualStudioWorkspace_InProc.cs (1)
50new CodeStyleOption2<NamespaceDeclarationPreference>(value ? NamespaceDeclarationPreference.FileScoped : NamespaceDeclarationPreference.BlockScoped, NotificationOption2.Suggestion)));
Microsoft.VisualStudio.LanguageServices.Implementation (4)
Options\Style\BooleanCodeStyleOptionViewModel.cs (2)
59Info.SetOptionAndUpdatePreview(new CodeStyleOption2<bool>(_selectedPreference.IsChecked, _selectedNotificationPreference.Notification), Option, GetPreview()); 72Info.SetOptionAndUpdatePreview(new CodeStyleOption2<bool>(_selectedPreference.IsChecked, _selectedNotificationPreference.Notification), Option, GetPreview());
Options\Style\EnumCodeStyleOptionViewModel.cs (2)
90new CodeStyleOption2<T>( 109new CodeStyleOption2<T>(
Microsoft.VisualStudio.LanguageServices.New.IntegrationTests (1)
InProcess\WorkspaceInProcess.cs (1)
82new CodeStyleOption2<NamespaceDeclarationPreference>(value ? NamespaceDeclarationPreference.FileScoped : NamespaceDeclarationPreference.BlockScoped, NotificationOption2.Suggestion));
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
Options\BasicEditorConfigGeneratorTests.vb (1)
161options.SetOption(CodeStyleOptions2.PreferExplicitTupleNames, LanguageNames.VisualBasic, New CodeStyleOption2(Of Boolean)(False, NotificationOption2.[Error]))
Options\CSharpEditorConfigGeneratorTests.vb (1)
262options.SetOption(CodeStyleOptions2.PreferExplicitTupleNames, LanguageNames.CSharp, New CodeStyleOption2(Of Boolean)(False, NotificationOption2.[Error]))
Roslyn.VisualStudio.Next.UnitTests (7)
Options\VisualStudioSettingsOptionPersisterTests.cs (4)
96optionType == typeof(CodeStyleOption2<bool>) ? (new CodeStyleOption2<bool>(false, NotificationOption2.Warning), new CodeStyleOption2<bool>(false, NotificationOption2.Warning).ToXElement().ToString()) : 278var value1 = new CodeStyleOption2<int>(1, NotificationOption2.Warning); 279yield return new object?[] { value1, value1.ToXElement().ToString(), new CodeStyleOption2<int>(0, NotificationOption2.None), typeof(CodeStyleOption2<int>) };
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (3)
76VarWhenTypeIsApparent = new CodeStyleOption2<bool>(false, NotificationOption2.Suggestion) 107PreferNullPropagation = new CodeStyleOption2<bool>(false, NotificationOption2.Silent) 120PreferNullPropagation = new CodeStyleOption2<bool>(true, NotificationOption2.Error)