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