39 references to ParenthesesPreference
Microsoft.CodeAnalysis.CodeStyle (27)
AbstractAddRequiredParenthesesDiagnosticAnalyzer.cs (1)
117if (preference.Value != ParenthesesPreference.AlwaysForClarity)
AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (2)
94if (preference.Value == ParenthesesPreference.AlwaysForClarity && 104Debug.Assert(preference.Value == ParenthesesPreference.NeverIfUnnecessary ||
AnalyzerOptionsProvider.cs (4)
89public CodeStyleOption2<ParenthesesPreference> ArithmeticBinaryParentheses => GetOption(CodeStyleOptions2.ArithmeticBinaryParentheses, FallbackCodeStyleOptions.ArithmeticBinaryParentheses); 90public CodeStyleOption2<ParenthesesPreference> OtherBinaryParentheses => GetOption(CodeStyleOptions2.OtherBinaryParentheses, FallbackCodeStyleOptions.OtherBinaryParentheses); 91public CodeStyleOption2<ParenthesesPreference> RelationalBinaryParentheses => GetOption(CodeStyleOptions2.RelationalBinaryParentheses, FallbackCodeStyleOptions.RelationalBinaryParentheses); 92public CodeStyleOption2<ParenthesesPreference> OtherParentheses => GetOption(CodeStyleOptions2.OtherParentheses, FallbackCodeStyleOptions.OtherParentheses);
CodeStyleOptions2.cs (11)
235private static readonly BidirectionalMap<string, ParenthesesPreference> s_parenthesesPreferenceMap = 238KeyValuePairUtil.Create("always_for_clarity", ParenthesesPreference.AlwaysForClarity), 239KeyValuePairUtil.Create("never_if_unnecessary", ParenthesesPreference.NeverIfUnnecessary), 242private static PerLanguageOption2<CodeStyleOption2<ParenthesesPreference>> CreateParenthesesOption(CodeStyleOption2<ParenthesesPreference> defaultValue, string name) 253return new CodeStyleOption2<ParenthesesPreference>(s_parenthesesPreferenceMap.GetValueOrDefault(value), notification); 261var value = s_parenthesesPreferenceMap.GetKeyOrDefault(option.Value) ?? s_parenthesesPreferenceMap.GetKeyOrDefault(ParenthesesPreference.AlwaysForClarity); 265internal static readonly PerLanguageOption2<CodeStyleOption2<ParenthesesPreference>> ArithmeticBinaryParentheses = 270internal static readonly PerLanguageOption2<CodeStyleOption2<ParenthesesPreference>> OtherBinaryParentheses = 275internal static readonly PerLanguageOption2<CodeStyleOption2<ParenthesesPreference>> RelationalBinaryParentheses = 280internal static readonly PerLanguageOption2<CodeStyleOption2<ParenthesesPreference>> OtherParentheses =
IdeCodeStyleOptions.cs (8)
19private static readonly CodeStyleOption2<ParenthesesPreference> s_alwaysForClarityPreference = 20new(ParenthesesPreference.AlwaysForClarity, NotificationOption2.Silent); 22private static readonly CodeStyleOption2<ParenthesesPreference> s_neverIfUnnecessaryPreference = 23new(ParenthesesPreference.NeverIfUnnecessary, NotificationOption2.Silent); 51[DataMember] public CodeStyleOption2<ParenthesesPreference> ArithmeticBinaryParentheses { get; init; } = s_alwaysForClarityPreference; 52[DataMember] public CodeStyleOption2<ParenthesesPreference> OtherBinaryParentheses { get; init; } = s_alwaysForClarityPreference; 53[DataMember] public CodeStyleOption2<ParenthesesPreference> RelationalBinaryParentheses { get; init; } = s_alwaysForClarityPreference; 54[DataMember] public CodeStyleOption2<ParenthesesPreference> OtherParentheses { get; init; } = s_neverIfUnnecessaryPreference;
ParenthesesDiagnosticAnalyzersHelper.cs (1)
18internal static CodeStyleOption2<ParenthesesPreference> GetLanguageOption(AnalyzerOptionsProvider options, PrecedenceKind precedenceKind)
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (12)
ParenthesesOptionsProvider.cs (12)
23private static readonly CodeStyleOption2<ParenthesesPreference> IgnorePreference = 24new CodeStyleOption2<ParenthesesPreference>(ParenthesesPreference.AlwaysForClarity, NotificationOption2.None); 26private static readonly CodeStyleOption2<ParenthesesPreference> RequireForPrecedenceClarityPreference = 27new CodeStyleOption2<ParenthesesPreference>(ParenthesesPreference.AlwaysForClarity, NotificationOption2.Suggestion); 29private static readonly CodeStyleOption2<ParenthesesPreference> RemoveIfUnnecessaryPreference = 30new CodeStyleOption2<ParenthesesPreference>(ParenthesesPreference.NeverIfUnnecessary, NotificationOption2.Suggestion); 32private static IEnumerable<PerLanguageOption2<CodeStyleOption2<ParenthesesPreference>>> GetAllExceptOtherParenthesesOptions() 48private static IEnumerable<PerLanguageOption2<CodeStyleOption2<ParenthesesPreference>>> GetAllParenthesesOptions() 94private OptionsCollection GetSingleRequireOption(PerLanguageOption2<CodeStyleOption2<ParenthesesPreference>> option)