68 references to Declaration
Microsoft.CodeAnalysis.CSharp (10)
Binder\Binder_Statements.cs (2)
3269hasCatchAll |= catchSyntax.Declaration == null && catchSyntax.Filter == null; 3279var declaration = node.Declaration;
Binder\CatchClauseBinder.cs (1)
31var declarationOpt = _syntax.Declaration;
CodeGen\EmitStatement.cs (2)
1068var declaration = syntax.Declaration; 1076spSpan = TextSpan.FromBounds(syntax.SpanStart, syntax.Declaration.Span.End);
Syntax.xml.Main.Generated.cs (1)
1945=> node.Update(VisitToken(node.CatchKeyword), (CatchDeclarationSyntax?)Visit(node.Declaration), (CatchFilterClauseSyntax?)Visit(node.Filter), (BlockSyntax?)Visit(node.Block) ?? throw new ArgumentNullException("block"));
Syntax.xml.Syntax.Generated.cs (4)
9073if (catchKeyword != this.CatchKeyword || declaration != this.Declaration || filter != this.Filter || block != this.Block) 9083public CatchClauseSyntax WithCatchKeyword(SyntaxToken catchKeyword) => Update(catchKeyword, this.Declaration, this.Filter, this.Block); 9085public CatchClauseSyntax WithFilter(CatchFilterClauseSyntax? filter) => Update(this.CatchKeyword, this.Declaration, filter, this.Block); 9086public CatchClauseSyntax WithBlock(BlockSyntax block) => Update(this.CatchKeyword, this.Declaration, this.Filter, block);
Microsoft.CodeAnalysis.CSharp.Features (13)
Debugging\CSharpProximityExpressionsService.Worker.cs (3)
82catchClause.Declaration != null && catchClause.Declaration.Identifier.Kind() != SyntaxKind.None) 84_expressions.Add(catchClause.Declaration.Identifier.ValueText);
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (4)
193if (catchClause.Declaration == null) 197if (SyntaxFactory.AreEquivalent(exceptionType, catchClause.Declaration.Type.ConvertToSingleLine())) 201catchClause.Declaration.Type is IdentifierNameSyntax { Identifier.ValueText: nameof(Exception) }) 206if (catchClause.Declaration.Type is QualifiedNameSyntax
EditAndContinue\BreakpointSpans.cs (2)
922else if (catchClause.Declaration != null) 924return CreateSpan(catchClause.CatchKeyword, catchClause.Declaration.CloseParenToken);
EditAndContinue\SyntaxComparer.cs (4)
1085if (leftCatch.Declaration == null && leftCatch.Filter == null && 1086rightCatch.Declaration == null && rightCatch.Filter == null) 1154var distance = CombineOptional(blockDistance, left.Declaration, right.Declaration, left.Filter, right.Filter);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\TryCatchTests.cs (1)
46var localSymbol = (ILocalSymbol)model.GetDeclaredSymbol(catchClause.Declaration);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (42)
Generated\Syntax.Test.xml.Generated.cs (2)
12902Assert.Null(node.Declaration); 12905var newNode = node.WithCatchKeyword(node.CatchKeyword).WithDeclaration(node.Declaration).WithFilter(node.Filter).WithBlock(node.Block);
Parsing\StatementParsingTests.cs (40)
1240Assert.NotNull(ts.Catches[0].Declaration); 1241Assert.NotEqual(default, ts.Catches[0].Declaration.OpenParenToken); 1242Assert.NotNull(ts.Catches[0].Declaration.Type); 1243Assert.Equal("T", ts.Catches[0].Declaration.Type.ToString()); 1244Assert.NotEqual(default, ts.Catches[0].Declaration.Identifier); 1245Assert.Equal("e", ts.Catches[0].Declaration.Identifier.ToString()); 1246Assert.NotEqual(default, ts.Catches[0].Declaration.CloseParenToken); 1270Assert.NotNull(ts.Catches[0].Declaration); 1271Assert.NotEqual(default, ts.Catches[0].Declaration.OpenParenToken); 1272Assert.NotNull(ts.Catches[0].Declaration.Type); 1273Assert.Equal("T", ts.Catches[0].Declaration.Type.ToString()); 1274Assert.Equal(SyntaxKind.None, ts.Catches[0].Declaration.Identifier.Kind()); 1275Assert.NotEqual(default, ts.Catches[0].Declaration.CloseParenToken); 1299Assert.Null(ts.Catches[0].Declaration); 1324Assert.NotNull(ts.Catches[0].Declaration); 1325Assert.NotEqual(default, ts.Catches[0].Declaration.OpenParenToken); 1326Assert.NotNull(ts.Catches[0].Declaration.Type); 1327Assert.Equal("T", ts.Catches[0].Declaration.Type.ToString()); 1328Assert.NotEqual(default, ts.Catches[0].Declaration.Identifier); 1329Assert.Equal("e", ts.Catches[0].Declaration.Identifier.ToString()); 1330Assert.NotEqual(default, ts.Catches[0].Declaration.CloseParenToken); 1334Assert.NotNull(ts.Catches[1].Declaration); 1335Assert.NotEqual(default, ts.Catches[1].Declaration.OpenParenToken); 1336Assert.NotNull(ts.Catches[1].Declaration.Type); 1337Assert.Equal("T2", ts.Catches[1].Declaration.Type.ToString()); 1338Assert.NotEqual(default, ts.Catches[1].Declaration.CloseParenToken); 1342Assert.Null(ts.Catches[2].Declaration); 1390Assert.NotNull(ts.Catches[0].Declaration); 1391Assert.NotEqual(default, ts.Catches[0].Declaration.OpenParenToken); 1392Assert.NotNull(ts.Catches[0].Declaration.Type); 1393Assert.Equal("T", ts.Catches[0].Declaration.Type.ToString()); 1394Assert.NotEqual(default, ts.Catches[0].Declaration.Identifier); 1395Assert.Equal("e", ts.Catches[0].Declaration.Identifier.ToString()); 1396Assert.NotEqual(default, ts.Catches[0].Declaration.CloseParenToken); 1400Assert.NotNull(ts.Catches[1].Declaration); 1401Assert.NotEqual(default, ts.Catches[1].Declaration.OpenParenToken); 1402Assert.NotNull(ts.Catches[1].Declaration.Type); 1403Assert.Equal("T2", ts.Catches[1].Declaration.Type.ToString()); 1404Assert.NotEqual(default, ts.Catches[1].Declaration.CloseParenToken); 1408Assert.Null(ts.Catches[2].Declaration);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
Rename\LocalConflictVisitor.cs (2)
102if (node.Declaration != null) 104tokens.Add(node.Declaration.Identifier);