136 references to Block
Microsoft.CodeAnalysis.CSharp (29)
_generated\1\Syntax.xml.Internal.Generated.cs (2)
30941
return new BlockSyntax(SyntaxKind.
Block
, attributeLists.Node, openBraceToken, statements.Node, closeBraceToken, this.context);
36368
return new BlockSyntax(SyntaxKind.
Block
, attributeLists.Node, openBraceToken, statements.Node, closeBraceToken);
_generated\2\Syntax.xml.Syntax.Generated.cs (1)
6291
/// <item><description><see cref="SyntaxKind.
Block
"/></description></item>
Binder\Binder_Statements.cs (2)
51
else if (node.Kind() != SyntaxKind.
Block
)
63
case SyntaxKind.
Block
:
Binder\LocalBinderFactory.cs (2)
93
else if (syntax.Kind() != SyntaxKind.
Block
&& (statement = syntax as StatementSyntax) != null)
387
if (body.Kind() == SyntaxKind.
Block
)
BoundTree\UnboundLambda.cs (1)
1587
private bool IsExpressionLambda { get { return Body.Kind() != SyntaxKind.
Block
; } }
CodeGen\EmitStatement.cs (2)
857
return _ilEmitStyle == ILEmitStyle.Debug && _method.GenerateDebugInfo && _methodBodySyntaxOpt?.IsKind(SyntaxKind.
Block
) == true ||
868
(boundReturnStatement.Syntax.IsKind(SyntaxKind.
Block
) || _method?.IsImplicitConstructor == true) &&
Compilation\SyntaxTreeSemanticModel.cs (1)
1114
case SyntaxKind.
Block
:
Compiler\MethodBodySynthesizer.cs (2)
535
Debug.Assert(syntax.Kind() == SyntaxKind.
Block
|| syntax.Kind() == SyntaxKind.ArrowExpressionClause);
556
if (syntax.Kind() == SyntaxKind.
Block
)
FlowAnalysis\FlowAnalysisPass.cs (1)
198
syntax.IsKind(SyntaxKind.
Block
) ||
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
646
else if (lambdaSyntax.Body.Kind() == SyntaxKind.
Block
)
664
else if (lambdaSyntax.Body.Kind() == SyntaxKind.
Block
)
Lowering\Instrumentation\DebugInfoInjector.cs (2)
172
if (original.WasCompilerGenerated && original.Syntax.Kind() == SyntaxKind.
Block
)
406
if (original.WasCompilerGenerated && original.ExpressionOpt == null && original.Syntax.Kind() == SyntaxKind.
Block
)
Lowering\Instrumentation\Instrumenter.cs (1)
50
Debug.Assert(!original.WasCompilerGenerated || original.Syntax.Kind() == SyntaxKind.
Block
);
Lowering\LocalRewriter\LocalRewriter_ReturnStatement.cs (1)
32
(node.Syntax.Kind() == SyntaxKind.
Block
&& (currentFunction?.IsAsync == false || isRuntimeAsync)))))
Lowering\LocalRewriter\LocalRewriter_Yield.cs (1)
25
(!node.WasCompilerGenerated || (node.Syntax.Kind() == SyntaxKind.
Block
&& (currentFunction?.IsAsync == false || isRuntimeAsync))))
Parser\LanguageParser.cs (2)
9106
this.CurrentNodeKind == SyntaxKind.
Block
&&
9147
if (this.IsIncrementalAndFactoryContextMatches && this.CurrentNodeKind == SyntaxKind.
Block
&& attributes.Count == 0)
Syntax\CSharpSyntaxNode.cs (1)
520
if (this.Kind() == SyntaxKind.
Block
)
Syntax\LambdaUtilities.cs (1)
393
case SyntaxKind.
Block
:
Syntax\LookupPosition.cs (2)
315
case SyntaxKind.
Block
:
377
case SyntaxKind.
Block
:
Syntax\SyntaxEquivalence.cs (1)
157
case SyntaxKind.
Block
:
Syntax\SyntaxExtensions.cs (1)
254
case SyntaxKind.
Block
:
Microsoft.CodeAnalysis.CSharp.CodeStyle (21)
src\roslyn\src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (3)
62
case SyntaxKind.
Block
:
292
if (statement.Statement.IsKind(SyntaxKind.
Block
))
296
if (elseStatement.IsKind(SyntaxKind.
Block
))
src\roslyn\src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
318
return current.IsParentKind(SyntaxKind.
Block
)
src\roslyn\src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
111
if (parent.IsKind(SyntaxKind.
Block
))
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
79
!blockOperation.Syntax.IsKind(SyntaxKind.
Block
);
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
43
Debug.Assert(enclosingBlock.Kind() is SyntaxKind.
Block
or SyntaxKind.SwitchSection);
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
95
var ifStatementScope = ifStatement.Parent.IsKind(SyntaxKind.
Block
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (2)
130
if (node.Kind() != SyntaxKind.
Block
)
140
if (node.Kind() != SyntaxKind.
Block
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
95
var firstStatementIsBlock = section.Statements is [(kind: SyntaxKind.
Block
), ..];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
257
if (node is not StatementSyntax statementNode || statementNode.Kind() == SyntaxKind.
Block
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (3)
70
if (embeddedStatement.IsKind(SyntaxKind.
Block
))
99
if (node is not StatementSyntax statementNode || statementNode.Kind() == SyntaxKind.
Block
)
112
if (!(node is not StatementSyntax statementNode || statementNode.Kind() == SyntaxKind.
Block
))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Indentation\CSharpSmartTokenFormatter.cs (1)
72
endToken.Parent.IsKind(SyntaxKind.
Block
) &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpBlockFacts.cs (2)
22
=> node.IsKind(SyntaxKind.
Block
);
25
=> node is (kind: SyntaxKind.
Block
or SyntaxKind.SwitchSection or SyntaxKind.CompilationUnit);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (2)
328
(previousToken.Parent.IsKind(SyntaxKind.
Block
) ||
419
if (token.Parent.Kind() is SyntaxKind.
Block
or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
96
=> node is StatementSyntax(kind: not SyntaxKind.
Block
) or TypeSyntax or CrefSyntax ||
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (1)
81
is not SyntaxKind.
Block
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (3)
115
case SyntaxKind.OpenBraceToken when token.Parent.IsKind(SyntaxKind.
Block
):
124
if (token.Parent.IsKind(SyntaxKind.
Block
))
589
targetToken.Parent.IsKind(SyntaxKind.
Block
) &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (2)
208
token.Parent.IsKind(SyntaxKind.
Block
) &&
492
token.Parent.IsKind(SyntaxKind.
Block
) &&
Microsoft.CodeAnalysis.CSharp.Features (41)
ChangeSignature\CSharpChangeSignatureService.cs (1)
200
current.Kind() == SyntaxKind.
Block
|| current.Kind() == SyntaxKind.ArrowExpressionClause)
Completion\KeywordRecommenders\WhileKeywordRecommender.cs (1)
36
token.Parent.IsKind(SyntaxKind.
Block
) &&
ConvertForEachToFor\CSharpConvertForEachToForCodeRefactoringProvider.cs (1)
50
return foreachInfo.ForEachStatement.Parent.IsKind(SyntaxKind.
Block
);
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (1)
55
case SyntaxKind.
Block
:
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
95
if (!documentUpdateInfo.Source.IsParentKind(SyntaxKind.
Block
) &&
Debugging\CSharpProximityExpressionsService.Worker.cs (2)
220
var statementAncestor = _parentStatement.Ancestors().OfType<StatementSyntax>().FirstOrDefault(node => !node.IsKind(SyntaxKind.
Block
));
237
case SyntaxKind.
Block
:
EditAndContinue\BreakpointSpans.cs (1)
587
case SyntaxKind.
Block
:
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (8)
215
case SyntaxKind.
Block
:
505
if (oldStatement == oldBody && !newBody.IsKind(SyntaxKind.
Block
))
589
case SyntaxKind.
Block
:
664
=> (memberBody, memberBody.IsKind(SyntaxKind.
Block
) ? (int)BlockPart.OpenBrace : DefaultStatementPart);
686
case SyntaxKind.
Block
:
742
case SyntaxKind.
Block
:
766
case SyntaxKind.
Block
:
1758
case SyntaxKind.
Block
:
EditAndContinue\SyntaxComparer.cs (6)
553
case SyntaxKind.
Block
:
738
ignoreChildFunction = childKind => childKind == SyntaxKind.
Block
|| childKind == SyntaxKind.ArrowExpressionClause || HasLabel(childKind);
885
case SyntaxKind.
Block
:
1102
case SyntaxKind.
Block
:
1232
if (leftStatement.Kind() == SyntaxKind.
Block
&& rightStatement.Kind() == SyntaxKind.
Block
)
IntroduceVariable\CSharpIntroduceVariableService.cs (1)
66
if (node.IsKind(SyntaxKind.
Block
))
InvertIf\CSharpInvertIfCodeRefactoringProvider.cs (3)
42
=> ifNode?.Parent is (kind: SyntaxKind.
Block
or SyntaxKind.SwitchSection);
54
=> node.Kind() is SyntaxKind.
Block
or SyntaxKind.SwitchSection;
57
=> node.Kind() is SyntaxKind.
Block
or SyntaxKind.EmptyStatement;
QuickInfo\CSharpSyntacticQuickInfoProvider.cs (2)
89
=> node.IsKind(SyntaxKind.
Block
)
90
&& node.Parent?.Kind() is SyntaxKind.
Block
or SyntaxKind.SwitchSection or SyntaxKind.GlobalStatement;
src\roslyn\src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (3)
62
case SyntaxKind.
Block
:
292
if (statement.Statement.IsKind(SyntaxKind.
Block
))
296
if (elseStatement.IsKind(SyntaxKind.
Block
))
src\roslyn\src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
318
return current.IsParentKind(SyntaxKind.
Block
)
src\roslyn\src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
111
if (parent.IsKind(SyntaxKind.
Block
))
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
79
!blockOperation.Syntax.IsKind(SyntaxKind.
Block
);
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
43
Debug.Assert(enclosingBlock.Kind() is SyntaxKind.
Block
or SyntaxKind.SwitchSection);
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
95
var ifStatementScope = ifStatement.Parent.IsKind(SyntaxKind.
Block
)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (1)
81
is not SyntaxKind.
Block
src\roslyn\src\Compilers\CSharp\Portable\Syntax\LambdaUtilities.cs (1)
393
case SyntaxKind.
Block
:
Structure\Providers\BlockSyntaxStructureProvider.cs (3)
134
if (parentKind is SyntaxKind.
Block
or SyntaxKind.SwitchSection)
152
=> node is StatementSyntax(kind: not SyntaxKind.
Block
);
221
SyntaxKind.
Block
=> BlockTypes.Statement,
Microsoft.CodeAnalysis.CSharp.Workspaces (18)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (2)
130
if (node.Kind() != SyntaxKind.
Block
)
140
if (node.Kind() != SyntaxKind.
Block
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
95
var firstStatementIsBlock = section.Statements is [(kind: SyntaxKind.
Block
), ..];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
257
if (node is not StatementSyntax statementNode || statementNode.Kind() == SyntaxKind.
Block
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (3)
70
if (embeddedStatement.IsKind(SyntaxKind.
Block
))
99
if (node is not StatementSyntax statementNode || statementNode.Kind() == SyntaxKind.
Block
)
112
if (!(node is not StatementSyntax statementNode || statementNode.Kind() == SyntaxKind.
Block
))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Indentation\CSharpSmartTokenFormatter.cs (1)
72
endToken.Parent.IsKind(SyntaxKind.
Block
) &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpBlockFacts.cs (2)
22
=> node.IsKind(SyntaxKind.
Block
);
25
=> node is (kind: SyntaxKind.
Block
or SyntaxKind.SwitchSection or SyntaxKind.CompilationUnit);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (2)
328
(previousToken.Parent.IsKind(SyntaxKind.
Block
) ||
419
if (token.Parent.Kind() is SyntaxKind.
Block
or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
96
=> node is StatementSyntax(kind: not SyntaxKind.
Block
) or TypeSyntax or CrefSyntax ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (3)
115
case SyntaxKind.OpenBraceToken when token.Parent.IsKind(SyntaxKind.
Block
):
124
if (token.Parent.IsKind(SyntaxKind.
Block
))
589
targetToken.Parent.IsKind(SyntaxKind.
Block
) &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (2)
208
token.Parent.IsKind(SyntaxKind.
Block
) &&
492
token.Parent.IsKind(SyntaxKind.
Block
) &&
Microsoft.Interop.SourceGeneration (3)
SyntaxExtensions.cs (3)
24
if (fixedStatement.Statement.IsKind(SyntaxKind.
Block
))
37
if (childStatement.IsKind(SyntaxKind.
Block
))
66
if (statement.IsKind(SyntaxKind.
Block
))
Roslyn.Diagnostics.CSharp.Analyzers (18)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (2)
130
if (node.Kind() != SyntaxKind.
Block
)
140
if (node.Kind() != SyntaxKind.
Block
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
95
var firstStatementIsBlock = section.Statements is [(kind: SyntaxKind.
Block
), ..];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
257
if (node is not StatementSyntax statementNode || statementNode.Kind() == SyntaxKind.
Block
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (3)
70
if (embeddedStatement.IsKind(SyntaxKind.
Block
))
99
if (node is not StatementSyntax statementNode || statementNode.Kind() == SyntaxKind.
Block
)
112
if (!(node is not StatementSyntax statementNode || statementNode.Kind() == SyntaxKind.
Block
))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Indentation\CSharpSmartTokenFormatter.cs (1)
72
endToken.Parent.IsKind(SyntaxKind.
Block
) &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpBlockFacts.cs (2)
22
=> node.IsKind(SyntaxKind.
Block
);
25
=> node is (kind: SyntaxKind.
Block
or SyntaxKind.SwitchSection or SyntaxKind.CompilationUnit);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (2)
328
(previousToken.Parent.IsKind(SyntaxKind.
Block
) ||
419
if (token.Parent.Kind() is SyntaxKind.
Block
or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
96
=> node is StatementSyntax(kind: not SyntaxKind.
Block
) or TypeSyntax or CrefSyntax ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (3)
115
case SyntaxKind.OpenBraceToken when token.Parent.IsKind(SyntaxKind.
Block
):
124
if (token.Parent.IsKind(SyntaxKind.
Block
))
589
targetToken.Parent.IsKind(SyntaxKind.
Block
) &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (2)
208
token.Parent.IsKind(SyntaxKind.
Block
) &&
492
token.Parent.IsKind(SyntaxKind.
Block
) &&