public override void VisitThrowStatement(Microsoft.CodeAnalysis.CSharp.Syntax.ThrowStatementSyntax node) { cancellationToken.ThrowIfCancellationRequested(); base.VisitThrowStatement(node); var createExpression = node.Expression as ObjectCreationExpressionSyntax; if (createExpression == null) { return; } var st = createExpression.Type.ToString(); if (st == "NotImplementedException" || st == "System.NotImplementedException") { var loc = node.GetLocation().GetLineSpan(); if (createExpression.ArgumentList.Arguments.Count > 0) { Tags.Add(new Tag("High", GettextCatalog.GetString("NotImplementedException({0}) thrown.", createExpression.ArgumentList.Arguments.First().ToString()), new DocumentRegion(loc.StartLinePosition, loc.EndLinePosition))); } else { Tags.Add(new Tag("High", GettextCatalog.GetString("NotImplementedException thrown."), new DocumentRegion(loc.StartLinePosition, loc.EndLinePosition))); } } }
public override SyntaxList <StatementSyntax> VisitThrowStatement(CSS.ThrowStatementSyntax node) { StatementSyntax stmt; if (node.Expression == null) { stmt = SyntaxFactory.ThrowStatement(); } else { stmt = SyntaxFactory.ThrowStatement((ExpressionSyntax)node.Expression.Accept(_nodesVisitor)); } return(SyntaxFactory.SingletonList(stmt)); }
public override SyntaxList <VB.Syntax.StatementSyntax> VisitThrowStatement(CS.Syntax.ThrowStatementSyntax node) { return(List <VB.Syntax.StatementSyntax>( VB.SyntaxFactory.ThrowStatement(nodeVisitor.VisitExpression(node.Expression)))); }