21 references to PreferBracesPreference
Microsoft.CodeAnalysis.CSharp.CodeStyle (21)
src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (3)
52
if (option.Value ==
PreferBracesPreference
.None ||
97
if (option.Value ==
PreferBracesPreference
.WhenMultiline
234
/// <see cref="
PreferBracesPreference
.WhenMultiline"/> preference due to the presence of braces on one or more
src\Analyzers\CSharp\Analyzers\CodeStyle\CSharpAnalyzerOptionsProvider.cs (1)
29
public CodeStyleOption2<
PreferBracesPreference
> PreferBraces => GetOption(CSharpCodeStyleOptions.PreferBraces);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions.cs (1)
139
public static readonly Option2<CodeStyleOption2<
PreferBracesPreference
>> PreferBraces = CreateOption(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions_Parsing.cs (13)
105
private static CodeStyleOption2<
PreferBracesPreference
> ParsePreferBracesPreference(
107
CodeStyleOption2<
PreferBracesPreference
> defaultValue)
118
? new CodeStyleOption2<
PreferBracesPreference
>(
PreferBracesPreference
.Always, notificationOption)
119
: new CodeStyleOption2<
PreferBracesPreference
>(
PreferBracesPreference
.None, notificationOption);
124
return new CodeStyleOption2<
PreferBracesPreference
>(
PreferBracesPreference
.WhenMultiline, notificationOption);
131
private static string GetPreferBracesPreferenceEditorConfigString(CodeStyleOption2<
PreferBracesPreference
> value, CodeStyleOption2<
PreferBracesPreference
> defaultValue)
136
PreferBracesPreference
.None => $"false{notificationString}",
137
PreferBracesPreference
.WhenMultiline => $"when_multiline{notificationString}",
138
PreferBracesPreference
.Always => $"true{notificationString}",
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\CSharpSimplifierOptions.cs (3)
18
private static readonly CodeStyleOption2<
PreferBracesPreference
> s_defaultPreferBraces =
19
new(
PreferBracesPreference
.Always, NotificationOption2.Silent);
29
[DataMember] public CodeStyleOption2<
PreferBracesPreference
> PreferBraces { get; init; } = s_defaultPreferBraces;