private static async Task ComputeRefactoringAsync(RefactoringContext context, SyntaxNode node, ExpressionSyntax expression)
        {
            SemanticModel semanticModel = await context.GetSemanticModelAsync().ConfigureAwait(false);

            ITypeSymbol exceptionSymbol = semanticModel.GetTypeSymbol(expression, context.CancellationToken);

            if (exceptionSymbol?.IsErrorType() == false &&
                Symbol.IsException(exceptionSymbol, semanticModel))
            {
                ISymbol declarationSymbol = GetDeclarationSymbol(node.SpanStart, semanticModel, context.CancellationToken);

                if (declarationSymbol != null)
                {
                    var containingMember = await declarationSymbol
                                           .DeclaringSyntaxReferences[0]
                                           .GetSyntaxAsync(context.CancellationToken)
                                           .ConfigureAwait(false) as MemberDeclarationSyntax;

                    if (containingMember != null)
                    {
                        SyntaxTrivia trivia = containingMember.GetSingleLineDocumentationComment();

                        if (trivia.IsKind(SyntaxKind.SingleLineDocumentationCommentTrivia))
                        {
                            var comment = trivia.GetStructure() as DocumentationCommentTriviaSyntax;

                            if (comment?.IsKind(SyntaxKind.SingleLineDocumentationCommentTrivia) == true &&
                                !ContainsException(comment, exceptionSymbol, semanticModel, context.CancellationToken))
                            {
                                ThrowInfo throwInfo1 = ThrowInfo.Create(node, exceptionSymbol);

                                IParameterSymbol parameterSymbol = throwInfo1.GetParameterSymbol(declarationSymbol, semanticModel, context.CancellationToken);

                                context.RegisterRefactoring(
                                    "Add exception to documentation comment",
                                    cancellationToken => RefactorAsync(context.Document, trivia, exceptionSymbol, parameterSymbol, cancellationToken));

                                foreach (ThrowInfo throwInfo2 in GetOtherUndocumentedExceptions(containingMember, f => node != f, semanticModel, context.CancellationToken))
                                {
                                    if (throwInfo2.ExceptionSymbol != exceptionSymbol)
                                    {
                                        var infos = new List <ThrowInfo>();
                                        infos.Add(throwInfo1);
                                        infos.Add(throwInfo2);

                                        context.RegisterRefactoring(
                                            "Add all exceptions to documentation comment",
                                            cancellationToken => RefactorAsync(context.Document, infos, containingMember, declarationSymbol, trivia, cancellationToken));

                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
 public IParameterSymbol GetParameterSymbol(
     SemanticModel semanticModel,
     CancellationToken cancellationToken)
 {
     return(ThrowInfo?.GetParameterSymbol(semanticModel, cancellationToken));
 }