private static async Task <Document> RefactorAsync( Document document, SyntaxNode node, ExpressionSyntax expression, CancellationToken cancellationToken) { SemanticModel semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); ITypeSymbol exceptionSymbol = semanticModel.GetTypeSymbol(expression, cancellationToken); ISymbol declarationSymbol = AddExceptionToDocumentationCommentAnalysis.GetDeclarationSymbol(node.SpanStart, semanticModel, cancellationToken); var memberDeclaration = (MemberDeclarationSyntax)await declarationSymbol .GetSyntaxAsync(cancellationToken) .ConfigureAwait(false); SyntaxTrivia trivia = memberDeclaration.GetSingleLineDocumentationCommentTrivia(); ThrowInfo throwInfo = ThrowInfo.Create(node, exceptionSymbol, declarationSymbol); return(await RefactorAsync( document, trivia, throwInfo, memberDeclaration, declarationSymbol, semanticModel, cancellationToken) .ConfigureAwait(false)); }
public static async Task <Document> RefactorAsync( Document document, AddExceptionToDocumentationCommentAnalysis analysis, CancellationToken cancellationToken) { SemanticModel semanticModel = await document.GetSemanticModelAsync().ConfigureAwait(false); var memberDeclaration = await analysis.DeclarationSymbol .DeclaringSyntaxReferences[0] .GetSyntaxAsync(cancellationToken) .ConfigureAwait(false) as MemberDeclarationSyntax; return(await RefactorAsync( document, analysis.DocumentationComment, analysis.ThrowInfo, memberDeclaration, analysis.DeclarationSymbol, semanticModel, cancellationToken).ConfigureAwait(false)); }