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
302 references to NameSyntax
Microsoft.CodeAnalysis.CSharp (44)
Binder\Binder_Expressions.cs (4)
2712private static NameSyntax GetNameSyntax(SyntaxNode syntax) 2725internal static NameSyntax GetNameSyntax(SyntaxNode syntax, out string nameString) 2750return syntax as NameSyntax; 2763var nameSyntax = GetNameSyntax(syntax, out nameString);
Binder\Binder_Symbols.cs (5)
1063private static LookupOptions GetSimpleNameLookupOptions(NameSyntax node, bool isVerbatimIdentifier) 2025(where as NameSyntax)?.ErrorDisplayName() ?? simpleName, 2164new object[] { (where as NameSyntax)?.ErrorDisplayName() ?? simpleName, first, second }); 2171(where as NameSyntax)?.ErrorDisplayName() ?? simpleName, 2270CSDiagnosticInfo info = NotFound(where, simpleName, arity, (where as NameSyntax)?.ErrorDisplayName() ?? simpleName, diagnostics, aliasOpt, qualifierOpt, options);
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
871private static Binder MakeNamespaceBinder(CSharpSyntaxNode node, NameSyntax name, Binder outer, bool inUsing)
Binder\WithExternAndUsingAliasesBinder.cs (1)
213var name = namespaceDecl.Name;
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)
1726private Symbol GetDeclaredMember(NamespaceOrTypeSymbol container, TextSpan declarationSpan, NameSyntax name)
CSharpDeclarationComputer.cs (1)
89NameSyntax name = ns.Name;
Declarations\DeclarationTreeBuilder.cs (4)
295if (directive.Name is not NameSyntax name) 421NameSyntax name = node.Name; 540private static bool ContainsAlias(NameSyntax name) 556private static bool ContainsGeneric(NameSyntax name)
FlowAnalysis\NullableWalker.cs (1)
6093var nameSyntax = Binder.GetNameSyntax(syntax, out _);
SourceGeneration\CSharpSyntaxHelper.cs (1)
64=> ((NameSyntax)node).GetUnqualifiedName().Identifier.ValueText;
Symbols\AliasSymbol.cs (1)
384else if (usingDirective.NamespaceOrType is not NameSyntax)
Symbols\NamespaceSymbol.cs (1)
297internal NamespaceSymbol GetNestedNamespace(NameSyntax name)
Symbols\Source\ExplicitInterfaceHelpers.cs (3)
53NameSyntax explicitInterfaceName = explicitInterfaceSpecifierOpt.Name; 206var explicitInterfaceSyntax = explicitInterfaceSpecifierSyntax.Name; 222var explicitInterfaceSyntax = explicitInterfaceSpecifierSyntax.Name;
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (1)
815NameSyntax 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 (6)
1678public static NameSyntax ParseName(string text, int offset = 0, bool consumeFullText = true) 1685return (NameSyntax)node.CreateRed(); 2646public static UsingDirectiveSyntax UsingDirective(NameEqualsSyntax alias, NameSyntax name) 2656public static UsingDirectiveSyntax UsingDirective(SyntaxToken usingKeyword, SyntaxToken staticKeyword, NameEqualsSyntax? alias, NameSyntax name, SyntaxToken semicolonToken) 2688public static NamespaceDeclarationSyntax NamespaceDeclaration(NameSyntax name, SyntaxList<ExternAliasDirectiveSyntax> externs, SyntaxList<UsingDirectiveSyntax> usings, SyntaxList<MemberDeclarationSyntax> members) 2692public 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 (22)
CSharpSyntaxFacts.cs (2)
1039if (parent is not NameSyntax) 1154=> (node as NameSyntax).IsLeftSideOfExplicitInterfaceSpecifier();
ExpressionSyntaxExtensions.cs (1)
99public static bool IsLeftSideOfExplicitInterfaceSpecifier([NotNullWhen(true)] this NameSyntax? name)
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)
ParenthesizedExpressionSyntaxExtensions.cs (2)
507if (castExpression.Type is NameSyntax name && StartsWithAlias(name)) 527private static bool StartsWithAlias(NameSyntax name)
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);
UsingsAndExternAliasesDirectiveComparer.cs (2)
22private readonly IComparer<NameSyntax> _nameComparer; 26IComparer<NameSyntax> nameComparer,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (25)
AttributeGenerator.cs (1)
80return attribute.AttributeClass.GenerateTypeSyntax() is NameSyntax nameSyntax
CSharpCodeGenerationHelpers.cs (1)
215if (implementation.ContainingType.GenerateTypeSyntax() is not NameSyntax name)
ITypeSymbolExtensions.cs (2)
29public static NameSyntax GenerateNameSyntax(this INamespaceOrTypeSymbol symbol, bool allowVar = true) 30=> (NameSyntax)GenerateTypeSyntax(symbol, nameSyntax: true, allowVar: allowVar);
ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (3)
273if (containingTypeSyntax is NameSyntax name) 298(NameSyntax)container, 329(NameSyntax)container,
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
988if (nameToken.Parent is not NameSyntax name)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (1)
22var name = SyntaxFactory.ParseName(syntaxTree.GetText(cancellationToken).ToString(TextSpan.FromBounds(genericIdentifier.SpanStart, lastToken.Span.End)));
NamespaceGenerator.cs (3)
153var name = GenerateName(alias.Target); 163var name = GenerateName(namespaceOrType); 173private static NameSyntax GenerateName(INamespaceOrTypeSymbol symbol)
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)
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;
TypeSyntaxExtensions.cs (1)
37if (typeSyntax is not NameSyntax nameSyntax)
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (6)
CompilationContext.cs (1)
1216if (!SyntaxHelpers.TryParseDottedName(name, out var nameSyntax) || nameSyntax.Kind() != SyntaxKind.IdentifierName)
SyntaxHelpers.cs (5)
246internal static bool TryParseDottedName(string input, [NotNullWhen(true)] out NameSyntax? output) 273? (NameSyntax)identifierName 296? (NameSyntax)finalIdentifierName 307internal static NameSyntax PrependExternAlias(IdentifierNameSyntax externAliasSyntax, NameSyntax nameSyntax)
Microsoft.CodeAnalysis.CSharp.Features (32)
AddImport\CSharpAddImportFeatureService.cs (7)
220var left = qn.Left; 406private NameSyntax CreateNameSyntax(IReadOnlyList<string> namespaceParts, int index) 447var nameSyntax = namespaceOrTypeSymbol.GenerateNameSyntax(); 494private static NameSyntax RemoveGlobalAliasIfUnnecessary( 496NameSyntax nameSyntax, 540private NameSyntax AddOrReplaceAlias( 541NameSyntax nameSyntax, IdentifierNameSyntax alias)
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (3)
110var attributeName = suppressMessageAttribute.GenerateNameSyntax() 143var attributeName = suppressMessageAttribute.GenerateNameSyntax(); 151NameSyntax attributeName,
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (2)
141var qualifiedNamespaceName = CreateNamespaceAsQualifiedName(newNamespaceParts, aliasQualifier, newNamespaceParts.Length - 1); 411private static NameSyntax CreateNamespaceAsQualifiedName(ImmutableArray<string> namespaceParts, string? aliasQualifier, int index)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (1)
71var name = specifierNode.Name;
ConvertAnonymousType\CSharpConvertAnonymousTypeToClassCodeRefactoringProvider.cs (2)
20NameSyntax, 33NameSyntax nameNode, AnonymousObjectCreationExpressionSyntax anonymousObject)
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
89private static void AddUsingDirectives(NameSyntax name, SyntaxAnnotation annotation, ArrayBuilder<UsingDirectiveSyntax> directives)
ConvertTupleToStruct\CSharpConvertTupleToStructCodeRefactoringProvider.cs (1)
19NameSyntax,
CSharpDeclarationComputer.cs (1)
89NameSyntax name = ns.Name;
Debugging\BreakpointResolver.cs (1)
55var name = SyntaxFactory.ParseName(text, consumeFullText: false);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs (1)
71if (expression is NameSyntax)
GenerateConstructor\CSharpGenerateConstructorService.cs (4)
90var fullName = simpleName.IsRightSideOfQualifiedName() 91? (NameSyntax)simpleName.Parent 122var fullName = simpleName.IsRightSideOfQualifiedName() 123? (NameSyntax)simpleName.Parent
GenerateType\CSharpGenerateTypeService.cs (1)
644private void GetNamespaceContainers(NameSyntax name, List<string> namespaceContainers)
IntroduceVariable\CSharpIntroduceVariableService.cs (1)
23AbstractIntroduceVariableService<CSharpIntroduceVariableService, ExpressionSyntax, TypeSyntax, TypeDeclarationSyntax, QueryExpressionSyntax, NameSyntax>
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (2)
219NameSyntax newLocalName, 287NameSyntax newLocalName,
IntroduceVariable\CSharpIntroduceVariableService_IntroduceQueryLocal.cs (1)
79NameSyntax newLocalName,
QuickInfo\CSharpDiagnosticAnalyzerQuickInfoProviderExtensions.cs (1)
25public static bool IsSuppressMessageAttribute(this NameSyntax? name)
Wrapping\ChainedExpression\CSharpChainedExpressionWrapper.cs (1)
15AbstractChainedExpressionWrapper<NameSyntax, BaseArgumentListSyntax>
Wrapping\SeparatedSyntaxList\CSharpArgumentWrapper.cs (1)
114if (expr is NameSyntax name)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
Semantics\BindingTests.cs (1)
3476var node2 = ((QualifiedNameSyntax)node1).Left;
Semantics\LambdaTests.cs (2)
1082var oReference = 1086.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 (48)
Parsing\ExpressionParsingTests.cs (1)
3030Assert.Equal(1, ((NameSyntax)objectCreation.Type).Arity);
Parsing\NameParsingTests.cs (46)
21private NameSyntax ParseName(string text) 35var name = ParseName(text); 48var name = ParseName(text); 61var name = ParseName(text); 75var name = ParseName(text); 90var name = ParseName(text); 105var name = ParseName(text); 120var name = ParseName(text); 133var name = ParseName(text); 148var name = ParseName(text); 161var name = ParseName(text); 190var name = ParseName(text); 208var name = ParseName(text); 224var name = ParseName(text); 240var name = ParseName(text); 258var name = ParseName(text); 300var name = ParseName(text); 317var name = ParseName(text); 338var name = (NameSyntax)tname; 352var name = (NameSyntax)tname; 366var name = (NameSyntax)tname; 383var name = (NameSyntax)tname; 444var name = (NameSyntax)tname; 494var name = (NameSyntax)((NullableTypeSyntax)tname).ElementType; 509var name = (NameSyntax)((PointerTypeSyntax)tname).ElementType; 535var name = (NameSyntax)tname; 557var name = (NameSyntax)array.ElementType; 579var name = (NameSyntax)array.ElementType; 610var name = (NameSyntax)array.ElementType; 620var tname = ParseName(text); 645var tname = ParseName(text); 671var tname = ParseName(text); 697var tname = ParseName(text); 729var tname = ParseName(text); 754var tname = ParseName(text);
Syntax\SyntaxNodeTests.cs (1)
3588NameSyntax name = SyntaxFactory.QualifiedName(SyntaxFactory.IdentifierName("System"), SyntaxFactory.IdentifierName("Collections.Generic"));
Microsoft.CodeAnalysis.CSharp.Workspaces (97)
AttributeGenerator.cs (1)
80return attribute.AttributeClass.GenerateTypeSyntax() is NameSyntax nameSyntax
Classification\SyntaxClassification\NameSyntaxClassifier.cs (11)
29if (syntax is NameSyntax name) 35public override ImmutableArray<Type> SyntaxNodeTypes { get; } = ImmutableArray.Create(typeof(NameSyntax)); 51NameSyntax name, 67NameSyntax name, 100NameSyntax name, 136NameSyntax name, 301private static bool IsInVarContext(NameSyntax name) 313NameSyntax name, 335NameSyntax name, 350NameSyntax name, SymbolInfo symbolInfo, ArrayBuilder<ClassifiedSpan> result) 363private static bool TryClassifyAsyncIdentifier(NameSyntax name, SymbolInfo symbolInfo, ArrayBuilder<ClassifiedSpan> result)
CodeGeneration\CSharpSyntaxGenerator.cs (7)
125if (node is NameSyntax name) 160=> SyntaxFactory.UsingDirective((NameSyntax)name); 163=> SyntaxFactory.UsingDirective(SyntaxFactory.NameEquals(aliasIdentifierName), (NameSyntax)name); 168(NameSyntax)name, 588return WithInterfaceSpecifier(d, SyntaxFactory.ExplicitInterfaceSpecifier((NameSyntax)interfaceTypeName)); 913=> AsAttributeList(SyntaxFactory.Attribute((NameSyntax)name, AsAttributeArgumentList(attributeArguments))); 3422=> SyntaxFactory.QualifiedName((NameSyntax)left, (SimpleNameSyntax)right).WithAdditionalAnnotations(Simplifier.Annotation);
CSharpCodeGenerationHelpers.cs (1)
215if (implementation.ContainingType.GenerateTypeSyntax() is not NameSyntax name)
CSharpSyntaxFacts.cs (2)
1039if (parent is not NameSyntax) 1154=> (node as NameSyntax).IsLeftSideOfExplicitInterfaceSpecifier();
Editing\CSharpImportAdder.cs (1)
188private void CheckName(NameSyntax node)
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (4)
37NameSyntax, 477protected override NameSyntax GetName(BaseNamespaceDeclarationSyntax node) 480protected override NameSyntax GetLeft(QualifiedNameSyntax node) 483protected override NameSyntax GetRight(QualifiedNameSyntax node)
ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (3)
273if (containingTypeSyntax is NameSyntax name) 298(NameSyntax)container, 329(NameSyntax)container,
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs\ExpressionSyntaxExtensions.cs (1)
99public static bool IsLeftSideOfExplicitInterfaceSpecifier([NotNullWhen(true)] this NameSyntax? name)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
988if (nameToken.Parent is not NameSyntax name)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs\ITypeSymbolExtensions.cs (2)
29public static NameSyntax GenerateNameSyntax(this INamespaceOrTypeSymbol symbol, bool allowVar = true) 30=> (NameSyntax)GenerateTypeSyntax(symbol, nameSyntax: true, allowVar: allowVar);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (1)
22var name = SyntaxFactory.ParseName(syntaxTree.GetText(cancellationToken).ToString(TextSpan.FromBounds(genericIdentifier.SpanStart, lastToken.Span.End)));
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeSyntaxExtensions.cs\TypeSyntaxExtensions.cs (1)
37if (typeSyntax is not NameSyntax nameSyntax)
NamespaceGenerator.cs (3)
153var name = GenerateName(alias.Target); 163var name = GenerateName(namespaceOrType); 173private static NameSyntax GenerateName(INamespaceOrTypeSymbol symbol)
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)
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)
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;
ParenthesizedExpressionSyntaxExtensions.cs (2)
507if (castExpression.Type is NameSyntax name && StartsWithAlias(name)) 527private static bool StartsWithAlias(NameSyntax name)
Recommendations\CSharpRecommendationServiceRunner.cs (1)
312private RecommendedSymbols GetSymbolsOffOfName(NameSyntax name)
Rename\CSharpRenameRewriterLanguageService.cs (2)
611var parsedIdentifier = SyntaxFactory.ParseName(currentNewIdentifier); 1133var name = SyntaxFactory.ParseName(replacementText);
Simplification\CSharpSimplificationService.Expander.cs (3)
958(NameSyntax)left, 978result = rewrittenNode.CopyAnnotationsTo(SyntaxFactory.QualifiedName((NameSyntax)left, right.WithAdditionalAnnotations(Simplifier.SpecialTypeAnnotation))); 983result = rewrittenNode.CopyAnnotationsTo(SyntaxFactory.QualifiedName((NameSyntax)left, right));
Simplification\Simplifiers\ExpressionSimplifier.cs (2)
83if (expression is NameSyntax name) 301replacementNode = 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; 360NameSyntax name, TypeSyntax replacement, 377replacement is NameSyntax replacementName) 391private static bool CanSimplifyNullable(INamedTypeSymbol type, NameSyntax name, SemanticModel semanticModel) 449NameSyntax name, 475NameSyntax name, 560NameSyntax name, TypeSyntax reducedName, SemanticModel semanticModel) 579private static bool ContainsOpenName(NameSyntax name) 595private static bool CanReplaceWithReducedName(NameSyntax name, TypeSyntax reducedName, SemanticModel semanticModel, CancellationToken cancellationToken) 606private static bool IsNotNullableReplaceable(NameSyntax name, TypeSyntax reducedName) 635!(simplifiedNode is NameSyntax); 658private static bool IsNonReducableQualifiedNameInUsingDirective(SemanticModel model, NameSyntax name) 666private static bool IsQualifiedNameInUsingDirective(SemanticModel model, NameSyntax name) 670name = (NameSyntax)name.Parent; 688private static bool IsGlobalAliasQualifiedName(NameSyntax name) 695private static bool IsInScriptClass(SemanticModel model, NameSyntax name) 711private static bool PreferPredefinedTypeKeywordInDeclarations(NameSyntax name, CSharpSimplifierOptions options, SemanticModel semanticModel)
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);
UsingsAndExternAliasesDirectiveComparer.cs (2)
22private readonly IComparer<NameSyntax> _nameComparer; 26IComparer<NameSyntax> nameComparer,
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
SerializationTests.cs (1)
68var name = CS.SyntaxFactory.ParseName(symbolName);
Microsoft.VisualStudio.LanguageServices.CSharp (9)
CodeModel\CSharpCodeModelService.CodeModelEventCollector.cs (6)
717private bool CompareNames(NameSyntax oldName, NameSyntax newName) 819var oldName = (NameSyntax)oldType; 820var newName = (NameSyntax)newType;
CodeModel\CSharpCodeModelService.cs (1)
1798var nameSyntax = SyntaxFactory.ParseName(name);
CodeModel\CSharpCodeModelService.NodeNameGenerator.cs (2)
27private static void AppendName(StringBuilder builder, NameSyntax name) 63if (type is NameSyntax name)