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