private Task <Document> AddCodeCommentAsync(Document document, BaseTypeDeclarationSyntax declaration, CancellationToken c) { string[] doxygenComments = GetDoxygenComments(declaration); var leadingTrivias = declaration.GetLeadingTrivia(); var whitespaceCount = leadingTrivias[leadingTrivias.Count - 1].Span.Length; var newDeclaration = declaration.WithLeadingTrivia( AnalyzerUtil.GetNewLeadingTrivia(leadingTrivias, codeComments, whitespaceCount)); return(AnalyzerUtil.ReplaceNode(declaration, newDeclaration, document)); }
private Task <Document> AddMethodReturnsCommentAsync(Document document, BaseMethodDeclarationSyntax declaration, CancellationToken c) { var returnsComments = GetReturnComments(declaration); var leadingTrivias = declaration.GetLeadingTrivia(); var whitespaceCount = leadingTrivias[leadingTrivias.Count - 1].Span.Length; var newDeclaration = declaration.WithLeadingTrivia( AnalyzerUtil.GetNewLeadingTrivia(leadingTrivias, returnsComments, whitespaceCount)); return(AnalyzerUtil.ReplaceNode(declaration, newDeclaration, document)); }