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