private async Task<Document> MakePrivateAsync(Document document, FieldDeclarationSyntax fieldDeclaration, CancellationToken cancellationToken) { SyntaxToken privateSyntaxToken = CreatePrivateSyntaxToken(fieldDeclaration); IEnumerable<SyntaxToken> newFieldModifiers = new[] { privateSyntaxToken }.Union( fieldDeclaration.Modifiers.Where(modifier => modifier.Kind() != SyntaxKind.InternalKeyword && modifier.Kind() != SyntaxKind.PublicKeyword) .Select(modifier => modifier.WithLeadingTrivia())); FieldDeclarationSyntax newfieldDeclaration = fieldDeclaration.Update(fieldDeclaration.AttributeLists, new SyntaxTokenList().AddRange(newFieldModifiers), fieldDeclaration.Declaration.WithoutTrivia(), fieldDeclaration.SemicolonToken) .WithLeadingTrivia(fieldDeclaration.GetLeadingTrivia()) .WithTrailingTrivia(fieldDeclaration.GetTrailingTrivia()); return await this.ReplaceNodeInDocumentAsync(document, cancellationToken, fieldDeclaration, newfieldDeclaration); }