59 references to ThrowStatementSyntax
Microsoft.CodeAnalysis.CSharp (9)
Binder\Binder_Statements.cs (2)
121result = BindThrow((ThrowStatementSyntax)node, diagnostics); 434private BoundStatement BindThrow(ThrowStatementSyntax node, BindingDiagnosticBag diagnostics)
Binder\ExpressionVariableFinder.cs (1)
178public override void VisitThrowStatement(ThrowStatementSyntax node)
Binder\LocalBinderFactory.cs (1)
971public override void VisitThrowStatement(ThrowStatementSyntax node)
Parser\LanguageParser.cs (1)
9861private ThrowStatementSyntax ParseThrowStatement(SyntaxList<AttributeListSyntax> attributes)
Syntax\LookupPosition.cs (2)
353return ((ThrowStatementSyntax)statement).ThrowKeyword; 416return ((ThrowStatementSyntax)statement).SemicolonToken;
Syntax\ThrowStatementSyntax.cs (2)
11public ThrowStatementSyntax Update(SyntaxToken throwKeyword, ExpressionSyntax expression, SyntaxToken semicolonToken) 20public static ThrowStatementSyntax ThrowStatement(SyntaxToken throwKeyword, ExpressionSyntax expression, SyntaxToken semicolonToken)
Microsoft.CodeAnalysis.CSharp.CodeStyle (7)
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (1)
283public override SyntaxKind VisitThrowStatement(ThrowStatementSyntax node)
src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
50return methodSyntax.Body is { Statements: [ThrowStatementSyntax] };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
202else if (firstStatement is ThrowStatementSyntax throwStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
143(nodeParent is ThrowStatementSyntax throwStatement && throwStatement.Expression == node) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1771=> ((ThrowStatementSyntax)node).Expression;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
36ThrowStatementSyntax, 651protected override ExpressionSyntax GetThrowStatementExpression(ThrowStatementSyntax throwStatement)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (7)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
283public override ExpressionSyntax VisitThrowStatement(ThrowStatementSyntax node)
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionHelpers.cs (2)
15var throwStatement = (ThrowStatementSyntax)throwOperation.Syntax;
src\Analyzers\CSharp\CodeFixes\UseThrowExpression\UseThrowExpressionCodeFixProvider.cs (1)
63if (throwStatementExpression.Parent is ThrowStatementSyntax throwStatement &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
181ThrowStatementSyntax throwStatement => InferTypeInThrowStatement(throwStatement), 246ThrowStatementSyntax throwStatement => InferTypeInThrowStatement(throwStatement, token), 2154private IEnumerable<TypeInferenceInfo> InferTypeInThrowStatement(ThrowStatementSyntax throwStatement, SyntaxToken? previousToken = null)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (5)
Semantics\OutVarTests.cs (3)
1285var containingReturnOrThrow = containingStatement as ReturnStatementSyntax ?? (StatementSyntax)(containingStatement as ThrowStatementSyntax); 15256var statement = (ThrowStatementSyntax)SyntaxFactory.ParseStatement(@"
Semantics\PatternMatchingTests_Scope.cs (2)
977var statement = (ThrowStatementSyntax)SyntaxFactory.ParseStatement(@"
Microsoft.CodeAnalysis.CSharp.Features (12)
CodeRefactorings\InlineMethod\CSharpInlineMethodRefactoringProvider.cs (1)
45ThrowStatementSyntax throwStatementSyntax => throwStatementSyntax.Expression,
Debugging\CSharpProximityExpressionsService.RelevantExpressionsCollector.cs (1)
29public override void VisitThrowStatement(ThrowStatementSyntax node)
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (2)
160ThrowStatementSyntax throwStatement => throwStatement.Expression, 190block.DescendantNodes().OfType<ThrowStatementSyntax>().Any(t => t.Expression is null))
ExtractMethod\CSharpSelectionValidator.Validator.cs (1)
69ThrowStatementSyntax or
ExtractMethod\Extensions.cs (1)
152if (token.Parent is not ThrowStatementSyntax throwStatement || throwStatement.Expression != null)
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (1)
283public override SyntaxKind VisitThrowStatement(ThrowStatementSyntax node)
src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
50return methodSyntax.Body is { Statements: [ThrowStatementSyntax] };
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
283public override ExpressionSyntax VisitThrowStatement(ThrowStatementSyntax node)
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionHelpers.cs (2)
15var throwStatement = (ThrowStatementSyntax)throwOperation.Syntax;
src\Analyzers\CSharp\CodeFixes\UseThrowExpression\UseThrowExpressionCodeFixProvider.cs (1)
63if (throwStatementExpression.Parent is ThrowStatementSyntax throwStatement &&
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (9)
Generated\Syntax.Test.xml.Generated.cs (5)
10601private static ThrowStatementSyntax GenerateThrowStatement() 12437var node = GenerateThrowStatement(); 12443var newNode = node.WithAttributeLists(node.AttributeLists).WithThrowKeyword(node.ThrowKeyword).WithExpression(node.Expression).WithSemicolonToken(node.SemicolonToken); 17323var oldNode = GenerateThrowStatement(); 17339var oldNode = GenerateThrowStatement();
Parsing\StatementParsingTests.cs (4)
1192var ts = (ThrowStatementSyntax)statement; 1212var ts = (ThrowStatementSyntax)statement;
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
202else if (firstStatement is ThrowStatementSyntax throwStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
143(nodeParent is ThrowStatementSyntax throwStatement && throwStatement.Expression == node) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1771=> ((ThrowStatementSyntax)node).Expression;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
36ThrowStatementSyntax, 651protected override ExpressionSyntax GetThrowStatementExpression(ThrowStatementSyntax throwStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
181ThrowStatementSyntax throwStatement => InferTypeInThrowStatement(throwStatement), 246ThrowStatementSyntax throwStatement => InferTypeInThrowStatement(throwStatement, token), 2154private IEnumerable<TypeInferenceInfo> InferTypeInThrowStatement(ThrowStatementSyntax throwStatement, SyntaxToken? previousToken = null)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (2)
552VerifySyntax<ThrowStatementSyntax>(Generator.ThrowStatement(), "throw;"); 553VerifySyntax<ThrowStatementSyntax>(Generator.ThrowStatement(Generator.IdentifierName("x")), "throw x;");