22 references to ParenthesesPreference
Microsoft.CodeAnalysis.CodeStyle (22)
src\Analyzers\Core\Analyzers\AddRequiredParentheses\AbstractAddRequiredParenthesesDiagnosticAnalyzer.cs (1)
116
if (preference.Value !=
ParenthesesPreference
.AlwaysForClarity
src\Analyzers\Core\Analyzers\AnalyzerOptionsProvider.cs (4)
62
public CodeStyleOption2<
ParenthesesPreference
> ArithmeticBinaryParentheses => GetOption(CodeStyleOptions2.ArithmeticBinaryParentheses);
63
public CodeStyleOption2<
ParenthesesPreference
> OtherBinaryParentheses => GetOption(CodeStyleOptions2.OtherBinaryParentheses);
64
public CodeStyleOption2<
ParenthesesPreference
> RelationalBinaryParentheses => GetOption(CodeStyleOptions2.RelationalBinaryParentheses);
65
public CodeStyleOption2<
ParenthesesPreference
> OtherParentheses => GetOption(CodeStyleOptions2.OtherParentheses);
src\Analyzers\Core\Analyzers\ParenthesesDiagnosticAnalyzersHelper.cs (1)
24
internal static CodeStyleOption2<
ParenthesesPreference
> GetLanguageOption(AnalyzerOptionsProvider options, PrecedenceKind precedenceKind)
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (2)
94
if (preference.Value ==
ParenthesesPreference
.AlwaysForClarity &&
104
Debug.Assert(preference.Value ==
ParenthesesPreference
.NeverIfUnnecessary ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (14)
244
private static readonly BidirectionalMap<string,
ParenthesesPreference
> s_parenthesesPreferenceMap =
247
KeyValuePairUtil.Create("always_for_clarity",
ParenthesesPreference
.AlwaysForClarity),
248
KeyValuePairUtil.Create("never_if_unnecessary",
ParenthesesPreference
.NeverIfUnnecessary),
251
private static PerLanguageOption2<CodeStyleOption2<
ParenthesesPreference
>> CreateParenthesesOption(CodeStyleOption2<
ParenthesesPreference
> defaultValue, string name)
262
return new CodeStyleOption2<
ParenthesesPreference
>(s_parenthesesPreferenceMap.GetValueOrDefault(value), notification);
270
var value = s_parenthesesPreferenceMap.GetKeyOrDefault(option.Value) ?? s_parenthesesPreferenceMap.GetKeyOrDefault(
ParenthesesPreference
.AlwaysForClarity);
274
private static readonly CodeStyleOption2<
ParenthesesPreference
> s_alwaysForClarityPreference =
275
new(
ParenthesesPreference
.AlwaysForClarity, NotificationOption2.Silent);
277
internal static readonly PerLanguageOption2<CodeStyleOption2<
ParenthesesPreference
>> ArithmeticBinaryParentheses =
282
internal static readonly PerLanguageOption2<CodeStyleOption2<
ParenthesesPreference
>> OtherBinaryParentheses =
287
internal static readonly PerLanguageOption2<CodeStyleOption2<
ParenthesesPreference
>> RelationalBinaryParentheses =
292
internal static readonly PerLanguageOption2<CodeStyleOption2<
ParenthesesPreference
>> OtherParentheses =
294
defaultValue: new(
ParenthesesPreference
.NeverIfUnnecessary, NotificationOption2.Silent),