21 references to PreferBracesPreference
Microsoft.CodeAnalysis.CSharp.Features (1)
src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (1)
234
/// <see cref="
PreferBracesPreference
.WhenMultiline"/> preference due to the presence of braces on one or more
Microsoft.CodeAnalysis.CSharp.Workspaces (20)
Simplification\Reducers\CSharpMiscellaneousReducer.cs (3)
131
case
PreferBracesPreference
.Always:
135
case
PreferBracesPreference
.WhenMultiline:
169
case
PreferBracesPreference
.None:
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;