コード例 #1
0
        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);
        }
コード例 #2
0
        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()));
        }