2 types derived from NameSyntax
Microsoft.CodeAnalysis.CSharp (2)
Syntax\AliasedQualifiedNameSyntax.cs (1)
7public sealed partial class AliasQualifiedNameSyntax : NameSyntax
Syntax\QualifiedNameSyntax.cs (1)
12public sealed partial class QualifiedNameSyntax : NameSyntax
347 references to NameSyntax
ConfigurationSchemaGenerator (1)
RuntimeSource\Roslyn\GetBestTypeByMetadataName.cs (1)
178public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name)
ILLink.RoslynAnalyzer (1)
CompilationExtensions.cs (1)
157 public static SimpleNameSyntax GetUnqualifiedName (this NameSyntax name)
Microsoft.CodeAnalysis.CSharp (59)
Binder\Binder_Expressions.cs (5)
1397private void CheckDisallowedAttributeDependentType(TypeWithAnnotations typeArgument, NameSyntax attributeName, BindingDiagnosticBag diagnostics) 2931private static NameSyntax GetNameSyntax(SyntaxNode syntax) 2944internal static NameSyntax GetNameSyntax(SyntaxNode syntax, out string nameString) 2969return syntax as NameSyntax; 2982var nameSyntax = GetNameSyntax(syntax, out nameString);
Binder\Binder_Symbols.cs (5)
1065private static LookupOptions GetSimpleNameLookupOptions(NameSyntax node, bool isVerbatimIdentifier) 2070(where as NameSyntax)?.ErrorDisplayName() ?? simpleName, 2209new object[] { (where as NameSyntax)?.ErrorDisplayName() ?? simpleName, first, second }); 2216(where as NameSyntax)?.ErrorDisplayName() ?? simpleName, 2315CSDiagnosticInfo info = NotFound(where, simpleName, arity, (where as NameSyntax)?.ErrorDisplayName() ?? simpleName, diagnostics, aliasOpt, qualifierOpt, options);
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
895private static Binder MakeNamespaceBinder(CSharpSyntaxNode node, NameSyntax name, Binder outer, bool inUsing)
Compilation\AttributeSemanticModel.cs (1)
94return new BoundTypeExpression((NameSyntax)node, _aliasOpt, type: AttributeType);
Compilation\CSharpCompilation.UsingsFromOptionsAndDiagnostics.cs (1)
49NameSyntax qualifiedName = SyntaxFactory.IdentifierName(identifiers[0]);
Compilation\SyntaxTreeSemanticModel.cs (1)
1720private NamespaceSymbol GetDeclaredNamespace(NamespaceOrTypeSymbol container, TextSpan declarationSpan, NameSyntax name)
Declarations\DeclarationTreeBuilder.cs (4)
379if (directive.Name is not NameSyntax name) 505NameSyntax name = node.Name; 624private static bool ContainsAlias(NameSyntax name) 640private static bool ContainsGeneric(NameSyntax name)
FlowAnalysis\NullableWalker.cs (1)
6759var nameSyntax = Binder.GetNameSyntax(syntax, out _);
Parser\DocumentationCommentParser.cs (1)
1370NameSyntax leftName;
Parser\LanguageParser.cs (12)
260var name = this.ParseQualifiedName(); 3718NameSyntax explicitInterfaceName = null; 5644public NameSyntax ParseName() 6451NameSyntax explicitInterfaceName = null; 6572private void AccumulateExplicitInterfaceName(ref NameSyntax explicitInterfaceName, ref SyntaxToken separator) 6594var tmp = this.ParseQualifiedNameRight(NameOptions.InTypeList, explicitInterfaceName, separator); 6633NameSyntax explicitInterfaceName = null; 6701private NameSyntax ParseAliasQualifiedName(NameOptions allowedParts = NameOptions.None) 6709private NameSyntax ParseQualifiedName(NameOptions options = NameOptions.None) 6711NameSyntax name = this.ParseAliasQualifiedName(options); 6728private NameSyntax ParseQualifiedNameRight( 6730NameSyntax left,
Parser\LanguageParser_Patterns.cs (3)
26ConstantPatternSyntax cp when ConvertExpressionToType(cp.Expression, out NameSyntax? type) => type, 33private bool ConvertExpressionToType(ExpressionSyntax expression, [NotNullWhen(true)] out NameSyntax? type) 41when ConvertExpressionToType(expr, out var leftType):
SourceGeneration\CSharpSyntaxHelper.cs (1)
59=> ((NameSyntax)node).GetUnqualifiedName().Identifier.ValueText;
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
89NameSyntax name = ns.Name;
Symbols\AliasSymbol.cs (1)
379else if (usingDirective.NamespaceOrType is not NameSyntax)
Symbols\NamespaceSymbol.cs (1)
283internal NamespaceSymbol GetNestedNamespace(NameSyntax name)
Symbols\Source\ExplicitInterfaceHelpers.cs (1)
53NameSyntax explicitInterfaceName = explicitInterfaceSpecifierOpt.Name;
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (1)
792NameSyntax name;
Syntax\NamespaceDeclarationSyntax.cs (1)
21public NamespaceDeclarationSyntax Update(SyntaxToken namespaceKeyword, NameSyntax name, SyntaxToken openBraceToken, SyntaxList<ExternAliasDirectiveSyntax> externs, SyntaxList<UsingDirectiveSyntax> usings, SyntaxList<MemberDeclarationSyntax> members, SyntaxToken closeBraceToken, SyntaxToken semicolonToken)
Syntax\NamespaceDeclarationSyntaxReference.cs (1)
35while (node is NameSyntax)
Syntax\NameSyntax.cs (1)
43NameSyntax name = this;
Syntax\SyntaxFactory.cs (7)
1690public static NameSyntax ParseName(string text, int offset = 0, bool consumeFullText = true) 1695var node = parser.ParseName(); 1697return (NameSyntax)node.CreateRed(); 2658public static UsingDirectiveSyntax UsingDirective(NameEqualsSyntax alias, NameSyntax name) 2668public static UsingDirectiveSyntax UsingDirective(SyntaxToken usingKeyword, SyntaxToken staticKeyword, NameEqualsSyntax? alias, NameSyntax name, SyntaxToken semicolonToken) 2700public static NamespaceDeclarationSyntax NamespaceDeclaration(NameSyntax name, SyntaxList<ExternAliasDirectiveSyntax> externs, SyntaxList<UsingDirectiveSyntax> usings, SyntaxList<MemberDeclarationSyntax> members) 2704public static NamespaceDeclarationSyntax NamespaceDeclaration(SyntaxToken namespaceKeyword, NameSyntax name, SyntaxToken openBraceToken, SyntaxList<ExternAliasDirectiveSyntax> externs, SyntaxList<UsingDirectiveSyntax> usings, SyntaxList<MemberDeclarationSyntax> members, SyntaxToken closeBraceToken, SyntaxToken semicolonToken)
Syntax\UsingDirectiveSyntax.cs (8)
19public NameSyntax? Name => this.NamespaceOrType as NameSyntax; 21public UsingDirectiveSyntax Update(SyntaxToken usingKeyword, SyntaxToken staticKeyword, NameEqualsSyntax? alias, NameSyntax name, SyntaxToken semicolonToken) 24public UsingDirectiveSyntax Update(SyntaxToken globalKeyword, SyntaxToken usingKeyword, SyntaxToken staticKeyword, NameEqualsSyntax? alias, NameSyntax name, SyntaxToken semicolonToken) 27public UsingDirectiveSyntax WithName(NameSyntax name) 37public static UsingDirectiveSyntax UsingDirective(SyntaxToken staticKeyword, NameEqualsSyntax? alias, NameSyntax name) 41public static UsingDirectiveSyntax UsingDirective(SyntaxToken globalKeyword, SyntaxToken usingKeyword, SyntaxToken staticKeyword, NameEqualsSyntax? alias, NameSyntax name, SyntaxToken semicolonToken) 45public static UsingDirectiveSyntax UsingDirective(NameSyntax name)
Microsoft.CodeAnalysis.CSharp.CodeStyle (24)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
109public static bool IsLeftSideOfExplicitInterfaceSpecifier([NotNullWhen(true)] this NameSyntax? name)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (2)
517if (castExpression.Type is NameSyntax name && StartsWithAlias(name)) 537private static bool StartsWithAlias(NameSyntax name)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
239var name = SyntaxFactory.ParseName(syntaxTree.GetText(cancellationToken).ToString(TextSpan.FromBounds(genericIdentifier.SpanStart, lastToken.Span.End)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (3)
1050if (parent is not NameSyntax) 1163=> (node as NameSyntax).IsLeftSideOfExplicitInterfaceSpecifier(); 1570=> node is NameSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\NameSyntaxComparer.cs (9)
10internal class NameSyntaxComparer : IComparer<NameSyntax?> 21public static IComparer<NameSyntax?> Create() 24public static IComparer<NameSyntax?> Create(IComparer<SyntaxToken> tokenComparer) 27public int Compare(NameSyntax? x, NameSyntax? y) 53int DecomposeCompare(NameSyntax x, NameSyntax y) 75private static IList<SimpleNameSyntax> DecomposeNameParts(NameSyntax name) 82private static void DecomposeNameParts(NameSyntax name, List<SimpleNameSyntax> result)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeSyntaxComparer.cs (6)
13internal readonly IComparer<NameSyntax?> NameComparer; 15internal TypeSyntaxComparer(IComparer<SyntaxToken> tokenComparer, IComparer<NameSyntax?> nameComparer) 36if (x is NameSyntax && y is NameSyntax) 38return NameComparer.Compare((NameSyntax)x, (NameSyntax)y);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesDirectiveComparer.cs (2)
22private readonly IComparer<NameSyntax> _nameComparer; 26IComparer<NameSyntax> nameComparer,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (30)
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (4)
88var fullName = simpleName.IsRightSideOfQualifiedName() 89? (NameSyntax)simpleName.Parent 120var fullName = simpleName.IsRightSideOfQualifiedName() 121? (NameSyntax)simpleName.Parent
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
333var containingTypeSyntax = containingType.GenerateNameSyntax(); 414var synthesizedTypeNode = baseTypeSymbol.GenerateNameSyntax(allowVar: false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
76return attribute.AttributeClass.GenerateTypeSyntax() is NameSyntax nameSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
218if (implementation.ContainingType.GenerateTypeSyntax() is not NameSyntax name)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamespaceGenerator.cs (3)
154var name = GenerateName(alias.Target); 164var name = GenerateName(namespaceOrType); 174private static NameSyntax GenerateName(INamespaceOrTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
988if (nameToken.Parent is not NameSyntax name)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (2)
30public static NameSyntax GenerateNameSyntax(this INamespaceOrTypeSymbol symbol, bool allowVar = true) 31=> (NameSyntax)GenerateTypeSyntax(symbol, nameSyntax: true, allowVar: allowVar);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (3)
278if (containingTypeSyntax is NameSyntax name) 303(NameSyntax)container, 334(NameSyntax)container,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\NameSyntaxExtensions.cs (6)
16public static IList<NameSyntax> GetNameParts(this NameSyntax nameSyntax) 19public static NameSyntax GetLastDottedName(this NameSyntax nameSyntax) 25public static SyntaxToken GetNameToken(this NameSyntax nameSyntax) 52public static bool CanBeReplacedWithAnyName(this NameSyntax nameSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeSyntaxExtensions.cs (1)
37if (typeSyntax is not NameSyntax nameSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NameSyntaxIterator.cs (6)
13internal class NameSyntaxIterator : IEnumerable<NameSyntax> 15private readonly NameSyntax _name; 17public NameSyntaxIterator(NameSyntax name) 20public IEnumerator<NameSyntax> GetEnumerator() 22var nodes = new LinkedList<NameSyntax>(); 24var currentNode = _name;
Microsoft.CodeAnalysis.CSharp.Features (34)
AddImport\CSharpAddImportFeatureService.cs (6)
222var left = qn.Left; 408private static NameSyntax CreateNameSyntax(IReadOnlyList<string> namespaceParts, int index) 496private static NameSyntax RemoveGlobalAliasIfUnnecessary( 498NameSyntax nameSyntax, 542private static NameSyntax AddOrReplaceAlias( 543NameSyntax nameSyntax, IdentifierNameSyntax alias)
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (1)
153NameSyntax attributeName,
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (2)
144var qualifiedNamespaceName = CreateNamespaceAsQualifiedName(newNamespaceParts, aliasQualifier, newNamespaceParts.Length - 1); 414private static NameSyntax CreateNamespaceAsQualifiedName(ImmutableArray<string> namespaceParts, string? aliasQualifier, int index)
Completion\CompletionProviders\AwaitCompletionProvider.cs (1)
107if (parent is NameSyntax { Parent: LocalFunctionStatementSyntax localFunction } name &&
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.ItemGetter.cs (1)
83NameSyntax? name = null;
ConvertAnonymousType\CSharpConvertAnonymousTypeToClassCodeRefactoringProvider.cs (2)
22NameSyntax, 35NameSyntax nameNode, AnonymousObjectCreationExpressionSyntax anonymousObject)
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
89private static void AddUsingDirectives(NameSyntax name, SyntaxAnnotation annotation, ArrayBuilder<UsingDirectiveSyntax> directives)
ConvertTupleToStruct\CSharpConvertTupleToStructCodeRefactoringProvider.cs (1)
19NameSyntax,
Debugging\BreakpointResolver.cs (1)
50var name = SyntaxFactory.ParseName(text, consumeFullText: false);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs (1)
59if (expression is NameSyntax)
GenerateType\CSharpGenerateTypeService.cs (1)
620private static void GetNamespaceContainers(NameSyntax name, List<string> namespaceContainers)
IntroduceVariable\CSharpIntroduceVariableService.cs (1)
23AbstractIntroduceVariableService<CSharpIntroduceVariableService, ExpressionSyntax, TypeSyntax, TypeDeclarationSyntax, QueryExpressionSyntax, NameSyntax>
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (3)
217NameSyntax newLocalName, 273NameSyntax newLocalName, 341NameSyntax newLocalName,
IntroduceVariable\CSharpIntroduceVariableService_IntroduceQueryLocal.cs (1)
79NameSyntax newLocalName,
QuickInfo\CSharpDiagnosticAnalyzerQuickInfoProviderExtensions.cs (1)
25public static bool IsSuppressMessageAttribute(this NameSyntax? name)
RelatedDocuments\CSharpRelatedDocumentsService.cs (3)
22NameSyntax> 51else if (current is NameSyntax name) 72if (expression is not NameSyntax name)
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (4)
88var fullName = simpleName.IsRightSideOfQualifiedName() 89? (NameSyntax)simpleName.Parent 120var fullName = simpleName.IsRightSideOfQualifiedName() 121? (NameSyntax)simpleName.Parent
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
89NameSyntax name = ns.Name;
Wrapping\ChainedExpression\CSharpChainedExpressionWrapper.cs (1)
15AbstractChainedExpressionWrapper<NameSyntax, BaseArgumentListSyntax>
Wrapping\SeparatedSyntaxList\CSharpArgumentWrapper.cs (1)
113if (expr is NameSyntax name)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
Semantics\BindingTests.cs (1)
3736var node2 = ((QualifiedNameSyntax)node1).Left;
Semantics\LambdaTests.cs (2)
1086var oReference = 1090.OfType<NameSyntax>()
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (15)
Compilation\GetSemanticInfoTests.cs (1)
4439var leftSyntax = qualifiedSyntax.Left;
Compilation\SemanticModelAPITests.cs (5)
2800var speculatedUsingExpression = SyntaxFactory.ParseName("System.Collections"); 2815var speculatedUsingExpression = SyntaxFactory.ParseName("System.ArgumentException"); 2835var speculatedTypeExpression = SyntaxFactory.ParseName("System.ArgumentException"); 2866var speculatedTypeExpression = SyntaxFactory.ParseName("System.ArgumentException"); 2895var speculatedAliasName = SyntaxFactory.ParseName("A");
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (2)
2497var ns = type.Left; 2593var ns = type.Left;
Compilation\SemanticModelGetSemanticInfoTests.cs (1)
402var semanticInfo = GetSemanticInfoForTest<NameSyntax>(sourceCode);
DocumentationComments\CrefTests.cs (5)
5697foreach (var id in cref.DescendantNodes().OfType<NameSyntax>()) 6285var speculatedName = SyntaxFactory.ParseName("b"); 6342var accessorName = SyntaxFactory.ParseName(accessor.Name); 6357var inheritedTypeName = SyntaxFactory.ParseName(inheritedType.Name);
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (1)
1043var interfaceName = explicitInterfaceImplementation.ExplicitInterfaceSpecifier.Name;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (49)
Parsing\ExpressionParsingTests.cs (1)
3030Assert.Equal(1, ((NameSyntax)objectCreation.Type).Arity);
Parsing\NameParsingTests.cs (46)
19private NameSyntax ParseName(string text) 33var name = ParseName(text); 46var name = ParseName(text); 59var name = ParseName(text); 73var name = ParseName(text); 88var name = ParseName(text); 103var name = ParseName(text); 118var name = ParseName(text); 131var name = ParseName(text); 146var name = ParseName(text); 159var name = ParseName(text); 188var name = ParseName(text); 206var name = ParseName(text); 222var name = ParseName(text); 238var name = ParseName(text); 256var name = ParseName(text); 298var name = ParseName(text); 315var name = ParseName(text); 336var name = (NameSyntax)tname; 350var name = (NameSyntax)tname; 364var name = (NameSyntax)tname; 381var name = (NameSyntax)tname; 442var name = (NameSyntax)tname; 492var name = (NameSyntax)((NullableTypeSyntax)tname).ElementType; 507var name = (NameSyntax)((PointerTypeSyntax)tname).ElementType; 533var name = (NameSyntax)tname; 555var name = (NameSyntax)array.ElementType; 577var name = (NameSyntax)array.ElementType; 608var name = (NameSyntax)array.ElementType; 618var tname = ParseName(text); 643var tname = ParseName(text); 669var tname = ParseName(text); 695var tname = ParseName(text); 727var tname = ParseName(text); 752var tname = ParseName(text);
Syntax\SyntaxFactoryTests.cs (1)
33var someValidName = SyntaxFactory.ParseName("System.String");
Syntax\SyntaxNodeTests.cs (1)
3660NameSyntax name = SyntaxFactory.QualifiedName(SyntaxFactory.IdentifierName("System"), SyntaxFactory.IdentifierName("Collections.Generic"));
Microsoft.CodeAnalysis.CSharp.Workspaces (86)
CodeGeneration\CSharpSyntaxGenerator.cs (7)
121if (node is NameSyntax name) 156=> SyntaxFactory.UsingDirective((NameSyntax)name); 159=> SyntaxFactory.UsingDirective(SyntaxFactory.NameEquals(aliasIdentifierName), (NameSyntax)name); 164(NameSyntax)name, 606return WithInterfaceSpecifier(d, SyntaxFactory.ExplicitInterfaceSpecifier((NameSyntax)interfaceTypeName)); 947=> AsAttributeList(SyntaxFactory.Attribute((NameSyntax)name, AsAttributeArgumentList(attributeArguments))); 3404=> SyntaxFactory.QualifiedName((NameSyntax)left, (SimpleNameSyntax)right).WithAdditionalAnnotations(Simplifier.Annotation);
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (4)
36NameSyntax, 476protected override NameSyntax GetName(BaseNamespaceDeclarationSyntax node) 479protected override NameSyntax GetLeft(QualifiedNameSyntax node) 482protected override NameSyntax GetRight(QualifiedNameSyntax node)
Recommendations\CSharpRecommendationServiceRunner.cs (1)
527private RecommendedSymbols GetSymbolsOffOfName(NameSyntax name)
Rename\CSharpRenameRewriterLanguageService.cs (2)
603var parsedIdentifier = SyntaxFactory.ParseName(currentNewIdentifier); 1125var name = SyntaxFactory.ParseName(replacementText);
Simplification\CSharpSimplificationService.Expander.cs (3)
959(NameSyntax)left, 979result = rewrittenNode.CopyAnnotationsTo(QualifiedName((NameSyntax)left, right.WithAdditionalAnnotations(Simplifier.SpecialTypeAnnotation))); 984result = rewrittenNode.CopyAnnotationsTo(QualifiedName((NameSyntax)left, right));
Simplification\Simplifiers\ExpressionSimplifier.cs (2)
80if (expression is NameSyntax name) 303replacementNode = qualifiedName.Update((NameSyntax)newLeft, qualifiedName.DotToken, qualifiedName.Right)
Simplification\Simplifiers\NameSimplifier.cs (19)
25internal class NameSimplifier : AbstractCSharpSimplifier<NameSyntax, TypeSyntax> 34NameSyntax name, 62var left = qualifiedName.Left; 370NameSyntax name, TypeSyntax replacement, 387replacement is NameSyntax replacementName) 401private static bool CanSimplifyNullable(INamedTypeSymbol type, NameSyntax name, SemanticModel semanticModel) 459NameSyntax name, 485NameSyntax name, 580NameSyntax name, TypeSyntax reducedName, SemanticModel semanticModel) 599private static bool ContainsOpenName(NameSyntax name) 615private static bool CanReplaceWithReducedName(NameSyntax name, TypeSyntax reducedName, SemanticModel semanticModel, CancellationToken cancellationToken) 626private static bool IsNotNullableReplaceable(NameSyntax name, TypeSyntax reducedName) 655!(simplifiedNode is NameSyntax); 678private static bool IsNonReducableQualifiedNameInUsingDirective(SemanticModel model, NameSyntax name) 686private static bool IsQualifiedNameInUsingDirective(SemanticModel model, NameSyntax name) 690name = (NameSyntax)name.Parent; 708private static bool IsGlobalAliasQualifiedName(NameSyntax name) 715private static bool IsInScriptClass(SemanticModel model, NameSyntax name) 731private static bool PreferPredefinedTypeKeywordInDeclarations(NameSyntax name, CSharpSimplifierOptions options, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
109public static bool IsLeftSideOfExplicitInterfaceSpecifier([NotNullWhen(true)] this NameSyntax? name)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (2)
517if (castExpression.Type is NameSyntax name && StartsWithAlias(name)) 537private static bool StartsWithAlias(NameSyntax name)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
239var name = SyntaxFactory.ParseName(syntaxTree.GetText(cancellationToken).ToString(TextSpan.FromBounds(genericIdentifier.SpanStart, lastToken.Span.End)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (3)
1050if (parent is not NameSyntax) 1163=> (node as NameSyntax).IsLeftSideOfExplicitInterfaceSpecifier(); 1570=> node is NameSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\NameSyntaxComparer.cs (9)
10internal class NameSyntaxComparer : IComparer<NameSyntax?> 21public static IComparer<NameSyntax?> Create() 24public static IComparer<NameSyntax?> Create(IComparer<SyntaxToken> tokenComparer) 27public int Compare(NameSyntax? x, NameSyntax? y) 53int DecomposeCompare(NameSyntax x, NameSyntax y) 75private static IList<SimpleNameSyntax> DecomposeNameParts(NameSyntax name) 82private static void DecomposeNameParts(NameSyntax name, List<SimpleNameSyntax> result)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeSyntaxComparer.cs (6)
13internal readonly IComparer<NameSyntax?> NameComparer; 15internal TypeSyntaxComparer(IComparer<SyntaxToken> tokenComparer, IComparer<NameSyntax?> nameComparer) 36if (x is NameSyntax && y is NameSyntax) 38return NameComparer.Compare((NameSyntax)x, (NameSyntax)y);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesDirectiveComparer.cs (2)
22private readonly IComparer<NameSyntax> _nameComparer; 26IComparer<NameSyntax> nameComparer,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
76return attribute.AttributeClass.GenerateTypeSyntax() is NameSyntax nameSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
218if (implementation.ContainingType.GenerateTypeSyntax() is not NameSyntax name)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamespaceGenerator.cs (3)
154var name = GenerateName(alias.Target); 164var name = GenerateName(namespaceOrType); 174private static NameSyntax GenerateName(INamespaceOrTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
988if (nameToken.Parent is not NameSyntax name)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (2)
30public static NameSyntax GenerateNameSyntax(this INamespaceOrTypeSymbol symbol, bool allowVar = true) 31=> (NameSyntax)GenerateTypeSyntax(symbol, nameSyntax: true, allowVar: allowVar);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (3)
278if (containingTypeSyntax is NameSyntax name) 303(NameSyntax)container, 334(NameSyntax)container,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\NameSyntaxExtensions.cs (6)
16public static IList<NameSyntax> GetNameParts(this NameSyntax nameSyntax) 19public static NameSyntax GetLastDottedName(this NameSyntax nameSyntax) 25public static SyntaxToken GetNameToken(this NameSyntax nameSyntax) 52public static bool CanBeReplacedWithAnyName(this NameSyntax nameSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeSyntaxExtensions.cs (1)
37if (typeSyntax is not NameSyntax nameSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NameSyntaxIterator.cs (6)
13internal class NameSyntaxIterator : IEnumerable<NameSyntax> 15private readonly NameSyntax _name; 17public NameSyntaxIterator(NameSyntax name) 20public IEnumerator<NameSyntax> GetEnumerator() 22var nodes = new LinkedList<NameSyntax>(); 24var currentNode = _name;
Microsoft.Extensions.Logging.Generators (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
178public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name)
Microsoft.Extensions.Options.SourceGeneration (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
178public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name)
Microsoft.Gen.Logging (1)
src\Generators\Shared\RoslynExtensions.cs (1)
133public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name)
Microsoft.Gen.Metrics (1)
src\Generators\Shared\RoslynExtensions.cs (1)
133public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name)
Microsoft.Interop.ComInterfaceGenerator (4)
AttributeInfo.cs (1)
19return Attribute((NameSyntax)Type.Syntax, AttributeArgumentList(SeparatedList(Arguments.Select(arg => AttributeArgument(ParseExpression(arg))))));
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
178public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name)
VirtualMethodPointerStubGenerator.cs (2)
86Debug.Assert(methodStub.TypeKeyOwner.Syntax is NameSyntax); 93.WithExplicitInterfaceSpecifier(ExplicitInterfaceSpecifier((NameSyntax)methodStub.TypeKeyOwner.Syntax)),
Microsoft.Interop.LibraryImportGenerator (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
178public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name)
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
178public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name)
Microsoft.Interop.SourceGeneration (23)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
178public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name)
TypeNames.cs (22)
13private static NameSyntax? _DllImportAttribute; 14public static NameSyntax DllImportAttribute => _DllImportAttribute ??= ParseName(TypeNames.GlobalAlias + TypeNames.DllImportAttribute); 16private static NameSyntax? _LibraryImportAttribute; 17public static NameSyntax LibraryImportAttribute => _LibraryImportAttribute ??= ParseName(TypeNames.GlobalAlias + TypeNames.LibraryImportAttribute); 19private static NameSyntax? _System_Runtime_InteropServices_DynamicInterfaceCastableImplementationAttribute; 20public static NameSyntax System_Runtime_InteropServices_DynamicInterfaceCastableImplementationAttribute => _System_Runtime_InteropServices_DynamicInterfaceCastableImplementationAttribute ??= ParseName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_DynamicInterfaceCastableImplementationAttribute); 22private static NameSyntax? _System_Runtime_InteropServices_MarshalAsAttribute; 23public static NameSyntax System_Runtime_InteropServices_MarshalAsAttribute => _System_Runtime_InteropServices_MarshalAsAttribute ??= ParseName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_MarshalAsAttribute); 25private static NameSyntax? _DefaultDllImportSearchPathsAttribute; 26public static NameSyntax DefaultDllImportSearchPathsAttribute => _DefaultDllImportSearchPathsAttribute ??= ParseName(TypeNames.GlobalAlias + TypeNames.DefaultDllImportSearchPathsAttribute); 28private static NameSyntax? _SuppressGCTransitionAttribute; 29public static NameSyntax SuppressGCTransitionAttribute => _SuppressGCTransitionAttribute ??= ParseName(TypeNames.GlobalAlias + TypeNames.SuppressGCTransitionAttribute); 31private static NameSyntax? _UnmanagedCallConvAttribute; 32public static NameSyntax UnmanagedCallConvAttribute => _UnmanagedCallConvAttribute ??= ParseName(TypeNames.GlobalAlias + TypeNames.UnmanagedCallConvAttribute); 34private static NameSyntax? _System_Runtime_CompilerServices_SkipLocalsInitAttribute; 35public static NameSyntax System_Runtime_CompilerServices_SkipLocalsInitAttribute => _System_Runtime_CompilerServices_SkipLocalsInitAttribute ??= ParseName(TypeNames.GlobalAlias + TypeNames.System_Runtime_CompilerServices_SkipLocalsInitAttribute); 37private static NameSyntax? _System_CodeDom_Compiler_GeneratedCodeAttribute; 38public static NameSyntax System_CodeDom_Compiler_GeneratedCodeAttribute => _System_CodeDom_Compiler_GeneratedCodeAttribute ??= ParseName(TypeNames.GlobalAlias + TypeNames.System_CodeDom_Compiler_GeneratedCodeAttribute); 40private static NameSyntax? _UnmanagedCallersOnlyAttribute; 41public static NameSyntax UnmanagedCallersOnlyAttribute => _UnmanagedCallersOnlyAttribute ??= ParseName(TypeNames.GlobalAlias + TypeNames.UnmanagedCallersOnlyAttribute); 43private static NameSyntax? _WasmImportLinkageAttribute; 44public static NameSyntax WasmImportLinkageAttribute => _WasmImportLinkageAttribute ??= ParseName(TypeNames.GlobalAlias + TypeNames.WasmImportLinkageAttribute);
Microsoft.ML.InternalCodeAnalyzer (1)
NameAnalyzer.cs (1)
114var name = node.Name;
Microsoft.VisualStudio.LanguageServices.CSharp (9)
CodeModel\CSharpCodeModelService.CodeModelEventCollector.cs (6)
716private bool CompareNames(NameSyntax oldName, NameSyntax newName) 818var oldName = (NameSyntax)oldType; 819var newName = (NameSyntax)newType;
CodeModel\CSharpCodeModelService.cs (1)
1794var nameSyntax = SyntaxFactory.ParseName(name);
CodeModel\CSharpCodeModelService.NodeNameGenerator.cs (2)
26private static void AppendName(StringBuilder builder, NameSyntax name) 62if (type is NameSyntax name)
System.Text.Json.SourceGeneration (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
178public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name)
System.Text.RegularExpressions.Generator (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
178public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name)