private async Task <Document> FixCommentSpacingAsync(Document document, SyntaxToken token, CancellationToken cancellationToken) { var newDeclaration = token .WithLeadingTrivia(TriviaHelper.FixSingleLineCommentSpacing(token.LeadingTrivia)) .WithTrailingTrivia(TriviaHelper.FixSingleLineCommentSpacing(token.TrailingTrivia)); var root = await document.GetSyntaxRootAsync(); var newRoot = root.ReplaceToken(token, newDeclaration); return(document.WithSyntaxRoot(newRoot)); }