30 references to CatchKeyword
Microsoft.CodeAnalysis.CSharp (8)
Binder\Binder_Statements.cs (2)
3262diagnostics.Add(ErrorCode.ERR_TooManyCatches, catchSyntax.CatchKeyword.GetLocation()); 3357Error(diagnostics, ErrorCode.WRN_UnreachableGeneralCatch, node.CatchKeyword);
CodeGen\EmitStatement.cs (1)
1072spSpan = syntax.CatchKeyword.Span;
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) 9084public CatchClauseSyntax WithDeclaration(CatchDeclarationSyntax? declaration) => Update(this.CatchKeyword, 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.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (2)
242if (!catchClause.CatchKeyword.IsMissing && catchClause.Block != null && !catchClause.Block.CloseBraceToken.IsMissing) 244AddSuppressWrappingIfOnSingleLineOperation(list, catchClause.CatchKeyword, catchClause.Block.CloseBraceToken);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
AutomaticCompletion\AutomaticLineEnderCommandHandler_Helpers.cs (1)
646=> !catchClauseSyntax.CatchKeyword.IsMissing
Microsoft.CodeAnalysis.CSharp.Features (4)
EditAndContinue\BreakpointSpans.cs (2)
924return CreateSpan(catchClause.CatchKeyword, catchClause.Declaration.CloseParenToken); 928return CreateSpan(catchClause.CatchKeyword);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
1783return ((CatchClauseSyntax)node).CatchKeyword.Span;
Highlighting\KeywordHighlighters\TryStatementHighlighter.cs (1)
34highlights.Add(catchDeclaration.CatchKeyword.Span);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (11)
Generated\Syntax.Test.xml.Generated.cs (2)
12901Assert.Equal(SyntaxKind.CatchKeyword, node.CatchKeyword.Kind()); 12905var newNode = node.WithCatchKeyword(node.CatchKeyword).WithDeclaration(node.Declaration).WithFilter(node.Filter).WithBlock(node.Block);
Parsing\StatementParsingTests.cs (9)
1239Assert.NotEqual(default, ts.Catches[0].CatchKeyword); 1269Assert.NotEqual(default, ts.Catches[0].CatchKeyword); 1298Assert.NotEqual(default, ts.Catches[0].CatchKeyword); 1323Assert.NotEqual(default, ts.Catches[0].CatchKeyword); 1333Assert.NotEqual(default, ts.Catches[1].CatchKeyword); 1341Assert.NotEqual(default, ts.Catches[2].CatchKeyword); 1389Assert.NotEqual(default, ts.Catches[0].CatchKeyword); 1399Assert.NotEqual(default, ts.Catches[1].CatchKeyword); 1407Assert.NotEqual(default, ts.Catches[2].CatchKeyword);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (2)
242if (!catchClause.CatchKeyword.IsMissing && catchClause.Block != null && !catchClause.Block.CloseBraceToken.IsMissing) 244AddSuppressWrappingIfOnSingleLineOperation(list, catchClause.CatchKeyword, catchClause.Block.CloseBraceToken);
Roslyn.Diagnostics.CSharp.Analyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (2)
242if (!catchClause.CatchKeyword.IsMissing && catchClause.Block != null && !catchClause.Block.CloseBraceToken.IsMissing) 244AddSuppressWrappingIfOnSingleLineOperation(list, catchClause.CatchKeyword, catchClause.Block.CloseBraceToken);