private static bool IsFixable( SyntaxNode node, IdentifierNameSyntax identifierName, SemanticModel semanticModel, CancellationToken cancellationToken) { bool isFixable; UsePatternMatchingWalker walker = null; try { walker = UsePatternMatchingWalker.GetInstance(); walker.SetValues(identifierName, semanticModel, cancellationToken); walker.Visit(node); isFixable = walker.IsFixable.GetValueOrDefault(); } finally { if (walker != null) { UsePatternMatchingWalker.Free(walker); } } return(isFixable); }
private static bool IsFixable( SyntaxNode node, IdentifierNameSyntax identifierName, SemanticModel semanticModel, CancellationToken cancellationToken) { UsePatternMatchingWalker walker = UsePatternMatchingWalkerCache.GetInstance(); walker.SetValues(identifierName, semanticModel, cancellationToken); walker.Visit(node); return(UsePatternMatchingWalkerCache.GetIsFixableAndFree(walker)); }