83 references to NewLinePlacement
Microsoft.CodeAnalysis.CSharp.CodeStyle (83)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpFormattingOptions2.cs (6)
245
CSharpSyntaxFormattingOptions.NewLinesDefault.HasFlag(
NewLinePlacement
.BeforeElse))
250
CSharpSyntaxFormattingOptions.NewLinesDefault.HasFlag(
NewLinePlacement
.BeforeCatch))
255
CSharpSyntaxFormattingOptions.NewLinesDefault.HasFlag(
NewLinePlacement
.BeforeFinally))
260
CSharpSyntaxFormattingOptions.NewLinesDefault.HasFlag(
NewLinePlacement
.BeforeMembersInObjectInitializers))
265
CSharpSyntaxFormattingOptions.NewLinesDefault.HasFlag(
NewLinePlacement
.BeforeMembersInAnonymousTypes))
270
CSharpSyntaxFormattingOptions.NewLinesDefault.HasFlag(
NewLinePlacement
.BetweenQueryExpressionClauses))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpSyntaxFormattingOptions.cs (23)
30
public const
NewLinePlacement
NewLinesDefault =
31
NewLinePlacement
.BeforeMembersInObjectInitializers |
32
NewLinePlacement
.BeforeMembersInAnonymousTypes |
33
NewLinePlacement
.BeforeElse |
34
NewLinePlacement
.BeforeCatch |
35
NewLinePlacement
.BeforeFinally |
36
NewLinePlacement
.BeforeOpenBraceInTypes |
37
NewLinePlacement
.BeforeOpenBraceInAnonymousTypes |
38
NewLinePlacement
.BeforeOpenBraceInObjectCollectionArrayInitializers |
39
NewLinePlacement
.BeforeOpenBraceInProperties |
40
NewLinePlacement
.BeforeOpenBraceInMethods |
41
NewLinePlacement
.BeforeOpenBraceInAccessors |
42
NewLinePlacement
.BeforeOpenBraceInAnonymousMethods |
43
NewLinePlacement
.BeforeOpenBraceInLambdaExpressionBody |
44
NewLinePlacement
.BeforeOpenBraceInControlBlocks |
45
NewLinePlacement
.BetweenQueryExpressionClauses;
57
[DataMember] public
NewLinePlacement
NewLines { get; init; } = NewLinesDefault;
97
(options.GetOption(CSharpFormattingOptions2.NewLineForMembersInObjectInit) ?
NewLinePlacement
.BeforeMembersInObjectInitializers : 0) |
98
(options.GetOption(CSharpFormattingOptions2.NewLineForMembersInAnonymousTypes) ?
NewLinePlacement
.BeforeMembersInAnonymousTypes : 0) |
99
(options.GetOption(CSharpFormattingOptions2.NewLineForElse) ?
NewLinePlacement
.BeforeElse : 0) |
100
(options.GetOption(CSharpFormattingOptions2.NewLineForCatch) ?
NewLinePlacement
.BeforeCatch : 0) |
101
(options.GetOption(CSharpFormattingOptions2.NewLineForFinally) ?
NewLinePlacement
.BeforeFinally : 0) |
103
(options.GetOption(CSharpFormattingOptions2.NewLineForClausesInQuery) ?
NewLinePlacement
.BetweenQueryExpressionClauses : 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\NewLineBeforeOpenBracePlacement.cs (20)
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);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\NewLineUserSettingFormattingRule.cs (31)
87
if (!_options.NewLines.HasFlag(
NewLinePlacement
.BeforeElse))
96
if (!_options.NewLines.HasFlag(
NewLinePlacement
.BeforeCatch))
105
if (!_options.NewLines.HasFlag(
NewLinePlacement
.BeforeFinally))
114
if (!_options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInTypes))
123
if (!_options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInAnonymousTypes))
138
if (!_options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInObjectCollectionArrayInitializers))
145
if (!_options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInObjectCollectionArrayInitializers))
171
? _options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInProperties)
172
: _options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInMethods);
182
if (!_options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInAccessors))
191
if (!_options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInAnonymousMethods))
200
if (!_options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInMethods))
210
if (!_options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInLambdaExpressionBody))
219
if (!_options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInObjectCollectionArrayInitializers))
228
if (!_options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInControlBlocks))
248
if (_options.NewLines.HasFlag(
NewLinePlacement
.BeforeMembersInObjectInitializers))
262
if (_options.NewLines.HasFlag(
NewLinePlacement
.BeforeMembersInAnonymousTypes))
276
if (_options.NewLines.HasFlag(
NewLinePlacement
.BeforeElse)
290
if (_options.NewLines.HasFlag(
NewLinePlacement
.BeforeCatch))
303
if (_options.NewLines.HasFlag(
NewLinePlacement
.BeforeFinally))
316
if (_options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInTypes))
329
if (_options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInAnonymousTypes))
346
if (_options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInObjectCollectionArrayInitializers))
372
? _options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInProperties)
373
: _options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInMethods);
388
if (_options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInAccessors))
401
if (_options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInAnonymousMethods))
414
if (_options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInMethods))
428
if (_options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInLambdaExpressionBody))
441
if (_options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInObjectCollectionArrayInitializers))
454
if (_options.NewLines.HasFlag(
NewLinePlacement
.BeforeOpenBraceInControlBlocks))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\QueryExpressionFormattingRule.cs (3)
34
if (_options.NewLines.HasFlag(
NewLinePlacement
.BetweenQueryExpressionClauses) == newOptions.NewLines.HasFlag(
NewLinePlacement
.BetweenQueryExpressionClauses))
159
if (_options.NewLines.HasFlag(
NewLinePlacement
.BetweenQueryExpressionClauses))