71 references to SubpatternSyntax
Microsoft.CodeAnalysis.CSharp (5)
Binder\Binder_Patterns.cs (1)
1466foreach (SubpatternSyntax p in node.Subpatterns)
Parser\LanguageParser_Patterns.cs (1)
503private SubpatternSyntax ParseSubpatternElement()
Syntax\SubpatternSyntax.cs (3)
13public SubpatternSyntax WithNameColon(NameColonSyntax? nameColon) 16public SubpatternSyntax Update(NameColonSyntax? nameColon, PatternSyntax pattern) 25public static SubpatternSyntax Subpattern(NameColonSyntax? nameColon, PatternSyntax pattern)
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\Analyzers\CSharp\Analyzers\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternDiagnosticAnalyzer.cs (2)
59var subpattern = (SubpatternSyntax)syntaxContext.Node;
src\Analyzers\CSharp\Analyzers\SimplifyPropertyPattern\SimplifyPropertyPatternHelpers.cs (2)
14SubpatternSyntax subpattern, 15[NotNullWhen(true)] out SubpatternSyntax? innerSubpattern,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
729if (node.Parent is SubpatternSyntax)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (13)
src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (6)
44var subpatterns = diagnostics.Select(d => (SubpatternSyntax)d.AdditionalLocations[0].FindNode(cancellationToken)) 54var currentSubpattern = (SubpatternSyntax)current; 63private static SubpatternSyntax? TrySimplify(SubpatternSyntax currentSubpattern) 65if (!SimplifyPropertyPatternHelpers.IsSimplifiable(currentSubpattern, out var innerSubpattern, out var outerExpressionColon))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (7)
176SubpatternSyntax subpattern => InferTypeInSubpattern(subpattern, node), 1465SubpatternSyntax subpattern, 1570foreach (var subPattern in positionalPart.Subpatterns) 1663SubpatternSyntax subPattern => InferTypeInSubpattern(subPattern, subPattern.Pattern), 1678SubpatternSyntax subPattern => InferTypeInSubpattern(subPattern, subPattern.Pattern), 1851if (nameColon.Parent is SubpatternSyntax subpattern) 1861if (expressionColon.Parent is SubpatternSyntax subpattern)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (11)
Semantics\PatternMatchingTests3.cs (7)
49var subpatterns = tree.GetRoot().DescendantNodes().OfType<SubpatternSyntax>().ToArray(); 109var subpatterns = tree.GetRoot().DescendantNodes().OfType<SubpatternSyntax>().ToArray(); 160var subpatterns = tree.GetRoot().DescendantNodes().OfType<SubpatternSyntax>().ToArray(); 205var subpatterns = tree.GetRoot().DescendantNodes().OfType<SubpatternSyntax>().ToArray(); 256var subpatterns = tree.GetRoot().DescendantNodes().OfType<SubpatternSyntax>().ToArray(); 299var subpatterns = tree.GetRoot().DescendantNodes().OfType<SubpatternSyntax>().ToArray(); 346var subpatterns = tree.GetRoot().DescendantNodes().OfType<SubpatternSyntax>().ToArray();
Semantics\PatternMatchingTests5.cs (4)
1106var subpatterns = tree.GetRoot().DescendantNodes().OfType<SubpatternSyntax>().ToArray(); 1186var subpatterns = tree.GetRoot().DescendantNodes().OfType<SubpatternSyntax>().ToArray(); 1237var subpatterns = tree.GetRoot().DescendantNodes().OfType<SubpatternSyntax>().ToArray(); 1289var subpatterns = tree.GetRoot().DescendantNodes().OfType<SubpatternSyntax>().ToArray();
Microsoft.CodeAnalysis.CSharp.Features (22)
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (11)
129var rightSubpattern = CreateSubpattern(rightNames, CreatePattern(rightReceiver, rightTarget, rightFlipped)); 135var leftSubpattern = CreateSubpattern(leftNames, CreatePattern(leftReceiver, leftTarget, leftFlipped)); 141var leftSubpattern = CreateSubpattern(leftNames, CreatePattern(leftReceiver, leftTarget, leftFlipped)); 142var rightSubpattern = CreateSubpattern(rightNames, CreatePattern(rightReceiver, rightTarget, rightFlipped)); 242static PatternSyntax AddSubpattern(PatternSyntax containingPattern, SubpatternSyntax subpattern) 380private static SubpatternSyntax CreateSubpattern(ImmutableArray<IdentifierNameSyntax> names, PatternSyntax pattern) 393var subpattern = Subpattern(names[0], pattern); 400private static SubpatternSyntax Subpattern(IdentifierNameSyntax name, PatternSyntax pattern) 403private static RecursivePatternSyntax RecursivePattern(params SubpatternSyntax[] subpatterns) 406private static RecursivePatternSyntax RecursivePattern(TypeSyntax? type, SubpatternSyntax subpattern, VariableDesignationSyntax? designation) 409private static RecursivePatternSyntax RecursivePattern(SubpatternSyntax subpattern)
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (1)
205if (memberAccess is { Parent.Parent: SubpatternSyntax { Parent: PropertyPatternClauseSyntax found } })
src\Analyzers\CSharp\Analyzers\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternDiagnosticAnalyzer.cs (2)
59var subpattern = (SubpatternSyntax)syntaxContext.Node;
src\Analyzers\CSharp\Analyzers\SimplifyPropertyPattern\SimplifyPropertyPatternHelpers.cs (2)
14SubpatternSyntax subpattern, 15[NotNullWhen(true)] out SubpatternSyntax? innerSubpattern,
src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (6)
44var subpatterns = diagnostics.Select(d => (SubpatternSyntax)d.AdditionalLocations[0].FindNode(cancellationToken)) 54var currentSubpattern = (SubpatternSyntax)current; 63private static SubpatternSyntax? TrySimplify(SubpatternSyntax currentSubpattern) 65if (!SimplifyPropertyPatternHelpers.IsSimplifiable(currentSubpattern, out var innerSubpattern, out var outerExpressionColon))
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (7)
Generated\Syntax.Test.xml.Generated.cs (7)
10506=> SyntaxFactory.PositionalPatternClause(SyntaxFactory.Token(SyntaxKind.OpenParenToken), new SeparatedSyntaxList<SubpatternSyntax>(), SyntaxFactory.Token(SyntaxKind.CloseParenToken)); 10509=> SyntaxFactory.PropertyPatternClause(SyntaxFactory.Token(SyntaxKind.OpenBraceToken), new SeparatedSyntaxList<SubpatternSyntax>(), SyntaxFactory.Token(SyntaxKind.CloseBraceToken)); 10511private static SubpatternSyntax GenerateSubpattern() 12078var node = GenerateSubpattern(); 12082var newNode = node.WithExpressionColon(node.ExpressionColon).WithPattern(node.Pattern); 16543var oldNode = GenerateSubpattern(); 16559var oldNode = GenerateSubpattern();
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
729if (node.Parent is SubpatternSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (7)
176SubpatternSyntax subpattern => InferTypeInSubpattern(subpattern, node), 1465SubpatternSyntax subpattern, 1570foreach (var subPattern in positionalPart.Subpatterns) 1663SubpatternSyntax subPattern => InferTypeInSubpattern(subPattern, subPattern.Pattern), 1678SubpatternSyntax subPattern => InferTypeInSubpattern(subPattern, subPattern.Pattern), 1851if (nameColon.Parent is SubpatternSyntax subpattern) 1861if (expressionColon.Parent is SubpatternSyntax subpattern)