84 references to TryStatementSyntax
Microsoft.CodeAnalysis.CSharp (17)
Binder\Binder_Statements.cs (3)
115result = BindTryStatement((TryStatementSyntax)node, diagnostics); 3200private BoundTryStatement BindTryStatement(TryStatementSyntax node, BindingDiagnosticBag diagnostics) 3360: (filter.Parent.Parent is TryStatementSyntax s && s.Catches.Count == 1 && s.Finally == null)
Binder\LocalBinderFactory.cs (1)
852public override void VisitTryStatement(TryStatementSyntax node)
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (3)
549var tryStatementSyntax = (TryStatementSyntax)node.Syntax.Parent; 1042public AwaitCatchFrame(SyntheticBoundNodeFactory F, TryStatementSyntax tryStatementSyntax, AwaitCatchFrame parentOpt)
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (2)
135Debug.Assert(node.Parent is TryStatementSyntax); 136if (((TryStatementSyntax)node.Parent).Finally != null)
Parser\LanguageParser.cs (1)
8934private TryStatementSyntax ParseTryStatement(SyntaxList<AttributeListSyntax> attributes)
Syntax\LookupPosition.cs (3)
355return ((TryStatementSyntax)statement).TryKeyword; 418TryStatementSyntax tryStmt = (TryStatementSyntax)statement;
Syntax\SyntaxBindingUtilities.cs (1)
24or TryStatementSyntax
Syntax\TryStatementSyntax.cs (3)
11public TryStatementSyntax Update(SyntaxToken tryKeyword, BlockSyntax block, SyntaxList<CatchClauseSyntax> catches, FinallyClauseSyntax @finally) 20public static TryStatementSyntax TryStatement(BlockSyntax block, SyntaxList<CatchClauseSyntax> catches, FinallyClauseSyntax? @finally) 23public static TryStatementSyntax TryStatement(SyntaxToken tryKeyword, BlockSyntax block, SyntaxList<CatchClauseSyntax> catches, FinallyClauseSyntax? @finally)
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
180if (block.Statements is [TryStatementSyntax tryStatement, ..])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
230if (node is TryStatementSyntax tryStatement)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (3)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (1)
614TryStatementSyntax tryStatementNode => tryStatementNode.TryKeyword.Span.End,
AutomaticCompletion\AutomaticLineEnderCommandHandler_Helpers.cs (2)
473TryStatementSyntax tryStatementNode => ShouldAddBraceForTryStatement(tryStatementNode, caretPosition), 640private static bool ShouldAddBraceForTryStatement(TryStatementSyntax tryStatementNode, int caretPosition)
Microsoft.CodeAnalysis.CSharp.Features (26)
Debugging\CSharpProximityExpressionsService.Worker.cs (2)
279var tryStatement = statement as TryStatementSyntax;
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (1)
188if (current is not BlockSyntax { Parent: TryStatementSyntax tryStatement } block ||
EditAndContinue\BreakpointSpans.cs (2)
744var tryStatement = (TryStatementSyntax)statement;
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (8)
1785return ((TryStatementSyntax)node).TryKeyword.Span; 2652var oldTryStatement = (TryStatementSyntax)oldNode; 2653var newTryStatement = (TryStatementSyntax)newNode; 2682TryStatementSyntax tryStatement; 2686tryStatement = (TryStatementSyntax)node; 2707tryStatement = (TryStatementSyntax)node.Parent!;
EditAndContinue\SyntaxComparer.cs (4)
1079var leftTry = (TryStatementSyntax)leftCatch.Parent!; 1080var rightTry = (TryStatementSyntax)rightCatch.Parent!;
ExtractMethod\CSharpSelectionValidator.Validator.cs (1)
70TryStatementSyntax or
Highlighting\KeywordHighlighters\TryStatementHighlighter.cs (2)
19internal class TryStatementHighlighter : AbstractKeywordHighlighter<TryStatementSyntax> 28TryStatementSyntax tryStatement, List<TextSpan> highlights, CancellationToken cancellationToken)
IntroduceUsingStatement\CSharpIntroduceUsingStatementCodeRefactoringProvider.cs (3)
29TryStatementSyntax> 36protected override bool HasCatchBlocks(TryStatementSyntax tryStatement) 39protected override (SyntaxList<StatementSyntax> tryStatements, SyntaxList<StatementSyntax> finallyStatements) GetTryFinallyStatements(TryStatementSyntax tryStatement)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
180if (block.Statements is [TryStatementSyntax tryStatement, ..])
src\Compilers\CSharp\Portable\Syntax\SyntaxBindingUtilities.cs (1)
24or TryStatementSyntax
Structure\Providers\BlockSyntaxStructureProvider.cs (1)
69else if (parent is TryStatementSyntax tryStatement)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (13)
IOperation\IOperationTests_TryCatch.cs (13)
82VerifyOperationTreeAndDiagnosticsForTest<TryStatementSyntax>(source, expectedOperationTree, expectedDiagnostics); 197VerifyOperationTreeAndDiagnosticsForTest<TryStatementSyntax>(source, expectedOperationTree, expectedDiagnostics); 247VerifyOperationTreeAndDiagnosticsForTest<TryStatementSyntax>(source, expectedOperationTree, expectedDiagnostics); 314VerifyOperationTreeAndDiagnosticsForTest<TryStatementSyntax>(source, expectedOperationTree, expectedDiagnostics); 384VerifyOperationTreeAndDiagnosticsForTest<TryStatementSyntax>(source, expectedOperationTree, expectedDiagnostics); 424VerifyOperationTreeAndDiagnosticsForTest<TryStatementSyntax>(source, expectedOperationTree, expectedDiagnostics); 462VerifyOperationTreeAndDiagnosticsForTest<TryStatementSyntax>(source, expectedOperationTree, expectedDiagnostics); 506VerifyOperationTreeAndDiagnosticsForTest<TryStatementSyntax>(source, expectedOperationTree, expectedDiagnostics); 561VerifyOperationTreeAndDiagnosticsForTest<TryStatementSyntax>(source, expectedOperationTree, expectedDiagnostics); 616VerifyOperationTreeAndDiagnosticsForTest<TryStatementSyntax>(source, expectedOperationTree, expectedDiagnostics); 661VerifyOperationTreeAndDiagnosticsForTest<TryStatementSyntax>(source, expectedOperationTree, expectedDiagnostics); 713VerifyOperationTreeAndDiagnosticsForTest<TryStatementSyntax>(source, expectedOperationTree, expectedDiagnostics); 759VerifyOperationTreeAndDiagnosticsForTest<TryStatementSyntax>(source, expectedOperationTree, expectedDiagnostics);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (17)
Generated\Syntax.Test.xml.Generated.cs (5)
10664private static TryStatementSyntax GenerateTryStatement() 12742var node = GenerateTryStatement(); 12749var newNode = node.WithAttributeLists(node.AttributeLists).WithTryKeyword(node.TryKeyword).WithBlock(node.Block).WithCatches(node.Catches).WithFinally(node.Finally); 17869var oldNode = GenerateTryStatement(); 17885var oldNode = GenerateTryStatement();
Parsing\StatementParsingTests.cs (12)
1233var ts = (TryStatementSyntax)statement; 1263var ts = (TryStatementSyntax)statement; 1292var ts = (TryStatementSyntax)statement; 1316var ts = (TryStatementSyntax)statement; 1359var ts = (TryStatementSyntax)statement; 1382var ts = (TryStatementSyntax)statement;
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
230if (node is TryStatementSyntax tryStatement)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (4)
CodeGeneration\SyntaxGeneratorTests.cs (4)
664VerifySyntax<TryStatementSyntax>( 671VerifySyntax<TryStatementSyntax>( 680VerifySyntax<TryStatementSyntax>( 687VerifySyntax<TryStatementSyntax>(
Microsoft.Interop.JavaScript.JSImportGenerator (1)
JSExportCodeGenerator.cs (1)
106var tryInvokeAndMarshal = TryStatement(SingletonList(CatchClause()