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