2 types derived from TriviaData
Microsoft.CodeAnalysis.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractTriviaDataFactory.FormattedWhitespace.cs (1)
16
protected sealed class FormattedWhitespace :
TriviaData
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractTriviaDataFactory.Whitespace.cs (1)
20
protected class Whitespace :
TriviaData
69 references to TriviaData
Microsoft.CodeAnalysis.CodeStyle (69)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (2)
46
protected abstract SyntaxNode Rewriter(Dictionary<ValueTuple<SyntaxToken, SyntaxToken>,
TriviaData
> changeMap, CancellationToken cancellationToken);
104
var map = new Dictionary<ValueTuple<SyntaxToken, SyntaxToken>,
TriviaData
>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (7)
261
var
triviaInfo = context.TokenStream.GetTriviaDataAtBeginningOfTree().WithIndentation(0, context, _formattingRules, cancellationToken);
268
static void BeginningOfTreeTriviaInfoApplier(int i, TokenStream ts,
TriviaData
info)
287
var
triviaInfo = context.TokenStream.GetTriviaDataAtEndOfTree().WithIndentation(0, context, _formattingRules, cancellationToken);
294
static void EndOfTreeTriviaInfoApplier(int i, TokenStream ts,
TriviaData
info)
311
static void RegularApplier(int tokenPairIndex, TokenStream ts,
TriviaData
info)
321
var
triviaInfo = ctx.TokenStream.GetTriviaData(tokenPairIndex);
452
var
triviaInfo = context.TokenStream.GetTriviaData(operation.PairIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (2)
322
TriviaData
triviaInfo,
447
TriviaData
triviaInfo,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (4)
44
protected abstract SyntaxNode Rewriter(Dictionary<ValueTuple<SyntaxToken, SyntaxToken>,
TriviaData
> map, CancellationToken cancellationToken);
76
private void AddTextChanges(List<TextChange> list, SyntaxToken token1, SyntaxToken token2,
TriviaData
data)
95
using var pooledObject = SharedPools.Default<Dictionary<ValueTuple<SyntaxToken, SyntaxToken>,
TriviaData
>>().GetPooledObject();
110
internal IEnumerable<ValueTuple<ValueTuple<SyntaxToken, SyntaxToken>,
TriviaData
>> GetChanges(CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractTriviaDataFactory.AbstractComplexTrivia.cs (5)
39
protected abstract
TriviaData
CreateComplexTrivia(int line, int space);
40
protected abstract
TriviaData
CreateComplexTrivia(int line, int space, int indentation);
54
public override
TriviaData
WithSpace(int space, FormattingContext context, ChainedFormattingRules formattingRules)
73
public override
TriviaData
WithLine(
115
public override
TriviaData
WithIndentation(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractTriviaDataFactory.cs (5)
90
protected
TriviaData
GetSpaceTriviaData(int space, bool elastic = false)
109
protected
TriviaData
GetWhitespaceTriviaData(int lineBreaks, int indentation, bool useTriviaAsItIs, bool elastic)
140
public abstract
TriviaData
CreateLeadingTrivia(SyntaxToken token);
141
public abstract
TriviaData
CreateTrailingTrivia(SyntaxToken token);
142
public abstract
TriviaData
Create(SyntaxToken token1, SyntaxToken token2);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractTriviaDataFactory.FormattedWhitespace.cs (4)
56
public override
TriviaData
WithSpace(int space, FormattingContext context, ChainedFormattingRules formattingRules)
59
public override
TriviaData
WithLine(int line, int indentation, FormattingContext context, ChainedFormattingRules formattingRules, CancellationToken cancellationToken)
62
public override
TriviaData
WithIndentation(int indentation, FormattingContext context, ChainedFormattingRules formattingRules, CancellationToken cancellationToken)
66
FormattingContext context, ChainedFormattingRules formattingRules, Action<int, TokenStream,
TriviaData
> formattingResultApplier, CancellationToken cancellationToken, int tokenPairIndex = TokenPairIndexNotNeeded)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractTriviaDataFactory.ModifiedWhitespace.cs (4)
33
public override
TriviaData
WithSpace(int space, FormattingContext context, ChainedFormattingRules formattingRules)
48
public override
TriviaData
WithLine(int line, int indentation, FormattingContext context, ChainedFormattingRules formattingRules, CancellationToken cancellationToken)
63
public override
TriviaData
WithIndentation(
82
Action<int, TokenStream,
TriviaData
> formattingResultApplier,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractTriviaDataFactory.Whitespace.cs (4)
47
public override
TriviaData
WithSpace(int space, FormattingContext context, ChainedFormattingRules formattingRules)
55
public override
TriviaData
WithLine(int line, int indentation, FormattingContext context, ChainedFormattingRules formattingRules, CancellationToken cancellationToken)
67
public override
TriviaData
WithIndentation(
81
Action<int, TokenStream,
TriviaData
> formattingResultApplier,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.Changes.cs (4)
22
private ConcurrentDictionary<int,
TriviaData
> _map;
27
public void AddOrReplace(int key,
TriviaData
triviaInfo)
32
var map = InterlockedOperations.Initialize(ref _map, () => new ConcurrentDictionary<int,
TriviaData
>(concurrencyLevel: 1, capacity: 8));
36
public readonly bool TryGet(int key, [NotNullWhen(true)] out
TriviaData
? triviaInfo)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (24)
33
private readonly SegmentedArray<
TriviaData
> _cachedOriginalTriviaInfo;
48
private readonly Func<TokenData, TokenData,
TriviaData
> _getTriviaData;
49
private readonly Func<TokenData, TokenData,
TriviaData
> _getOriginalTriviaData;
68
_cachedOriginalTriviaInfo = new SegmentedArray<
TriviaData
>(this.TokenCount - 1);
202
private bool TwoTokensOnSameLineWorker(SyntaxToken token1, SyntaxToken token2, Func<TokenData, TokenData,
TriviaData
> triviaDataGetter)
235
public void ApplyBeginningOfTreeChange(
TriviaData
data)
241
public void ApplyEndOfTreeChange(
TriviaData
data)
247
public void ApplyChange(int pairIndex,
TriviaData
data)
284
private int GetColumn(TokenData tokenData, Func<TokenData, TokenData,
TriviaData
> triviaDataGetter)
292
var
triviaInfo = triviaDataGetter(previousToken, tokenData);
346
public IEnumerable<ValueTuple<ValueTuple<SyntaxToken, SyntaxToken>,
TriviaData
>> GetTriviaDataWithTokenPair(CancellationToken cancellationToken)
352
var
trivia = this.GetTriviaDataAtBeginningOfTree();
362
var
trivia = this.GetTriviaData(pairIndex);
370
var
trivia = this.GetTriviaDataAtEndOfTree();
376
public
TriviaData
GetTriviaData(TokenData token1, TokenData token2)
403
private
TriviaData
GetOriginalTriviaData(TokenData token1, TokenData token2)
427
public
TriviaData
GetTriviaDataAtBeginningOfTree()
430
if (_changes.TryGet(Changes.BeginningOfTreeKey, out
var
data))
439
public
TriviaData
GetTriviaDataAtEndOfTree()
442
if (_changes.TryGet(Changes.EndOfTreeKey, out
var
data))
451
public
TriviaData
GetTriviaData(int pairIndex)
454
if (_changes.TryGet(pairIndex, out
var
data))
463
private
TriviaData
GetOriginalTriviaData(int pairIndex)
469
var
info = _factory.Create(_tokens[pairIndex], _tokens[pairIndex + 1]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TriviaData.cs (4)
39
public abstract
TriviaData
WithSpace(int space, FormattingContext context, ChainedFormattingRules formattingRules);
41
public abstract
TriviaData
WithLine(int line, int indentation, FormattingContext context, ChainedFormattingRules formattingRules, CancellationToken cancellationToken);
43
public abstract
TriviaData
WithIndentation(int indentation, FormattingContext context, ChainedFormattingRules formattingRules, CancellationToken cancellationToken);
48
Action<int, TokenStream,
TriviaData
> formattingResultApplier,