1 instantiation of CatchDeclarationSyntax
Microsoft.CodeAnalysis.CSharp (1)
Syntax.xml.Internal.Generated.cs (1)
14709internal override SyntaxNode CreateRed(SyntaxNode? parent, int position) => new CSharp.Syntax.CatchDeclarationSyntax(this, parent, position);
70 references to CatchDeclarationSyntax
Microsoft.CodeAnalysis.CSharp (28)
Binder\Binder_Statements.cs (1)
3279var declaration = node.Declaration;
Binder\CatchClauseBinder.cs (1)
31var declarationOpt = _syntax.Declaration;
CodeGen\EmitStatement.cs (1)
1068var declaration = syntax.Declaration;
Compilation\CSharpSemanticModel.cs (2)
3311public ILocalSymbol GetDeclaredSymbol(CatchDeclarationSyntax catchDeclaration) 5138return this.GetDeclaredSymbol((CatchDeclarationSyntax)node);
CSharpExtensions.cs (1)
1592public static ILocalSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, CatchDeclarationSyntax catchDeclaration, CancellationToken cancellationToken = default(CancellationToken))
Symbols\Source\SourceLocalSymbol.cs (1)
447Debug.Assert(node is CatchDeclarationSyntax);
Syntax.xml.Main.Generated.cs (10)
460public virtual TResult? VisitCatchDeclaration(CatchDeclarationSyntax node) => this.DefaultVisit(node); 1204public virtual void VisitCatchDeclaration(CatchDeclarationSyntax node) => this.DefaultVisit(node); 1945=> node.Update(VisitToken(node.CatchKeyword), (CatchDeclarationSyntax?)Visit(node.Declaration), (CatchFilterClauseSyntax?)Visit(node.Filter), (BlockSyntax?)Visit(node.Block) ?? throw new ArgumentNullException("block")); 1947public override SyntaxNode? VisitCatchDeclaration(CatchDeclarationSyntax node) 4684public static CatchClauseSyntax CatchClause(SyntaxToken catchKeyword, CatchDeclarationSyntax? declaration, CatchFilterClauseSyntax? filter, BlockSyntax block) 4692public static CatchClauseSyntax CatchClause(CatchDeclarationSyntax? declaration, CatchFilterClauseSyntax? filter, BlockSyntax block) 4700public static CatchDeclarationSyntax CatchDeclaration(SyntaxToken openParenToken, TypeSyntax type, SyntaxToken identifier, SyntaxToken closeParenToken) 4711return (CatchDeclarationSyntax)Syntax.InternalSyntax.SyntaxFactory.CatchDeclaration((Syntax.InternalSyntax.SyntaxToken)openParenToken.Node!, (Syntax.InternalSyntax.TypeSyntax)type.Green, (Syntax.InternalSyntax.SyntaxToken?)identifier.Node, (Syntax.InternalSyntax.SyntaxToken)closeParenToken.Node!).CreateRed(); 4715public static CatchDeclarationSyntax CatchDeclaration(TypeSyntax type, SyntaxToken identifier) 4719public static CatchDeclarationSyntax CatchDeclaration(TypeSyntax type)
Syntax.xml.Syntax.Generated.cs (10)
9033private CatchDeclarationSyntax? declaration; 9044public CatchDeclarationSyntax? Declaration => GetRed(ref this.declaration, 1); 9071public CatchClauseSyntax Update(SyntaxToken catchKeyword, CatchDeclarationSyntax? declaration, CatchFilterClauseSyntax? filter, BlockSyntax block) 9084public CatchClauseSyntax WithDeclaration(CatchDeclarationSyntax? declaration) => Update(this.CatchKeyword, declaration, this.Filter, this.Block); 9129public CatchDeclarationSyntax Update(SyntaxToken openParenToken, TypeSyntax type, SyntaxToken identifier, SyntaxToken closeParenToken) 9133var newNode = SyntaxFactory.CatchDeclaration(openParenToken, type, identifier, closeParenToken); 9141public CatchDeclarationSyntax WithOpenParenToken(SyntaxToken openParenToken) => Update(openParenToken, this.Type, this.Identifier, this.CloseParenToken); 9142public CatchDeclarationSyntax WithType(TypeSyntax type) => Update(this.OpenParenToken, type, this.Identifier, this.CloseParenToken); 9143public CatchDeclarationSyntax WithIdentifier(SyntaxToken identifier) => Update(this.OpenParenToken, this.Type, identifier, this.CloseParenToken); 9144public CatchDeclarationSyntax WithCloseParenToken(SyntaxToken closeParenToken) => Update(this.OpenParenToken, this.Type, this.Identifier, closeParenToken);
Syntax\SyntaxFacts.cs (1)
135return ((CatchDeclarationSyntax)parent).Type == node;
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.DeclarationFinder.cs (1)
51public override void VisitCatchDeclaration(CatchDeclarationSyntax node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
719CatchDeclarationSyntax n => (n.OpenParenToken, n.CloseParenToken),
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (9)
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (2)
77var catchDeclaration = (CatchDeclarationSyntax)node;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
896var catchDeclarationSyntax = (CatchDeclarationSyntax)syntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (2)
61case CatchDeclarationSyntax catchDeclaration: 120private static bool IsDiscardDeclaration(CatchDeclarationSyntax catchDeclaration)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
150CatchDeclarationSyntax catchDeclaration => InferTypeInCatchDeclaration(catchDeclaration), 218CatchDeclarationSyntax catchDeclaration => InferTypeInCatchDeclaration(catchDeclaration, token), 1091private IEnumerable<TypeInferenceInfo> InferTypeInCatchDeclaration(CatchDeclarationSyntax catchDeclaration, SyntaxToken? previousToken = null)
Microsoft.CodeAnalysis.CSharp.Features (3)
RemoveUnusedVariable\CSharpRemoveUnusedVariableCodeFixProvider.cs (1)
36=> token.Parent is CatchDeclarationSyntax catchDeclaration && catchDeclaration.Identifier == token;
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (2)
77var catchDeclaration = (CatchDeclarationSyntax)node;
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_TryCatch.cs (1)
873VerifyOperationTreeAndDiagnosticsForTest<CatchDeclarationSyntax>(source, expectedOperationTree, expectedDiagnostics);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (6)
Generated\Syntax.Test.xml.Generated.cs (6)
10802=> SyntaxFactory.CatchClause(SyntaxFactory.Token(SyntaxKind.CatchKeyword), default(CatchDeclarationSyntax), default(CatchFilterClauseSyntax), GenerateBlock()); 10804private static CatchDeclarationSyntax GenerateCatchDeclaration() 12912var node = GenerateCatchDeclaration(); 12918var newNode = node.WithOpenParenToken(node.OpenParenToken).WithType(node.Type).WithIdentifier(node.Identifier).WithCloseParenToken(node.CloseParenToken); 18111var oldNode = GenerateCatchDeclaration(); 18127var oldNode = GenerateCatchDeclaration();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
Extensions.cs (1)
648declaration is CatchDeclarationSyntax ||
LocalVariableDeclaratorsCollector.cs (1)
100public override void VisitCatchDeclaration(CatchDeclarationSyntax node)
Microsoft.CodeAnalysis.CSharp.Workspaces (10)
Classification\ClassificationHelpers.cs (1)
236else if (token.Parent is CatchDeclarationSyntax catchDeclaration && catchDeclaration.Identifier == token)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.DeclarationFinder.cs (1)
51public override void VisitCatchDeclaration(CatchDeclarationSyntax node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
719CatchDeclarationSyntax n => (n.OpenParenToken, n.CloseParenToken),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
896var catchDeclarationSyntax = (CatchDeclarationSyntax)syntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (2)
61case CatchDeclarationSyntax catchDeclaration: 120private static bool IsDiscardDeclaration(CatchDeclarationSyntax catchDeclaration)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
150CatchDeclarationSyntax catchDeclaration => InferTypeInCatchDeclaration(catchDeclaration), 218CatchDeclarationSyntax catchDeclaration => InferTypeInCatchDeclaration(catchDeclaration, token), 1091private IEnumerable<TypeInferenceInfo> InferTypeInCatchDeclaration(CatchDeclarationSyntax catchDeclaration, SyntaxToken? previousToken = null)
Roslyn.Diagnostics.CSharp.Analyzers (9)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.DeclarationFinder.cs (1)
51public override void VisitCatchDeclaration(CatchDeclarationSyntax node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
719CatchDeclarationSyntax n => (n.OpenParenToken, n.CloseParenToken),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
896var catchDeclarationSyntax = (CatchDeclarationSyntax)syntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (2)
61case CatchDeclarationSyntax catchDeclaration: 120private static bool IsDiscardDeclaration(CatchDeclarationSyntax catchDeclaration)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
150CatchDeclarationSyntax catchDeclaration => InferTypeInCatchDeclaration(catchDeclaration), 218CatchDeclarationSyntax catchDeclaration => InferTypeInCatchDeclaration(catchDeclaration, token), 1091private IEnumerable<TypeInferenceInfo> InferTypeInCatchDeclaration(CatchDeclarationSyntax catchDeclaration, SyntaxToken? previousToken = null)