public void AddCommentNode(DocumentationCommentTriviaSyntax node, LocationStore commentLocationstore, ClassStore classStore, string fileName) { Comment comment = new DocComment(node.ToString(), node.GetLocation().GetLineSpan().StartLinePosition.Line + 1, node.GetLocation().GetLineSpan().EndLinePosition.Line) { FileName = fileName, }; comment.Initialize(commentLocationstore, classStore); Comments.Add(comment); }
private void HandleDocumentedNode(SyntaxNodeAnalysisContext context) { DocumentationCommentTriviaSyntax documentationComment = context.Node.GetDocumentationCommentTriviaSyntax(); if (documentationComment == null) { return; } // only report the diagnostic for elements which have documentation comments context.ReportDiagnostic(Diagnostic.Create(Descriptor, documentationComment.GetLocation())); }