105 references to AdjustNewLinesOption
Microsoft.CodeAnalysis.CodeStyle (21)
AbstractFormatEngine.cs (1)
391if (pair.LineOperation.Option == AdjustNewLinesOption.ForceLinesIfOnSingleLine)
AbstractFormatEngine.OperationApplier.cs (3)
147if (operation.Option == AdjustNewLinesOption.PreserveLines) 151else if (operation.Option == AdjustNewLinesOption.ForceLines) 157Debug.Assert(operation.Option == AdjustNewLinesOption.ForceLinesIfOnSingleLine);
AbstractTriviaFormatter.cs (3)
421case AdjustNewLinesOption.PreserveLines: 428case AdjustNewLinesOption.ForceLines: 431case AdjustNewLinesOption.ForceLinesIfOnSingleLine:
AdjustNewLinesOperation.cs (5)
14internal AdjustNewLinesOperation(int line, AdjustNewLinesOption option) 16Contract.ThrowIfFalse(option != AdjustNewLinesOption.ForceLines || line > 0); 17Contract.ThrowIfFalse(option != AdjustNewLinesOption.PreserveLines || line >= 0); 18Contract.ThrowIfFalse(option != AdjustNewLinesOption.ForceLinesIfOnSingleLine || line > 0); 25public AdjustNewLinesOption Option { get; }
FormattingOperations.cs (9)
14private static readonly AdjustNewLinesOperation s_preserveZeroLine = new(0, AdjustNewLinesOption.PreserveLines); 15private static readonly AdjustNewLinesOperation s_preserveOneLine = new(1, AdjustNewLinesOption.PreserveLines); 16private static readonly AdjustNewLinesOperation s_forceOneLine = new(1, AdjustNewLinesOption.ForceLines); 17private static readonly AdjustNewLinesOperation s_forceIfSameLine = new(1, AdjustNewLinesOption.ForceLinesIfOnSingleLine); 91public static AdjustNewLinesOperation CreateAdjustNewLinesOperation(int line, AdjustNewLinesOption option) 95if (option == AdjustNewLinesOption.PreserveLines) 102if (option == AdjustNewLinesOption.PreserveLines) 106else if (option == AdjustNewLinesOption.ForceLines) 110else if (option == AdjustNewLinesOption.ForceLinesIfOnSingleLine)
Microsoft.CodeAnalysis.CSharp.CodeStyle (56)
BaseFormattingRule.cs (1)
155protected static AdjustNewLinesOperation CreateAdjustNewLinesOperation(int line, AdjustNewLinesOption option)
CSharpSmartTokenFormatter.cs (2)
134if (lineOperation.Option == AdjustNewLinesOption.ForceLinesIfOnSingleLine) 141return FormattingOperations.CreateAdjustNewLinesOperation(line: 0, option: AdjustNewLinesOption.PreserveLines);
ElasticTriviaFormattingRule.cs (12)
111return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 121return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 135return CreateAdjustNewLinesOperation(num, AdjustNewLinesOption.ForceLinesIfOnSingleLine); 139if (operation.Option == AdjustNewLinesOption.ForceLines) 156return CreateAdjustNewLinesOperation(0, AdjustNewLinesOption.PreserveLines); 159return CreateAdjustNewLinesOperation(line, AdjustNewLinesOption.ForceLines); 179return FormattingOperations.CreateAdjustNewLinesOperation(2, AdjustNewLinesOption.ForceLines); 208return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.ForceLines); 219return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 231return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 236return FormattingOperations.CreateAdjustNewLinesOperation(2 /* +1 for member itself and +1 for a blank line*/, AdjustNewLinesOption.ForceLines); 254operation = CreateAdjustNewLinesOperation(numberOfLines + addedLines, AdjustNewLinesOption.ForceLines);
EndOfFileTokenFormattingRule.cs (1)
19return CreateAdjustNewLinesOperation(0, AdjustNewLinesOption.PreserveLines);
NewLineUserSettingFormattingRule.cs (18)
230return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 235return CreateAdjustNewLinesOperation(0, AdjustNewLinesOption.PreserveLines); 244return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 249return CreateAdjustNewLinesOperation(0, AdjustNewLinesOption.PreserveLines); 259return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 272return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 285return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 298return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 311return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 328return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 357return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 370return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 383return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.ForceLinesIfOnSingleLine); 396return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 410return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.ForceLinesIfOnSingleLine); 423return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 436return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 451return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines);
QueryExpressionFormattingRule.cs (3)
138return CreateAdjustNewLinesOperation(0, AdjustNewLinesOption.PreserveLines); 160return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 164return CreateAdjustNewLinesOperation(0, AdjustNewLinesOption.PreserveLines);
TokenBasedFormattingRule.cs (19)
58return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 69return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 75return CreateAdjustNewLinesOperation(0, AdjustNewLinesOption.PreserveLines); 101return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 113return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 121return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 133return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 145return CreateAdjustNewLinesOperation(0, AdjustNewLinesOption.PreserveLines); 151return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 157return CreateAdjustNewLinesOperation(0, AdjustNewLinesOption.PreserveLines); 164return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 170return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 175return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 188return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 207return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines); 210return CreateAdjustNewLinesOperation(0, AdjustNewLinesOption.PreserveLines); 221return CreateAdjustNewLinesOperation(0, AdjustNewLinesOption.PreserveLines); 237return CreateAdjustNewLinesOperation(2, AdjustNewLinesOption.PreserveLines); 243return CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
CSharpIndentationService.cs (1)
96if (lineOperation == null || lineOperation.Option == AdjustNewLinesOption.ForceLinesIfOnSingleLine)
MultiLineConditionalExpressionFormattingRule.cs (1)
51return FormattingOperations.CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.ForceLines);
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (22)
BaseFormattingRule.vb (1)
99Protected Shared Function CreateAdjustNewLinesOperation(line As Integer, [option] As AdjustNewLinesOption) As AdjustNewLinesOperation
DefaultOperationProvider.vb (7)
67Return FormattingOperations.CreateAdjustNewLinesOperation(0, AdjustNewLinesOption.PreserveLines) 87Return FormattingOperations.CreateAdjustNewLinesOperation(0, AdjustNewLinesOption.PreserveLines) 98Return FormattingOperations.CreateAdjustNewLinesOperation(0, AdjustNewLinesOption.PreserveLines) 109Return FormattingOperations.CreateAdjustNewLinesOperation(0, AdjustNewLinesOption.PreserveLines) 113Return FormattingOperations.CreateAdjustNewLinesOperation(0, AdjustNewLinesOption.PreserveLines) 141Return FormattingOperations.CreateAdjustNewLinesOperation(2, AdjustNewLinesOption.PreserveLines) 148Return FormattingOperations.CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines)
ElasticTriviaFormattingRule.vb (14)
136If operation IsNot Nothing AndAlso operation.Option = AdjustNewLinesOption.ForceLines Then 144[option]:=AdjustNewLinesOption.ForceLines) 152[option]:=AdjustNewLinesOption.ForceLines) 160[option]:=AdjustNewLinesOption.ForceLines) 167[option]:=AdjustNewLinesOption.ForceLines) 174[option]:=AdjustNewLinesOption.ForceLines) 180[option]:=AdjustNewLinesOption.ForceLines) 188Return FormattingOperations.CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.ForceLines) 204Return FormattingOperations.CreateAdjustNewLinesOperation(2, AdjustNewLinesOption.ForceLines) 209Return FormattingOperations.CreateAdjustNewLinesOperation(2, AdjustNewLinesOption.ForceLines) 216Return FormattingOperations.CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.PreserveLines) 219Return CreateAdjustNewLinesOperation(Math.Max(If(operation Is Nothing, 1, operation.Line), 0), AdjustNewLinesOption.PreserveLines) 223Return CreateAdjustNewLinesOperation(0, AdjustNewLinesOption.PreserveLines) 226Return CreateAdjustNewLinesOperation(lines.Value, AdjustNewLinesOption.ForceLines)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (4)
MultiLineConditionalExpressionFormattingRule.vb (1)
45Return FormattingOperations.CreateAdjustNewLinesOperation(1, AdjustNewLinesOption.ForceLines)
SpecialFormattingOperation.vb (2)
30Return FormattingOperations.CreateAdjustNewLinesOperation(0, AdjustNewLinesOption.PreserveLines) 38Return FormattingOperations.CreateAdjustNewLinesOperation(line:=0, option:=AdjustNewLinesOption.PreserveLines)
VisualBasicIndentationService.vb (1)
91If lineOperation IsNot Nothing AndAlso lineOperation.Option <> AdjustNewLinesOption.ForceLinesIfOnSingleLine Then