59 references to NewLineBeforeOpenBracePlacement
Microsoft.CodeAnalysis.CSharp.Workspaces (59)
Formatting\CSharpFormattingOptions.cs (14)
17
private static Option<bool> CreateNewLineForBracesOption(string publicName,
NewLineBeforeOpenBracePlacement
flag)
39
private readonly
NewLineBeforeOpenBracePlacement
_flag;
41
public NewLineForBracesInternalStorageMapping(IOption2 internalOption,
NewLineBeforeOpenBracePlacement
flag)
48
=> ((
NewLineBeforeOpenBracePlacement
)internalValue!).HasFlag(_flag);
51
=> ((
NewLineBeforeOpenBracePlacement
)currentInternalValue!).WithFlagValue(_flag, (bool)newPublicValue!);
162
public static Option<bool> NewLinesForBracesInTypes { get; } = CreateNewLineForBracesOption("NewLinesForBracesInTypes",
NewLineBeforeOpenBracePlacement
.Types);
163
public static Option<bool> NewLinesForBracesInMethods { get; } = CreateNewLineForBracesOption("NewLinesForBracesInMethods",
NewLineBeforeOpenBracePlacement
.Methods);
164
public static Option<bool> NewLinesForBracesInProperties { get; } = CreateNewLineForBracesOption("NewLinesForBracesInProperties",
NewLineBeforeOpenBracePlacement
.Properties);
165
public static Option<bool> NewLinesForBracesInAccessors { get; } = CreateNewLineForBracesOption("NewLinesForBracesInAccessors",
NewLineBeforeOpenBracePlacement
.Accessors);
166
public static Option<bool> NewLinesForBracesInAnonymousMethods { get; } = CreateNewLineForBracesOption("NewLinesForBracesInAnonymousMethods",
NewLineBeforeOpenBracePlacement
.AnonymousMethods);
167
public static Option<bool> NewLinesForBracesInControlBlocks { get; } = CreateNewLineForBracesOption("NewLinesForBracesInControlBlocks",
NewLineBeforeOpenBracePlacement
.ControlBlocks);
168
public static Option<bool> NewLinesForBracesInAnonymousTypes { get; } = CreateNewLineForBracesOption("NewLinesForBracesInAnonymousTypes",
NewLineBeforeOpenBracePlacement
.AnonymousTypes);
169
public static Option<bool> NewLinesForBracesInObjectCollectionArrayInitializers { get; } = CreateNewLineForBracesOption("NewLinesForBracesInObjectCollectionArrayInitializers",
NewLineBeforeOpenBracePlacement
.ObjectCollectionArrayInitializers);
170
public static Option<bool> NewLinesForBracesInLambdaExpressionBody { get; } = CreateNewLineForBracesOption("NewLinesForBracesInLambdaExpressionBody",
NewLineBeforeOpenBracePlacement
.LambdaExpressionBody);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpFormattingOptions2.cs (15)
45
private static readonly BidirectionalMap<string,
NewLineBeforeOpenBracePlacement
> s_legacyNewLineOptionsEditorConfigMap =
48
KeyValuePairUtil.Create("object_collection_array_initalizers",
NewLineBeforeOpenBracePlacement
.ObjectCollectionArrayInitializers),
50
private static readonly BidirectionalMap<string,
NewLineBeforeOpenBracePlacement
> s_newLineOptionsEditorConfigMap =
53
KeyValuePairUtil.Create("all",
NewLineBeforeOpenBracePlacement
.All),
54
KeyValuePairUtil.Create("accessors",
NewLineBeforeOpenBracePlacement
.Accessors),
55
KeyValuePairUtil.Create("types",
NewLineBeforeOpenBracePlacement
.Types),
56
KeyValuePairUtil.Create("methods",
NewLineBeforeOpenBracePlacement
.Methods),
57
KeyValuePairUtil.Create("properties",
NewLineBeforeOpenBracePlacement
.Properties),
58
KeyValuePairUtil.Create("anonymous_methods",
NewLineBeforeOpenBracePlacement
.AnonymousMethods),
59
KeyValuePairUtil.Create("control_blocks",
NewLineBeforeOpenBracePlacement
.ControlBlocks),
60
KeyValuePairUtil.Create("anonymous_types",
NewLineBeforeOpenBracePlacement
.AnonymousTypes),
61
KeyValuePairUtil.Create("object_collection_array_initializers",
NewLineBeforeOpenBracePlacement
.ObjectCollectionArrayInitializers),
62
KeyValuePairUtil.Create("lambdas",
NewLineBeforeOpenBracePlacement
.LambdaExpressionBody),
235
public static Option2<
NewLineBeforeOpenBracePlacement
> NewLineBeforeOpenBrace { get; } = CreateOption(
239
new EditorConfigValueSerializer<
NewLineBeforeOpenBracePlacement
>(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpFormattingOptions2.Parsers.cs (7)
76
internal static
NewLineBeforeOpenBracePlacement
ParseNewLineBeforeOpenBracePlacementList(string list)
77
=> (
NewLineBeforeOpenBracePlacement
)ParseEditorConfigFlags(
82
allValue: (int)
NewLineBeforeOpenBracePlacement
.All);
84
internal static string ToEditorConfigValue(
NewLineBeforeOpenBracePlacement
value)
87
NewLineBeforeOpenBracePlacement
.None => "none",
88
NewLineBeforeOpenBracePlacement
.All => "all",
89
_ => ToEditorConfigFlagList((int)value, static v => s_newLineOptionsEditorConfigMap[(
NewLineBeforeOpenBracePlacement
)v])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\NewLineBeforeOpenBracePlacement.cs (23)
27
public static
NewLineBeforeOpenBracePlacement
ToNewLineBeforeOpenBracePlacement(this NewLinePlacement value)
28
=> (value.HasFlag(NewLinePlacement.BeforeOpenBraceInTypes) ?
NewLineBeforeOpenBracePlacement
.Types : 0) |
29
(value.HasFlag(NewLinePlacement.BeforeOpenBraceInMethods) ?
NewLineBeforeOpenBracePlacement
.Methods : 0) |
30
(value.HasFlag(NewLinePlacement.BeforeOpenBraceInProperties) ?
NewLineBeforeOpenBracePlacement
.Properties : 0) |
31
(value.HasFlag(NewLinePlacement.BeforeOpenBraceInAnonymousMethods) ?
NewLineBeforeOpenBracePlacement
.AnonymousMethods : 0) |
32
(value.HasFlag(NewLinePlacement.BeforeOpenBraceInControlBlocks) ?
NewLineBeforeOpenBracePlacement
.ControlBlocks : 0) |
33
(value.HasFlag(NewLinePlacement.BeforeOpenBraceInAnonymousTypes) ?
NewLineBeforeOpenBracePlacement
.AnonymousTypes : 0) |
34
(value.HasFlag(NewLinePlacement.BeforeOpenBraceInObjectCollectionArrayInitializers) ?
NewLineBeforeOpenBracePlacement
.ObjectCollectionArrayInitializers : 0) |
35
(value.HasFlag(NewLinePlacement.BeforeOpenBraceInLambdaExpressionBody) ?
NewLineBeforeOpenBracePlacement
.LambdaExpressionBody : 0) |
36
(value.HasFlag(NewLinePlacement.BeforeOpenBraceInAccessors) ?
NewLineBeforeOpenBracePlacement
.Accessors : 0);
38
public static NewLinePlacement ToNewLinePlacement(this
NewLineBeforeOpenBracePlacement
value)
39
=> (value.HasFlag(
NewLineBeforeOpenBracePlacement
.Types) ? NewLinePlacement.BeforeOpenBraceInTypes : 0) |
40
(value.HasFlag(
NewLineBeforeOpenBracePlacement
.Methods) ? NewLinePlacement.BeforeOpenBraceInMethods : 0) |
41
(value.HasFlag(
NewLineBeforeOpenBracePlacement
.Properties) ? NewLinePlacement.BeforeOpenBraceInProperties : 0) |
42
(value.HasFlag(
NewLineBeforeOpenBracePlacement
.AnonymousMethods) ? NewLinePlacement.BeforeOpenBraceInAnonymousMethods : 0) |
43
(value.HasFlag(
NewLineBeforeOpenBracePlacement
.ControlBlocks) ? NewLinePlacement.BeforeOpenBraceInControlBlocks : 0) |
44
(value.HasFlag(
NewLineBeforeOpenBracePlacement
.AnonymousTypes) ? NewLinePlacement.BeforeOpenBraceInAnonymousTypes : 0) |
45
(value.HasFlag(
NewLineBeforeOpenBracePlacement
.ObjectCollectionArrayInitializers) ? NewLinePlacement.BeforeOpenBraceInObjectCollectionArrayInitializers : 0) |
46
(value.HasFlag(
NewLineBeforeOpenBracePlacement
.LambdaExpressionBody) ? NewLinePlacement.BeforeOpenBraceInLambdaExpressionBody : 0) |
47
(value.HasFlag(
NewLineBeforeOpenBracePlacement
.Accessors) ? NewLinePlacement.BeforeOpenBraceInAccessors : 0);
49
public static
NewLineBeforeOpenBracePlacement
WithFlagValue(this
NewLineBeforeOpenBracePlacement
flags,
NewLineBeforeOpenBracePlacement
flag, bool value)