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