Esempio n. 1
0
        private void ApplyEndOfTreeTriviaOperation(
            FormattingContext context, TokenStream tokenStream, CancellationToken cancellationToken)
        {
            if (!tokenStream.FormatEndOfTree)
            {
                return;
            }

            Action <int, TriviaData> endOfTreeTriviaInfoApplier = (i, info) =>
            {
                tokenStream.ApplyEndOfTreeChange(info);
            };

            // remove all trailing indentation
            var triviaInfo = tokenStream.GetTriviaDataAtEndOfTree().WithIndentation(0, context, this.formattingRules, cancellationToken);

            triviaInfo.Format(context, this.formattingRules, endOfTreeTriviaInfoApplier, cancellationToken);
        }