private static bool ContainsException(DocumentationCommentTriviaSyntax comment, ITypeSymbol exceptionSymbol, SemanticModel semanticModel, CancellationToken cancellationToken) { foreach (XmlElementSyntax xmlElement in comment.ExceptionElements()) { XmlElementStartTagSyntax startTag = xmlElement.StartTag; if (startTag != null) { foreach (XmlAttributeSyntax xmlAttribute in startTag.Attributes) { if (xmlAttribute.IsKind(SyntaxKind.XmlCrefAttribute)) { var xmlCrefAttribute = (XmlCrefAttributeSyntax)xmlAttribute; CrefSyntax cref = xmlCrefAttribute.Cref; if (cref != null) { ISymbol symbol = semanticModel.GetSymbol(cref, cancellationToken); if (exceptionSymbol.Equals(symbol)) { return(true); } } } } } } return(false); }