55 references to OrPattern
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Patterns.cs (1)
1783bool isDisjunction = node.Kind() == SyntaxKind.OrPattern;
Parser\LanguageParser_Patterns.cs (1)
64SyntaxKind.OrPattern,
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\Analyzers\CSharp\Analyzers\AddRequiredParentheses\CSharpAddRequiredPatternParenthesesDiagnosticAnalyzer.cs (1)
25private static readonly ImmutableArray<SyntaxKind> s_kinds = [SyntaxKind.AndPattern, SyntaxKind.OrPattern];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
762if (binaryPattern.IsKind(SyntaxKind.OrPattern))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (2)
331currentToken.Parent.Kind() is SyntaxKind.AndPattern or SyntaxKind.OrPattern or SyntaxKind.RelationalPattern || 332previousToken.Parent.Kind() is SyntaxKind.AndPattern or SyntaxKind.OrPattern or SyntaxKind.RelationalPattern)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
128public int? OrPattern => (int)SyntaxKind.OrPattern;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
151totalPattern = BinaryPattern(SyntaxKind.OrPattern, totalPattern.Parenthesize(), nextPatternPart.Parenthesize());
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
95p.IsDisjunctive ? SyntaxKind.OrPattern : SyntaxKind.AndPattern,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
231=> SyntaxFactory.BinaryPattern(SyntaxKind.OrPattern, (PatternSyntax)Parenthesize(left), (PatternSyntax)Parenthesize(right));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (2)
Semantics\PatternMatchingTests3.cs (2)
4201Assert.Equal(SyntaxKind.OrPattern, pattern.Kind()); 4435Assert.Equal(SyntaxKind.OrPattern, pattern.Kind());
Microsoft.CodeAnalysis.CSharp.Features (5)
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (1)
212if (current.IsKind(SyntaxKind.OrPattern))
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (1)
54pattern = BinaryPattern(SyntaxKind.OrPattern, pattern.Parenthesize(), nextPattern.Parenthesize());
src\Analyzers\CSharp\Analyzers\AddRequiredParentheses\CSharpAddRequiredPatternParenthesesDiagnosticAnalyzer.cs (1)
25private static readonly ImmutableArray<SyntaxKind> s_kinds = [SyntaxKind.AndPattern, SyntaxKind.OrPattern];
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
151totalPattern = BinaryPattern(SyntaxKind.OrPattern, totalPattern.Parenthesize(), nextPatternPart.Parenthesize());
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
95p.IsDisjunctive ? SyntaxKind.OrPattern : SyntaxKind.AndPattern,
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (33)
Generated\Syntax.Test.xml.Generated.cs (2)
311=> InternalSyntaxFactory.BinaryPattern(SyntaxKind.OrPattern, GenerateDiscardPattern(), InternalSyntaxFactory.Token(SyntaxKind.OrKeyword), GenerateDiscardPattern()); 10527=> SyntaxFactory.BinaryPattern(SyntaxKind.OrPattern, GenerateDiscardPattern(), SyntaxFactory.Token(SyntaxKind.OrKeyword), GenerateDiscardPattern());
Parsing\NullableParsingTests.cs (2)
1871N(SyntaxKind.OrPattern); 1913N(SyntaxKind.OrPattern);
Parsing\PatternParsingTests.cs (20)
8285N(SyntaxKind.OrPattern); 8536N(SyntaxKind.OrPattern); 9378N(SyntaxKind.OrPattern); 9425N(SyntaxKind.OrPattern); 9483N(SyntaxKind.OrPattern); 9541N(SyntaxKind.OrPattern); 9730N(SyntaxKind.OrPattern); 9783N(SyntaxKind.OrPattern); 9849N(SyntaxKind.OrPattern); 10874N(opKind == SyntaxKind.AndKeyword ? SyntaxKind.AndPattern : SyntaxKind.OrPattern); 10931N(SyntaxKind.OrPattern); 10992N(opKind == SyntaxKind.AndKeyword ? SyntaxKind.AndPattern : SyntaxKind.OrPattern); 11043N(opKind == SyntaxKind.AndKeyword ? SyntaxKind.AndPattern : SyntaxKind.OrPattern); 11095N(SyntaxKind.OrPattern); 11148N(SyntaxKind.OrPattern); 11205N(SyntaxKind.OrPattern); 11207N(SyntaxKind.OrPattern); 11488N(SyntaxKind.OrPattern); 11690N(SyntaxKind.OrPattern); 11692N(SyntaxKind.OrPattern);
Parsing\PatternParsingTests_ListPatterns.cs (2)
638N(SyntaxKind.OrPattern); 681N(SyntaxKind.OrPattern);
Parsing\PatternParsingTests2.cs (7)
518N(SyntaxKind.OrPattern); 1003N(SyntaxKind.OrPattern); 1163N(SyntaxKind.OrPattern); 1165N(SyntaxKind.OrPattern); 1311N(SyntaxKind.OrPattern); 1646N(SyntaxKind.OrPattern); 1707N(SyntaxKind.OrPattern);
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
762if (binaryPattern.IsKind(SyntaxKind.OrPattern))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (2)
331currentToken.Parent.Kind() is SyntaxKind.AndPattern or SyntaxKind.OrPattern or SyntaxKind.RelationalPattern || 332previousToken.Parent.Kind() is SyntaxKind.AndPattern or SyntaxKind.OrPattern or SyntaxKind.RelationalPattern)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
128public int? OrPattern => (int)SyntaxKind.OrPattern;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
231=> SyntaxFactory.BinaryPattern(SyntaxKind.OrPattern, (PatternSyntax)Parenthesize(left), (PatternSyntax)Parenthesize(right));