private async Task <Document> AddNewLineToAttribute(Document document, AttributeListSyntax attribute, CancellationToken cancellationToken) { var leadingWhitespace = attribute.HasLeadingTrivia ? attribute.GetLeadingTrivia().Last() : SyntaxFactory.ElasticWhitespace(""); var newAttribute = GetNodeWithTrailingEOL(attribute.WithoutTrailingTrivia()); newAttribute = newAttribute .WithTrailingTrivia(newAttribute .GetTrailingTrivia() .Add(leadingWhitespace)); var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); root = root.ReplaceNode(attribute, newAttribute); return(document.WithSyntaxRoot(root)); }