45 references to ElseClause
Microsoft.CodeAnalysis.CSharp (1)
Syntax\SyntaxNormalizer.cs (1)
1333if (node.IsKind(SyntaxKind.IfStatement) && node.Parent.IsKind(SyntaxKind.ElseClause))
Microsoft.CodeAnalysis.CSharp.CodeStyle (9)
src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (5)
35SyntaxKind.ElseClause, 67case SyntaxKind.IfStatement when statement.Kind() == SyntaxKind.ElseClause: 239if (statement.Kind() is not (SyntaxKind.IfStatement or SyntaxKind.ElseClause)) 268if (ifStatementOrElseClause.IsKind(SyntaxKind.ElseClause)) 278while (result.IsParentKind(SyntaxKind.ElseClause))
src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
91var parentIsElseClause = parent.IsKind(SyntaxKind.ElseClause);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\NewLineUserSettingFormattingRule.cs (1)
54case SyntaxKind.ElseClause:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
168public int ElseClause => (int)SyntaxKind.ElseClause;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (1)
358SyntaxKind.ElseClause or
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (1)
102if (ifStatement.Parent.IsKind(SyntaxKind.ElseClause) &&
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (1)
91newIf = originalIf.IsParentKind(SyntaxKind.ElseClause)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (2)
139is SyntaxKind.ElseClause 174return token.Parent.IsKind(SyntaxKind.ElseClause);
Microsoft.CodeAnalysis.CSharp.Features (17)
BraceCompletion\CurlyBraceCompletionService.cs (1)
211case SyntaxKind.ElseClause:
EditAndContinue\BreakpointSpans.cs (1)
273case SyntaxKind.ElseClause:
EditAndContinue\SyntaxComparer.cs (2)
412case SyntaxKind.ElseClause: 1102case SyntaxKind.ElseClause:
Highlighting\KeywordHighlighters\IfStatementHighlighter.cs (1)
33if (ifStatement.Parent.Kind() != SyntaxKind.ElseClause)
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
367statement.IsParentKind(SyntaxKind.ElseClause))
src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (5)
35SyntaxKind.ElseClause, 67case SyntaxKind.IfStatement when statement.Kind() == SyntaxKind.ElseClause: 239if (statement.Kind() is not (SyntaxKind.IfStatement or SyntaxKind.ElseClause)) 268if (ifStatementOrElseClause.IsKind(SyntaxKind.ElseClause)) 278while (result.IsParentKind(SyntaxKind.ElseClause))
src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
91var parentIsElseClause = parent.IsKind(SyntaxKind.ElseClause);
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (1)
102if (ifStatement.Parent.IsKind(SyntaxKind.ElseClause) &&
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (1)
91newIf = originalIf.IsParentKind(SyntaxKind.ElseClause)
Structure\Providers\BlockSyntaxStructureProvider.cs (3)
90else if (parentKind == SyntaxKind.ElseClause || IsNonBlockStatement(parent)) 153if (parent.IsKind(SyntaxKind.IfStatement) && parent.IsParentKind(SyntaxKind.ElseClause)) 215SyntaxKind.ElseClause => BlockTypes.Conditional,
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (6)
Parsing\StatementParsingTests.cs (6)
3631N(SyntaxKind.ElseClause); 3706N(SyntaxKind.ElseClause); 3733N(SyntaxKind.ElseClause); 3789N(SyntaxKind.ElseClause); 3816N(SyntaxKind.ElseClause); 3881N(SyntaxKind.ElseClause);
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
Classification\ClassificationHelpers.cs (1)
123case SyntaxKind.ElseClause:
Simplification\Reducers\CSharpMiscellaneousReducer.cs (2)
148if (node.Parent?.Parent is (kind: SyntaxKind.IfStatement or SyntaxKind.ElseClause)) 183case SyntaxKind.ElseClause:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\NewLineUserSettingFormattingRule.cs (1)
54case SyntaxKind.ElseClause:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
168public int ElseClause => (int)SyntaxKind.ElseClause;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (1)
358SyntaxKind.ElseClause or
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (2)
139is SyntaxKind.ElseClause 174return token.Parent.IsKind(SyntaxKind.ElseClause);