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