private static bool IsFixable(BlockSyntax body) { UseAsyncAwaitWalker walker = UseAsyncAwaitWalker.GetInstance(); walker.VisitBlock(body); ReturnStatementSyntax returnStatement = walker.ReturnStatement; UseAsyncAwaitWalker.Free(walker); return(returnStatement != null); }
private static bool IsFixable(BlockSyntax body, SyntaxNodeAnalysisContext context) { UseAsyncAwaitWalker walker = null; try { walker = UseAsyncAwaitWalker.GetInstance(context.SemanticModel, context.CancellationToken); walker.VisitBlock(body); return(walker.ReturnStatement != null); } finally { if (walker != null) { UseAsyncAwaitWalker.Free(walker); } } }