4 instantiations of IndentBlockOperation
Microsoft.CodeAnalysis.Analyzers (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
110
operations.Add(new
IndentBlockOperation
(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\BaseIndentationFormattingRule.cs (1)
39
list.Add(new
IndentBlockOperation
(_token1, _token2, _span, _baseIndentation, IndentBlockOption.AbsolutePosition));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\FormattingOperations.cs (2)
63
=>
new
(startToken, endToken, textSpan, indentationDelta, option);
79
=>
new
(baseToken, startToken, endToken, textSpan, indentationDelta, option);
64 references to IndentBlockOperation
Microsoft.CodeAnalysis.Analyzers (64)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (14)
51
var
operation = GetIndentationDataFor(tree.GetRoot(cancellationToken), token, position);
110
IndentBlockOperation
startingOperation,
137
List<
IndentBlockOperation
> list,
145
var
operation = tuple.operation;
184
private (int indentation,
IndentBlockOperation
? operation) GetIndentationRuleOfCurrentPosition(
185
SyntaxNode root, List<
IndentBlockOperation
> list, int position)
189
foreach (
var
operation in operations)
213
private List<
IndentBlockOperation
> GetParentIndentBlockOperations(SyntaxToken token)
218
var list = new List<
IndentBlockOperation
>();
278
private
IndentBlockOperation
? GetIndentationDataFor(SyntaxNode root, SyntaxToken token, int position)
283
var list = new List<
IndentBlockOperation
>();
311
private static IEnumerable<
IndentBlockOperation
> GetIndentBlockOperationsFromSmallestSpan(SyntaxNode root, List<
IndentBlockOperation
> list, int position)
319
var
operation = list[i];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (8)
53
private List<
IndentBlockOperation
> _initialIndentBlockOperations = [];
96
var
initialOperation = indentationOperations[0];
121
SegmentedList<
IndentBlockOperation
> operations,
146
var mergedList = new List<
IndentBlockOperation
>(count);
178
public void AddIndentBlockOperation(
IndentBlockOperation
operation)
192
Func<FormattingContext,
IndentBlockOperation
, SyntaxToken> effectiveBaseTokenGetter = operation.Option.IsOn(IndentBlockOption.RelativeToFirstTokenOnBaseTokenLine)
196
Func<FormattingContext,
IndentBlockOperation
, SyntaxToken, int> relativeIndentationDeltaGetter = static (self, operation, effectiveBaseToken) =>
431
public IEnumerable<
IndentBlockOperation
> GetAllRelativeIndentBlockOperations()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.IndentationData.cs (9)
43
private readonly Func<FormattingContext,
IndentBlockOperation
, SyntaxToken> _effectiveBaseTokenGetter;
44
private readonly Func<FormattingContext,
IndentBlockOperation
, SyntaxToken, int> _indentationDeltaGetter;
56
public RelativeIndentationData(FormattingContext formattingContext, int inseparableRegionSpanStart, TextSpan textSpan,
IndentBlockOperation
operation, Func<FormattingContext,
IndentBlockOperation
, SyntaxToken> effectiveBaseTokenGetter, Func<FormattingContext,
IndentBlockOperation
, SyntaxToken, int> indentationDeltaGetter, Func<FormattingContext, SyntaxToken, int> baseIndentationGetter)
70
private RelativeIndentationData(FormattingContext formattingContext, int inseparableRegionSpanStart, TextSpan textSpan,
IndentBlockOperation
operation, Func<FormattingContext,
IndentBlockOperation
, SyntaxToken> effectiveBaseTokenGetter, Func<FormattingContext,
IndentBlockOperation
, SyntaxToken, int> indentationDeltaGetter, Func<FormattingContext, SyntaxToken, int> baseIndentationGetter, int lazyIndentationDelta)
85
public
IndentBlockOperation
Operation { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (5)
43
public (List<
IndentBlockOperation
> indentOperations, ImmutableArray<SuppressOperation> suppressOperations) Do(SyntaxToken startToken, SyntaxToken endToken)
66
private List<
IndentBlockOperation
> GetInitialIndentBlockOperations(SyntaxToken startToken, SyntaxToken endToken)
73
var operations = new List<
IndentBlockOperation
>();
74
var list = new List<
IndentBlockOperation
>();
82
foreach (
var
element in list)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (2)
160
var indentBlockOperationScratch = new List<
IndentBlockOperation
>();
417
private static SyntaxToken FindCorrectBaseTokenOfRelativeIndentBlockOperation(
IndentBlockOperation
operation, TokenStream tokenStream)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\ChainedFormattingRules.cs (1)
58
public void AddIndentBlockOperations(List<
IndentBlockOperation
> list, SyntaxNode currentNode)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\NodeOperations.cs (2)
17
private static readonly ObjectPool<SegmentedList<
IndentBlockOperation
>> s_indentBlockOperationPool = new(() => []);
24
public SegmentedList<
IndentBlockOperation
> IndentBlockOperation { get; } = s_indentBlockOperationPool.Allocate();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
344
this
IndentBlockOperation
operation, IHeaderFacts headerFacts, SyntaxNode root, SyntaxToken indentationAnchor)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\AbstractFormattingRule.cs (1)
35
public virtual void AddIndentBlockOperations(List<
IndentBlockOperation
> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\BaseIndentationFormattingRule.cs (6)
31
public override void AddIndentBlockOperations(List<
IndentBlockOperation
> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation)
54
private void AddNextIndentBlockOperations(List<
IndentBlockOperation
> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation)
65
private void AdjustIndentBlockOperation(List<
IndentBlockOperation
> list)
107
private bool Myself(
IndentBlockOperation
operation)
116
private
IndentBlockOperation
CloneAndAdjustFormattingOperation(
IndentBlockOperation
operation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\CompatAbstractFormattingRule.cs (2)
33
public sealed override void AddIndentBlockOperations(List<
IndentBlockOperation
> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation)
84
public virtual void AddIndentBlockOperationsSlow(List<
IndentBlockOperation
> list, SyntaxNode node, ref NextIndentBlockOperationAction nextOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\NextIndentBlockOperationAction.cs (1)
15
List<
IndentBlockOperation
> list)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\FormattingOperations.cs (6)
53
public static
IndentBlockOperation
CreateIndentBlockOperation(SyntaxToken startToken, SyntaxToken endToken, int indentationDelta, IndentBlockOption option)
62
public static
IndentBlockOperation
CreateIndentBlockOperation(SyntaxToken startToken, SyntaxToken endToken, TextSpan textSpan, int indentationDelta, IndentBlockOption option)
68
public static
IndentBlockOperation
CreateRelativeIndentBlockOperation(SyntaxToken baseToken, SyntaxToken startToken, SyntaxToken endToken, int indentationDelta, IndentBlockOption option)
78
public static
IndentBlockOperation
CreateRelativeIndentBlockOperation(SyntaxToken baseToken, SyntaxToken startToken, SyntaxToken endToken, TextSpan textSpan, int indentationDelta, IndentBlockOption option)
158
internal static IEnumerable<
IndentBlockOperation
> GetIndentBlockOperations(IEnumerable<AbstractFormattingRule> formattingRules, SyntaxNode node, SyntaxFormattingOptions options)
162
var list = new List<
IndentBlockOperation
>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\IndentBlockOption.cs (5)
10
/// Options for <see cref="
IndentBlockOperation
"/>.
21
/// <see cref="
IndentBlockOperation
.IndentationDeltaOrPosition"/> will be interpreted as delta of its enclosing indentation
26
/// <see cref="
IndentBlockOperation
.IndentationDeltaOrPosition"/> will be interpreted as absolute position
39
/// Each <see cref="
IndentBlockOperation
"/> specifies one of the position options to indicate the primary
45
/// Increase the <see cref="
IndentBlockOperation
.IndentationDeltaOrPosition"/> if the block is part of a
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (1)
22
public static readonly Comparison<
IndentBlockOperation
> IndentBlockOperationComparer = (o1, o2) =>