207 references to GenericNameSyntax
ILLink.RoslynAnalyzer (2)
RequiresAnalyzerBase.cs (2)
69 GenericNameSyntax genericNameSyntaxNode = (GenericNameSyntax) syntaxNodeAnalysisContext.Node;
Microsoft.AspNetCore.App.Analyzers (2)
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (1)
172(previous.IsKind(SyntaxKind.LessThanToken) && previous.GetRequiredParent().FirstAncestorOrSelf<GenericNameSyntax>() != null))
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (1)
283.Where(node => node is IdentifierNameSyntax || node is GenericNameSyntax)
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (5)
HubClientProxyGenerator.Parser.cs (3)
139Name: GenericNameSyntax 247if (memberAccess.Name is GenericNameSyntax { Arity: 1 } gns) 254else if (memberAccess.Name is not GenericNameSyntax
HubServerProxyGenerator.Parser.cs (2)
129Name: GenericNameSyntax 233var proxyType = ((GenericNameSyntax)memberAccess.Name).TypeArgumentList.Arguments[0];
Microsoft.CodeAnalysis.CSharp (35)
Binder\Binder_Crefs.cs (1)
187typeArgumentListSyntax: arity == 0 ? null : ((GenericNameSyntax)nameSyntax!).TypeArgumentList,
Binder\Binder_Expressions.cs (4)
98protected virtual bool IsUnboundTypeAllowed(GenericNameSyntax syntax) 1585? ((GenericNameSyntax)node).TypeArgumentList.Arguments 7541((GenericNameSyntax)right).TypeArgumentList.Arguments : 7663var typeArgumentsSyntax = right.Kind() == SyntaxKind.GenericName ? ((GenericNameSyntax)right).TypeArgumentList.Arguments : default(SeparatedSyntaxList<TypeSyntax>);
Binder\Binder_Invocation.cs (2)
2278var syntax = (GenericNameSyntax)argument;
Binder\Binder_Symbols.cs (4)
422return BindGenericSimpleNamespaceOrTypeOrAliasSymbol((GenericNameSyntax)syntax, diagnostics, basesBeingResolved, qualifierOpt: null); 840return BindGenericSimpleNamespaceOrTypeOrAliasSymbol((GenericNameSyntax)syntax, diagnostics, basesBeingResolved, qualifierOpt); 1151GenericNameSyntax node, 1263GenericNameSyntax node,
Binder\BuckStopsHereBinder.cs (1)
97protected override bool IsUnboundTypeAllowed(GenericNameSyntax syntax)
Binder\NameofBinder.cs (2)
29private readonly Dictionary<GenericNameSyntax, bool>? _allowedMap; 40protected override bool IsUnboundTypeAllowed(GenericNameSyntax syntax)
Binder\OpenTypeVisitor.cs (4)
25private Dictionary<GenericNameSyntax, bool>? _allowedMap; 33public static void Visit(ExpressionSyntax typeSyntax, out Dictionary<GenericNameSyntax, bool>? allowedMap) 40public override void VisitGenericName(GenericNameSyntax node) 45_allowedMap ??= new Dictionary<GenericNameSyntax, bool>();
Binder\TypeofBinder.cs (2)
25private readonly Dictionary<GenericNameSyntax, bool> _allowedMap; 34protected override bool IsUnboundTypeAllowed(GenericNameSyntax syntax)
Binder\WithCrefTypeParametersBinder.cs (2)
93AddTypeParameters((GenericNameSyntax)typeSyntax, map); 112private static void AddTypeParameters(GenericNameSyntax genericNameSyntax, MultiDictionary<string, TypeParameterSymbol> map)
Parser\LanguageParser_Patterns.cs (2)
458case GenericNameSyntax g: 465when (permitTypeArguments || right is not GenericNameSyntax):
Syntax\NameSyntax.cs (2)
17return this is GenericNameSyntax ? ((GenericNameSyntax)this).TypeArgumentList.Arguments.Count : 0;
Syntax\SyntaxExtensions.cs (3)
193: (SimpleNameSyntax)((GenericNameSyntax)simpleName).WithIdentifier(identifier); 463var genericNameSyntax = (GenericNameSyntax)type;
Syntax\SyntaxFactory.cs (6)
2286var gn = (GenericNameSyntax)max.Name; 2294var gn = (GenericNameSyntax)qn.Right; 2302var gn = (GenericNameSyntax)an.Name;
Microsoft.CodeAnalysis.CSharp.CodeStyle (21)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
144var invokedTypeArguments = invokedExpression.GetRightmostName() is GenericNameSyntax genericName
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (1)
120memberAccessExpression.Expression is not GenericNameSyntax { Identifier.ValueText: nameof(ArrayBuilder<int>) })
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (3)
1121if (memberAccess.Name is not GenericNameSyntax 1149if (expression is GenericNameSyntax) 1152if (expression is MemberAccessExpressionSyntax { Expression: ExpressionSyntax childName, Name: GenericNameSyntax } &&
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (2)
118GenericNameSyntax { TypeArgumentList.Arguments: [{ } typeArgument] } => typeArgument, 119QualifiedNameSyntax { Right: GenericNameSyntax { TypeArgumentList.Arguments: [{ } typeArgument] } } => typeArgument,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (2)
83var gx = (GenericNameSyntax)expression;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (2)
232public static bool TryParseGenericName(this SyntaxToken genericIdentifier, CancellationToken cancellationToken, [NotNullWhen(true)] out GenericNameSyntax? genericName) 241genericName = name as GenericNameSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (3)
559=> (genericName as GenericNameSyntax)?.TypeArgumentList.Arguments ?? default; 1644var genericName = (GenericNameSyntax)node;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\NameSyntaxComparer.cs (7)
41(GenericNameSyntax genericX, GenericNameSyntax genericY) => Compare(genericX, genericY), 42(IdentifierNameSyntax identifierX, GenericNameSyntax genericY) => 46(GenericNameSyntax genericX, IdentifierNameSyntax identifierY) => 100result.Add((GenericNameSyntax)name); 105private int Compare(GenericNameSyntax x, GenericNameSyntax y)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (8)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (3)
73var genericName = (GenericNameSyntax)State.SimpleNameOpt; 152if (State.SimpleNameOpt is not GenericNameSyntax genericName)
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
156var result = GenericName(
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
291case GenericNameSyntax generic:
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\NameSyntaxExtensions.cs (1)
39return ((GenericNameSyntax)nameSyntax).Identifier;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
172return token.Parent is GenericNameSyntax genericName && genericName.TypeArgumentList != null &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeSyntaxExtensions.cs (1)
25GenericNameSyntax or
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
EventHookup\EventHookupSessionManager_EventHookupSession.cs (1)
254if (lhs is GenericNameSyntax lhsGenericNameSyntax)
Microsoft.CodeAnalysis.CSharp.Features (24)
Completion\CompletionProviders\SpeculativeTCompletionProvider.cs (1)
127spanStart = token.GetAncestor<GenericNameSyntax>()?.SpanStart ?? spanStart;
Diagnostics\Analyzers\TypeSyntaxSimplifierWalker.cs (1)
176public override void VisitGenericName(GenericNameSyntax node)
GenerateType\CSharpGenerateTypeService.cs (4)
497if (state.SimpleName is GenericNameSyntax) 499var genericName = (GenericNameSyntax)state.SimpleName; 733=> simpleName is GenericNameSyntax;
SignatureHelp\GenericNameSignatureHelpProvider.cs (5)
49root, position, syntaxFacts, triggerReason, IsTriggerToken, IsArgumentListToken, cancellationToken, out GenericNameSyntax? name)) 67token.Parent.Parent is GenericNameSyntax; 70private bool IsArgumentListToken(GenericNameSyntax node, SyntaxToken token) 164Contract.ThrowIfFalse(lessThanToken.Parent is TypeArgumentListSyntax && lessThanToken.Parent.Parent is GenericNameSyntax); 165return SignatureHelpUtilities.GetSignatureHelpSpan(((GenericNameSyntax)lessThanToken.Parent.Parent).TypeArgumentList);
SpellCheck\CSharpSpellcheckCodeFixProvider.cs (1)
51=> nameNode is GenericNameSyntax;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
144var invokedTypeArguments = invokedExpression.GetRightmostName() is GenericNameSyntax genericName
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (1)
120memberAccessExpression.Expression is not GenericNameSyntax { Identifier.ValueText: nameof(ArrayBuilder<int>) })
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (3)
1121if (memberAccess.Name is not GenericNameSyntax 1149if (expression is GenericNameSyntax) 1152if (expression is MemberAccessExpressionSyntax { Expression: ExpressionSyntax childName, Name: GenericNameSyntax } &&
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (2)
118GenericNameSyntax { TypeArgumentList.Arguments: [{ } typeArgument] } => typeArgument, 119QualifiedNameSyntax { Right: GenericNameSyntax { TypeArgumentList.Arguments: [{ } typeArgument] } } => typeArgument,
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (3)
73var genericName = (GenericNameSyntax)State.SimpleNameOpt; 152if (State.SimpleNameOpt is not GenericNameSyntax genericName)
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
156var result = GenericName(
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
291case GenericNameSyntax generic:
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (8)
Semantics\LookupTests.cs (2)
2100var node = tree.GetRoot().DescendantNodes().OfType<GenericNameSyntax>().Single();
Semantics\NameOfTests.cs (4)
3043var firstGeneric = root.DescendantNodes().OfType<GenericNameSyntax>().First(); 3044var lastGeneric = root.DescendantNodes().OfType<GenericNameSyntax>().Last();
Semantics\ObjectAndCollectionInitializerTests.cs (2)
4017var nodes = tree.GetRoot().DescendantNodes().OfType<GenericNameSyntax>().ToArray(); 4020foreach (var name in nodes)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (13)
Compilation\GetSemanticInfoTests.cs (2)
4272var syntax = tree.GetCompilationUnitRoot().FindToken(position).Parent.DescendantNodesAndSelf().OfType<GenericNameSyntax>().Single();
Compilation\SemanticModelAPITests.cs (2)
3620var speculatedName = (GenericNameSyntax)SyntaxFactory.GenericName("List{T}");
DocumentationComments\CrefTests.cs (8)
3011var left = (GenericNameSyntax)containingTypeSyntax.Left; 3029var right = (GenericNameSyntax)containingTypeSyntax.Right; 4578model.GetSymbolInfo(((GenericNameSyntax)crefSyntax.Name).TypeArgumentList.Arguments.Single()); 4596model.GetSymbolInfo(((GenericNameSyntax)crefSyntax.Name).TypeArgumentList.Arguments.Single()); 4613model.GetSymbolInfo(((GenericNameSyntax)crefSyntax.Name).TypeArgumentList.Arguments.Single()); 6674var name = ((GenericNameSyntax)crefSyntax.Name).TypeArgumentList.Arguments.Single();
Symbols\ExtensionMethodTests.cs (1)
2738symbolInfo = model.GetSymbolInfo((GenericNameSyntax)node);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (37)
Generated\Syntax.Test.xml.Generated.cs (5)
10235private static GenericNameSyntax GenerateGenericName() 10988var node = GenerateGenericName(); 10992var newNode = node.WithIdentifier(node.Identifier).WithTypeArgumentList(node.TypeArgumentList); 14151var oldNode = GenerateGenericName(); 14167var oldNode = GenerateGenericName();
IncrementalParsing\NodeValidators.cs (3)
63Assert.IsType<GenericNameSyntax>(nameTree); 64var genericName = nameTree as GenericNameSyntax;
Parsing\NameParsingTests.cs (28)
212var gname = (GenericNameSyntax)name; 228var gname = (GenericNameSyntax)name; 244var gname = (GenericNameSyntax)name; 304var gname = (GenericNameSyntax)name; 321var gname = (GenericNameSyntax)name; 367var gname = (GenericNameSyntax)name; 384var gname = (GenericNameSyntax)name; 445var gname = (GenericNameSyntax)name; 624var gname = (GenericNameSyntax)tname; 649var gname = (GenericNameSyntax)tname; 675var gname = (GenericNameSyntax)tname; 701var gname = (GenericNameSyntax)tname; 733var gname = (GenericNameSyntax)tname; 758var gname = (GenericNameSyntax)tname;
Syntax\SyntaxNodeTests.cs (1)
1866var generic = SyntaxFactory.GenericName(bar.Identifier, SyntaxFactory.TypeArgumentList(lt, gp, gt));
Microsoft.CodeAnalysis.CSharp.Workspaces (34)
Classification\SyntaxClassification\NameSyntaxClassifier.cs (1)
39typeof(GenericNameSyntax),
CodeGeneration\CSharpSyntaxGenerator.cs (2)
3401var gname = (GenericNameSyntax)expression;
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (1)
713case GenericNameSyntax genericNameNode:
Simplification\CSharpSimplificationService.Expander.cs (2)
419public override SyntaxNode VisitGenericName(GenericNameSyntax node) 750var genericName = GenericName(
Simplification\Reducers\CSharpExtensionMethodReducer.cs (1)
92(GenericNameSyntax)invocationExpressionNodeExpression.WithoutLeadingTrivia());
Simplification\Reducers\CSharpNameReducer.Rewriter.cs (1)
114public override SyntaxNode VisitGenericName(GenericNameSyntax node)
Simplification\Reducers\CSharpVarReducer.Rewriter.cs (1)
54public override SyntaxNode VisitGenericName(GenericNameSyntax node) => ProcessTypeSyntax(node);
Simplification\Simplifiers\NameSimplifier.cs (8)
87var genericName = (GenericNameSyntax)name; 277GenericNameSyntax genericName; 280genericName = (GenericNameSyntax)((QualifiedNameSyntax)name).Right; 284genericName = (GenericNameSyntax)name; 343var identifier = ((GenericNameSyntax)name).Identifier; 525case GenericNameSyntax generic: 605else if (name is GenericNameSyntax genericName)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (2)
83var gx = (GenericNameSyntax)expression;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (2)
232public static bool TryParseGenericName(this SyntaxToken genericIdentifier, CancellationToken cancellationToken, [NotNullWhen(true)] out GenericNameSyntax? genericName) 241genericName = name as GenericNameSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (3)
559=> (genericName as GenericNameSyntax)?.TypeArgumentList.Arguments ?? default; 1644var genericName = (GenericNameSyntax)node;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\NameSyntaxComparer.cs (7)
41(GenericNameSyntax genericX, GenericNameSyntax genericY) => Compare(genericX, genericY), 42(IdentifierNameSyntax identifierX, GenericNameSyntax genericY) => 46(GenericNameSyntax genericX, IdentifierNameSyntax identifierY) => 100result.Add((GenericNameSyntax)name); 105private int Compare(GenericNameSyntax x, GenericNameSyntax y)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\NameSyntaxExtensions.cs (1)
39return ((GenericNameSyntax)nameSyntax).Identifier;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
172return token.Parent is GenericNameSyntax genericName && genericName.TypeArgumentList != null &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeSyntaxExtensions.cs (1)
25GenericNameSyntax or
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (5)
CodeGeneration\SyntaxGeneratorTests.cs (5)
244VerifySyntax<GenericNameSyntax>(Generator.GenericName("x", Generator.IdentifierName("y")), "x<y>"); 245VerifySyntax<GenericNameSyntax>(Generator.GenericName("x", Generator.IdentifierName("y"), Generator.IdentifierName("z")), "x<y, z>"); 248VerifySyntax<GenericNameSyntax>(Generator.WithTypeArguments(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "x<y>"); 258VerifySyntax<GenericNameSyntax>(gname, "x<y>"); 259VerifySyntax<GenericNameSyntax>(Generator.WithTypeArguments(gname, Generator.IdentifierName("z")), "x<z>");
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
SymbolKeyTests.cs (2)
1275var node = root.DescendantNodes().OfType<CSharp.Syntax.GenericNameSyntax>().Single();
Microsoft.Interop.ComInterfaceGenerator (1)
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (1)
222location = ((GenericNameSyntax)expression).TypeArgumentList.Arguments[ordinal].GetLocation();
Microsoft.Interop.SourceGeneration (2)
Utils\SyntaxFactoryExtensions.cs (2)
81public static GenericNameSyntax SpanOf(TypeSyntax type) => GenericName(_span, TypeArgumentList(SingletonSeparatedList(type))); 84public static GenericNameSyntax ReadOnlySpanOf(TypeSyntax type) => GenericName(_readonlySpan, TypeArgumentList(SingletonSeparatedList(type)));
Microsoft.VisualStudio.LanguageServices.CSharp (7)
CodeModel\CSharpCodeModelService.CodeModelEventCollector.cs (4)
739var oldGenericName = (GenericNameSyntax)oldName; 740var newGenericName = (GenericNameSyntax)newName;
CodeModel\CSharpCodeModelService.NodeNameGenerator.cs (2)
41var genericName = (GenericNameSyntax)name;
LanguageService\CSharpHelpContextService.cs (1)
163var genericName = token.GetAncestor<GenericNameSyntax>();