1 implementation of IThrowOperation
Microsoft.CodeAnalysis (1)
Generated\Operations.Generated.cs (1)
7317internal sealed partial class ThrowOperation : Operation, IThrowOperation
72 references to IThrowOperation
Microsoft.Analyzers.Extra (2)
CallAnalysis\CallAnalyzer.Registrar.cs (1)
221public void RegisterExceptionTypes(string[] exceptionTypes, Action<OperationAnalysisContext, IThrowOperation> action)
CallAnalysis\CallAnalyzer.State.cs (1)
19public readonly Dictionary<ITypeSymbol, List<Action<OperationAnalysisContext, IThrowOperation>>> ExceptionTypes = new(SymbolEqualityComparer.Default);
Microsoft.Analyzers.Local (5)
CallAnalysis\CallAnalyzer.Handlers.cs (2)
114var op = (IThrowOperation)context.Operation;
CallAnalysis\CallAnalyzer.Registrar.cs (1)
221public void RegisterExceptionTypes(string[] exceptionTypes, Action<OperationAnalysisContext, IThrowOperation> action)
CallAnalysis\CallAnalyzer.State.cs (1)
19public readonly Dictionary<ITypeSymbol, List<Action<OperationAnalysisContext, IThrowOperation>>> ExceptionTypes = new(SymbolEqualityComparer.Default);
CallAnalysis\Throws.cs (1)
28static void Handle(OperationAnalysisContext context, IThrowOperation op)
Microsoft.CodeAnalysis (7)
Generated\OperationKind.Generated.cs (1)
157/// <summary>Indicates an <see cref="IThrowOperation"/>.</summary>
Generated\Operations.Generated.cs (3)
11101public override IOperation VisitThrow(IThrowOperation operation, object? argument) 11482public virtual void VisitThrow(IThrowOperation operation) => DefaultVisit(operation); 11621public virtual TResult? VisitThrow(IThrowOperation operation, TArgument argument) => DefaultVisit(operation, argument);
Operations\ControlFlowBranchSemantics.cs (2)
43/// Represents a <see cref="ControlFlowBranch"/> generated for an <see cref="IThrowOperation"/> with an explicit thrown exception. 49/// Represents a <see cref="ControlFlowBranch"/> generated for an <see cref="IThrowOperation"/> with in implicit rethrown exception.
Operations\ControlFlowGraphBuilder.cs (1)
3912public override IOperation? VisitThrow(IThrowOperation operation, int? captureIdForResult)
Microsoft.CodeAnalysis.CodeStyle (16)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (4)
34if (!TryGetAssignmentOrThrow(trueStatement, out trueAssignment, out var trueThrow) || 35!TryGetAssignmentOrThrow(falseStatement, out falseAssignment, out var falseThrow)) 140out IThrowOperation? throwOperation) 145if (statement is IThrowOperation throwOp)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\UseConditionalExpressionForReturnHelpers.cs (5)
76var trueThrow = trueStatement as IThrowOperation; 77var falseThrow = falseStatement as IThrowOperation; 130if (statement is IThrowOperation throwOperation)
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (3)
81IThrowOperation? trueThrow, IThrowOperation? falseThrow) 88var anyThrow = trueThrow ?? falseThrow;
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (3)
74var throwOperation = (IThrowOperation)context.Operation; 270SemanticModel semanticModel, IThrowOperation throwOperation,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
452=> operation is IThrowOperation throwOperation &&
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (2)
37protected abstract TExpressionSyntax ConvertToExpression(IThrowOperation throwOperation); 160if (statement is IThrowOperation throwOperation)
Microsoft.CodeAnalysis.CSharp (2)
Operations\CSharpOperationFactory.cs (2)
1678private IThrowOperation CreateBoundThrowExpressionOperation(BoundThrowExpression boundThrowExpression) 2047private IThrowOperation CreateBoundThrowStatementOperation(BoundThrowStatement boundThrowStatement)
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (2)
151if (blockOperation is IBlockOperation { Operations: [IThrowOperation or IExpressionStatementOperation { Operation: IThrowOperation }] })
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
57protected override ExpressionSyntax ConvertToExpression(IThrowOperation throwOperation)
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (1)
60protected override ExpressionSyntax ConvertToExpression(IThrowOperation throwOperation)
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionHelpers.cs (1)
13public static ExpressionSyntax ConvertToExpression(IThrowOperation throwOperation)
Microsoft.CodeAnalysis.CSharp.Features (6)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (1)
64IThrowOperation { Exception: { } exception } => ThrowExpression((ExpressionSyntax)exception.Syntax),
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (2)
151if (blockOperation is IBlockOperation { Operations: [IThrowOperation or IExpressionStatementOperation { Operation: IThrowOperation }] })
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
57protected override ExpressionSyntax ConvertToExpression(IThrowOperation throwOperation)
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (1)
60protected override ExpressionSyntax ConvertToExpression(IThrowOperation throwOperation)
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionHelpers.cs (1)
13public static ExpressionSyntax ConvertToExpression(IThrowOperation throwOperation)
Microsoft.CodeAnalysis.Features (19)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (1)
134nextStatement is IReturnOperation { ReturnedValue: not null } or IThrowOperation { Exception: not null })
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (1)
143case IThrowOperation { Exception: { } }:
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (4)
34if (!TryGetAssignmentOrThrow(trueStatement, out trueAssignment, out var trueThrow) || 35!TryGetAssignmentOrThrow(falseStatement, out falseAssignment, out var falseThrow)) 140out IThrowOperation? throwOperation) 145if (statement is IThrowOperation throwOp)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\UseConditionalExpressionForReturnHelpers.cs (5)
76var trueThrow = trueStatement as IThrowOperation; 77var falseThrow = falseStatement as IThrowOperation; 130if (statement is IThrowOperation throwOperation)
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (3)
81IThrowOperation? trueThrow, IThrowOperation? falseThrow) 88var anyThrow = trueThrow ?? falseThrow;
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (3)
74var throwOperation = (IThrowOperation)context.Operation; 270SemanticModel semanticModel, IThrowOperation throwOperation,
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (2)
37protected abstract TExpressionSyntax ConvertToExpression(IThrowOperation throwOperation); 160if (statement is IThrowOperation throwOperation)
Microsoft.CodeAnalysis.Test.Utilities (3)
Compilation\OperationTreeVerifier.cs (2)
1423public override void VisitThrow(IThrowOperation operation) 1425LogString(nameof(IThrowOperation));
Compilation\TestOperationVisitor.cs (1)
1001public override void VisitThrow(IThrowOperation operation)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\Analyzers\VisualBasic\CodeFixes\UseConditionalExpression\VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb (1)
30Protected Overrides Function ConvertToExpression(throwOperation As IThrowOperation) As ExpressionSyntax
src\Analyzers\VisualBasic\CodeFixes\UseConditionalExpression\VisualBasicUseConditionalExpressionForReturnCodeFixProvider.vb (1)
30Protected Overrides Function ConvertToExpression(throwOperation As IThrowOperation) As ExpressionSyntax
Microsoft.CodeAnalysis.VisualBasic.Features (2)
src\Analyzers\VisualBasic\CodeFixes\UseConditionalExpression\VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb (1)
30Protected Overrides Function ConvertToExpression(throwOperation As IThrowOperation) As ExpressionSyntax
src\Analyzers\VisualBasic\CodeFixes\UseConditionalExpression\VisualBasicUseConditionalExpressionForReturnCodeFixProvider.vb (1)
30Protected Overrides Function ConvertToExpression(throwOperation As IThrowOperation) As ExpressionSyntax
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
452=> operation is IThrowOperation throwOperation &&