private static bool CheckTrivia( PropertyDeclarationSyntax property, VariableDeclaratorSyntax declarator, CancellationToken cancellationToken) { if (property .DescendantTrivia(TextSpan.FromBounds(property.Identifier.Span.Start, property.Span.End)) .Any(f => !f.IsWhitespaceOrEndOfLine())) { return(false); } var variableDeclaration = (VariableDeclarationSyntax)declarator.Parent; if (variableDeclaration.Variables.Count == 1) { if (variableDeclaration .Parent .DescendantTrivia(variableDeclaration.Span) .Any(f => !f.IsWhitespaceOrEndOfLine())) { return(false); } } else if (declarator .DescendantTrivia(declarator.Span) .Any(f => !f.IsWhitespaceOrEndOfLine())) { return(false); } if (declarator.Initializer != null) { foreach (SyntaxTrivia trivia in property.GetTrailingTrivia()) { if (trivia.IsKind(SyntaxKind.EndOfLineTrivia)) { return(true); } else if (!trivia.IsKind(SyntaxKind.WhitespaceTrivia)) { return(false); } } } return(true); }