382 references to SimpleNameSyntax
ConfigurationSchemaGenerator (2)
RuntimeSource\Roslyn\GetBestTypeByMetadataName.cs (2)
178public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name) 183SimpleNameSyntax simple => simple,
ILLink.RoslynAnalyzer (2)
CompilationExtensions.cs (2)
157 public static SimpleNameSyntax GetUnqualifiedName (this NameSyntax name) 161 SimpleNameSyntax simple => simple,
Microsoft.Analyzers.Extra (1)
Utilities\SyntaxNodeExtensions.cs (1)
79public static SimpleNameSyntax? GetExpressionName(this InvocationExpressionSyntax invocationExpression)
Microsoft.AspNetCore.App.Analyzers (2)
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (2)
280var methodName = operation.Syntax 282.OfType<SimpleNameSyntax>()
Microsoft.AspNetCore.App.CodeFixes (2)
WebApplicationBuilderFixer.cs (2)
138var method = bodyExpression.Name; // method_name 159var method = bodyExpression.Name;
Microsoft.CodeAnalysis.CSharp (60)
Binder\Binder.WithQueryLambdaParametersBinder.cs (2)
37protected override BoundExpression BindRangeVariable(SimpleNameSyntax node, RangeVariableSymbol qv, BindingDiagnosticBag diagnostics) 72private BoundExpression SelectField(SimpleNameSyntax node, BoundExpression receiver, string name, BindingDiagnosticBag diagnostics)
Binder\Binder_Crefs.cs (2)
144SimpleNameSyntax? nameSyntax = syntax.Name as SimpleNameSyntax;
Binder\Binder_Expressions.cs (14)
621return BindIdentifier((SimpleNameSyntax)node, invoked, indexed, diagnostics); 1545SimpleNameSyntax node, 1700void adjustIdentifierMapIfAny(SimpleNameSyntax node, bool invoked) 1728void reportPrimaryConstructorParameterShadowing(SimpleNameSyntax node, Symbol symbol, string name, bool invoked, LookupResult lookupResult, ArrayBuilder<Symbol> members, BindingDiagnosticBag diagnostics) 1789private void LookupIdentifier(LookupResult lookupResult, SimpleNameSyntax node, bool invoked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1831private static bool IsOutVarDiscardIdentifier(SimpleNameSyntax node) 1950private BoundExpression BindNonMethod(SimpleNameSyntax node, Symbol symbol, BindingDiagnosticBag diagnostics, LookupResultKind resultKind, bool indexed, bool isError) 2204bool isUsedBeforeDeclaration(SimpleNameSyntax node, LocalSymbol localSymbol) 2228private bool ReportSimpleProgramLocalReferencedOutsideOfTopLevelStatement(SimpleNameSyntax node, Symbol symbol, BindingDiagnosticBag diagnostics) 2240protected virtual BoundExpression BindRangeVariable(SimpleNameSyntax node, RangeVariableSymbol qv, BindingDiagnosticBag diagnostics) 7531SimpleNameSyntax right, 7602SimpleNameSyntax right, 7753SimpleNameSyntax right, 7824SimpleNameSyntax right,
Binder\Binder_Invocation.cs (1)
30return BindIdentifier((SimpleNameSyntax)node, invoked, indexed, diagnostics);
Binder\Binder_QueryErrors.cs (2)
134private static bool IsJoinRangeVariableInLeftKey(SimpleNameSyntax node) 148private static bool IsInJoinRightKey(SimpleNameSyntax node)
Binder\Binder_Symbols.cs (3)
399/// <see cref="BindQualifiedName(ExpressionSyntax, SimpleNameSyntax, BindingDiagnosticBag, ConsList{TypeSymbol}, bool)"/> 818SimpleNameSyntax syntax, 1603SimpleNameSyntax rightName,
BoundTree\BoundExpression.cs (1)
16public SimpleNameSyntax? InterceptableNameSyntax
Compilation\CSharpCompilation.cs (1)
2479internal (Location AttributeLocation, MethodSymbol Interceptor)? TryGetInterceptor(SimpleNameSyntax? node)
Compilation\SyntaxTreeSemanticModel.cs (1)
1726return (NamespaceSymbol)GetDeclaredMember(container, declarationSpan, isKnownToBeANamespace: true, ((SimpleNameSyntax)name).Identifier.ValueText);
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
142Syntax.SimpleNameSyntax? nameSyntax)
Parser\DocumentationCommentParser.cs (4)
960SimpleNameSyntax name = ParseCrefName(typeArgumentsMustBeIdentifiers: true); 1284private SimpleNameSyntax ParseCrefName(bool typeArgumentsMustBeIdentifiers) 1393SimpleNameSyntax name = ParseCrefName(typeArgumentsMustBeIdentifiers); 1420SimpleNameSyntax rightName = ParseCrefName(typeArgumentsMustBeIdentifiers);
Parser\LanguageParser.cs (4)
5855private SimpleNameSyntax ParseSimpleName(NameOptions options = NameOptions.None) 5866SimpleNameSyntax name = id; 6703var name = this.ParseSimpleName(allowedParts); 6734var right = this.ParseSimpleName(options);
Parser\LanguageParser_Patterns.cs (2)
37case SimpleNameSyntax s: 461case SimpleNameSyntax s:
Symbols\NamespaceSymbol.cs (1)
289return this.GetNestedNamespace(((SimpleNameSyntax)name).Identifier.ValueText);
Symbols\Source\SourceMethodSymbolWithAttributes.cs (10)
1087case { Parent: SimpleNameSyntax { Parent: MemberAccessExpressionSyntax { Parent: InvocationExpressionSyntax } memberAccess } rhs } when memberAccess.Name == rhs: 1088case { Parent: SimpleNameSyntax { Parent: MemberBindingExpressionSyntax { Parent: InvocationExpressionSyntax } memberBinding } rhs1 } when memberBinding.Name == rhs1: 1089case { Parent: SimpleNameSyntax { Parent: InvocationExpressionSyntax invocation } simpleName } when invocation.Expression == simpleName: 1092case { Parent: SimpleNameSyntax { Parent: not (MemberAccessExpressionSyntax or MemberBindingExpressionSyntax) } }: 1093case { Parent: SimpleNameSyntax { Parent: MemberAccessExpressionSyntax memberAccess } rhs } when memberAccess.Name == rhs: 1094case { Parent: SimpleNameSyntax { Parent: MemberBindingExpressionSyntax memberBinding } rhs1 } when memberBinding.Name == rhs1: 1301case { Parent: SimpleNameSyntax { Parent: MemberAccessExpressionSyntax { Parent: InvocationExpressionSyntax } memberAccess } rhs } when memberAccess.Name == rhs: 1302case { Parent: SimpleNameSyntax { Parent: InvocationExpressionSyntax invocation } simpleName } when invocation.Expression == simpleName: 1305case { Parent: SimpleNameSyntax { Parent: not MemberAccessExpressionSyntax } }: 1306case { Parent: SimpleNameSyntax { Parent: MemberAccessExpressionSyntax memberAccess } rhs } when memberAccess.Name == rhs:
Syntax\AliasedQualifiedNameSyntax.cs (1)
12internal override SimpleNameSyntax GetUnqualifiedName()
Syntax\NameSyntax.cs (2)
27/// If called on an instance of <see cref="SimpleNameSyntax"/> returns the instance itself. 29internal abstract SimpleNameSyntax GetUnqualifiedName();
Syntax\QualifiedNameSyntax.cs (1)
17internal override SimpleNameSyntax GetUnqualifiedName()
Syntax\SimpleNameSyntax.cs (1)
17internal sealed override SimpleNameSyntax GetUnqualifiedName()
Syntax\SyntaxExtensions.cs (4)
189public static SimpleNameSyntax WithIdentifier(this SimpleNameSyntax simpleName, SyntaxToken identifier) 192? (SimpleNameSyntax)((IdentifierNameSyntax)simpleName).WithIdentifier(identifier) 193: (SimpleNameSyntax)((GenericNameSyntax)simpleName).WithIdentifier(identifier);
Syntax\SyntaxNodeExtensions.cs (2)
365internal static SimpleNameSyntax? GetInterceptableNameSyntax(this InvocationExpressionSyntax invocation) 376SimpleNameSyntax name => name,
Microsoft.CodeAnalysis.CSharp.CodeStyle (24)
src\Analyzers\CSharp\Analyzers\QualifyMemberAccess\CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (1)
18: AbstractQualifyMemberAccessDiagnosticAnalyzer<SyntaxKind, ExpressionSyntax, SimpleNameSyntax>
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
89if (invokedExpression is not SimpleNameSyntax and not MemberAccessExpressionSyntax)
src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastDiagnosticAnalyzer.cs (1)
93[NotNullWhen(true)] out SimpleNameSyntax? caseOrSelectName,
src\Analyzers\CSharp\Analyzers\SimplifyPropertyPattern\SimplifyPropertyPatternHelpers.cs (1)
52if (expression is SimpleNameSyntax)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (1)
111memberAccessExpression.Expression is not SimpleNameSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
97var memberName = GetRightmostInvocationExpression(initializerExpression).GetRightmostName();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (4)
149else if (expression is SimpleNameSyntax simpleName) 159private static bool AddSimpleName(SimpleNameSyntax simpleName, List<string> parts) 659public static SimpleNameSyntax? GetRightmostName(this ExpressionSyntax node) 671if (node is SimpleNameSyntax simple)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberAccessExpressionSyntaxExtensions.cs (1)
16public static SimpleNameSyntax GetNameWithTriviaMoved(this MemberAccessExpressionSyntax memberAccess)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SimpleNameSyntaxExtensions.cs (2)
14public static ExpressionSyntax GetLeftSideOfDot(this SimpleNameSyntax name) 38public static bool LooksLikeStandaloneTypeName(this SimpleNameSyntax simpleName)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (8)
160var name = node as SimpleNameSyntax; 169var name = node as SimpleNameSyntax; 557var simpleName = (SimpleNameSyntax)node; 1332=> ((SimpleNameSyntax)node).Identifier; 1567=> node is SimpleNameSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\NameSyntaxComparer.cs (3)
75private static IList<SimpleNameSyntax> DecomposeNameParts(NameSyntax name) 77var result = new List<SimpleNameSyntax>(); 82private static void DecomposeNameParts(NameSyntax name, List<SimpleNameSyntax> result)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (50)
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
52[NotNullWhen(true)] out SimpleNameSyntax? leftName,
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (5)
33=> node is SimpleNameSyntax; 87var simpleName = (SimpleNameSyntax)node; 119var simpleName = (SimpleNameSyntax)node;
src\Analyzers\CSharp\CodeFixes\GenerateEnumMember\CSharpGenerateEnumMemberService.cs (2)
20AbstractGenerateEnumMemberService<CSharpGenerateEnumMemberService, SimpleNameSyntax, ExpressionSyntax> 26SemanticDocument document, SimpleNameSyntax identifierName, CancellationToken cancellationToken,
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateConversionCodeFixProvider.cs (1)
43node is SimpleNameSyntax ||
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateMethodCodeFixProvider.cs (1)
62node is SimpleNameSyntax ||
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (4)
26AbstractGenerateConversionService<CSharpGenerateConversionService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax> 43SemanticDocument document, AbstractGenerateParameterizedMemberService<CSharpGenerateConversionService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>.State state) 218protected override string GetImplicitConversionDisplayText(AbstractGenerateParameterizedMemberService<CSharpGenerateConversionService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>.State state) 221protected override string GetExplicitConversionDisplayText(AbstractGenerateParameterizedMemberService<CSharpGenerateConversionService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>.State state)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (2)
26AbstractGenerateDeconstructMethodService<CSharpGenerateDeconstructMethodService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax> 31protected override AbstractInvocationInfo CreateInvocationMethodInfo(SemanticDocument document, AbstractGenerateParameterizedMemberService<CSharpGenerateDeconstructMethodService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>.State state)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateMethodService.cs (4)
27AbstractGenerateMethodService<CSharpGenerateMethodService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax> 33=> node is SimpleNameSyntax; 38protected override AbstractInvocationInfo CreateInvocationMethodInfo(SemanticDocument document, AbstractGenerateParameterizedMemberService<CSharpGenerateMethodService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>.State state) 80SimpleNameSyntax simpleName,
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (2)
25internal abstract class CSharpGenerateParameterizedMemberService<TService> : AbstractGenerateParameterizedMemberService<TService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax> 26where TService : AbstractGenerateParameterizedMemberService<TService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>
src\Analyzers\CSharp\CodeFixes\GenerateVariable\CSharpGenerateVariableCodeFixProvider.cs (1)
38=> node is SimpleNameSyntax or PropertyDeclarationSyntax or MemberBindingExpressionSyntax;
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (1)
130var invokeName =
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
160else if (instanceReference.Syntax is SimpleNameSyntax name)
src\Analyzers\CSharp\CodeFixes\QualifyMemberAccess\CSharpQualifyMemberAccessCodeFixProvider.cs (4)
19internal sealed class CSharpQualifyMemberAccessCodeFixProvider() : AbstractQualifyMemberAccessCodeFixprovider<SimpleNameSyntax, InvocationExpressionSyntax> 21protected override SimpleNameSyntax? GetNode(Diagnostic diagnostic, CancellationToken cancellationToken) 26case SimpleNameSyntax simpleNameSyntax: 29return invocationExpressionSyntax.Expression as SimpleNameSyntax;
src\Analyzers\CSharp\CodeFixes\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastCodeFixProvider.cs (1)
50var castOrSelectName = castOrSelectMemberAccess.Name;
src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (1)
105if (innerExpression is SimpleNameSyntax innerName)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (5)
282parameterList.DescendantNodes().OfType<SimpleNameSyntax>(), 314SimpleNameSyntax originalName, 315SimpleNameSyntax currentName) 329SimpleNameSyntax originalName, 330SimpleNameSyntax currentName,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (4)
139if (node is SimpleNameSyntax nameSyntaxNode) 168if (IsPotentialConflictWithImportedType((SimpleNameSyntax)node)) 188private bool IsPotentialConflictWithImportedType(SimpleNameSyntax node) 213private void ProduceConflicts(SimpleNameSyntax node, Action<INamespaceSymbol> addConflict, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (4)
47if (typeSyntax is not SimpleNameSyntax) 50var simpleNameSyntax = (SimpleNameSyntax)typeSyntax; 108ISymbol symbol, ExpressionSyntax container, SimpleNameSyntax syntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (4)
269if (typeSyntax is not SimpleNameSyntax) 272var simpleNameSyntax = (SimpleNameSyntax)typeSyntax; 343private static TypeSyntax AddGlobalAlias(INamespaceOrTypeSymbol symbol, SimpleNameSyntax syntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
80=> SyntaxFactory.MemberBindingExpression((SimpleNameSyntax)name);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\CSharpSimplificationHelpers.cs (1)
34if (parentOfToken is SimpleNameSyntax && parent.Kind() == SyntaxKind.XmlNameAttribute)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Diagnostics\FixAllProvider\BatchFixerTests.cs (2)
49if (context.Node is SimpleNameSyntax node) 74if (root.FindNode(context.Span, getInnermostNodeForTie: true) is SimpleNameSyntax node)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
Semantics\PatternMatchingTests5.cs (4)
1121var yName = ((MemberAccessExpressionSyntax)subpatterns[0].ExpressionColon.Expression).Name; 1139var xName = ((MemberAccessExpressionSyntax)subpatterns[1].ExpressionColon.Expression).Name; 1310var yName = ((MemberAccessExpressionSyntax)subpatterns[0].ExpressionColon.Expression).Name; 1337var xName = ((MemberAccessExpressionSyntax)subpatterns[1].ExpressionColon.Expression).Name;
Microsoft.CodeAnalysis.CSharp.Features (98)
AddImport\CSharpAddImportFeatureService.cs (14)
37internal sealed class CSharpAddImportFeatureService() : AbstractAddImportFeatureService<SimpleNameSyntax> 46string diagnosticId, ISyntaxFacts syntaxFacts, SyntaxNode node, out SimpleNameSyntax nameNode) 72if (node is SimpleNameSyntax) 83var memberAccessName = (node.Parent as MemberAccessExpressionSyntax)?.Name; 84var conditionalAccessName = (((node.Parent as ConditionalAccessExpressionSyntax)?.WhenNotNull as InvocationExpressionSyntax)?.Expression as MemberBindingExpressionSyntax)?.Name; 114nameNode = node as SimpleNameSyntax; 150protected override bool CanAddImportForNamespace(string diagnosticId, SyntaxNode node, out SimpleNameSyntax nameNode) 162string diagnosticId, SyntaxNode node, out SimpleNameSyntax nameNode) 197nameNode = node as SimpleNameSyntax; 207private static bool TryFindStandaloneType(SyntaxNode node, out SimpleNameSyntax nameNode) 214nameNode = node as SimpleNameSyntax; 218private static SimpleNameSyntax GetLeftMostSimpleName(QualifiedNameSyntax qn) 223if (left is SimpleNameSyntax simpleName) 545if (nameSyntax is SimpleNameSyntax simpleName)
CodeFixes\GenerateType\GenerateTypeCodeFixProvider.cs (1)
43SimpleNameSyntax simple => !simple.IsParentKind(SyntaxKind.QualifiedName),
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
173currentNode = ((SimpleNameSyntax)currentNode).WithIdentifier(identifierToken);
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (2)
113if (reference is not SimpleNameSyntax nameRef) 206SimpleNameSyntax nameNode,
Debugging\BreakpointResolver.cs (1)
91nameParts = parts.Cast<SimpleNameSyntax>().Select(p => new NameAndArity(p.Identifier.ValueText, p.Arity)).ToList();
Diagnostics\Analyzers\CSharpUnboundIdentifiersDiagnosticAnalyzer.cs (1)
16internal sealed class CSharpUnboundIdentifiersDiagnosticAnalyzer : UnboundIdentifiersDiagnosticAnalyzerBase<SyntaxKind, SimpleNameSyntax, QualifiedNameSyntax, IncompleteMemberSyntax>
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
60var updatedDeclarator = declarator.WithIdentifier(newIdentifier).WithAdditionalAnnotations(tempAnnotation);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (2)
180private SimpleNameSyntax CreateMethodNameForInvocation() 568var methodName = CreateMethodNameForInvocation().WithAdditionalAnnotations(Simplifier.Annotation);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs (2)
61SimpleNameSyntax unqualifiedName; 67unqualifiedName = (SimpleNameSyntax)expression;
FullyQualify\CSharpFullyQualifyService.cs (5)
20internal sealed class CSharpFullyQualifyService : AbstractFullyQualifyService<SimpleNameSyntax> 28protected override bool CanFullyQualify(SyntaxNode node, [NotNullWhen(true)] out SimpleNameSyntax? simpleName) 30simpleName = node as SimpleNameSyntax; 43protected override async Task<SyntaxNode> ReplaceNodeAsync(SimpleNameSyntax simpleName, string containerName, bool resultingSymbolIsType, CancellationToken cancellationToken) 46var newName = simpleName.WithLeadingTrivia(SyntaxTriviaList.Empty);
GenerateMember\GenerateVariable\CSharpGenerateVariableService.cs (3)
25AbstractGenerateVariableService<CSharpGenerateVariableService, SimpleNameSyntax, ExpressionSyntax> 89SemanticDocument document, SimpleNameSyntax identifierName, CancellationToken cancellationToken, 134private static bool IsProbablyGeneric(SimpleNameSyntax identifierName, CancellationToken cancellationToken)
GenerateType\CSharpGenerateTypeService.cs (13)
36AbstractGenerateTypeService<CSharpGenerateTypeService, SimpleNameSyntax, ObjectCreationExpressionSyntax, ExpressionSyntax, TypeDeclarationSyntax, ArgumentSyntax> 40protected override ExpressionSyntax GetLeftSideOfDot(SimpleNameSyntax simpleName) 118SimpleNameSyntax simpleName, 414if (simpleAssignmentExpression.Left is not SimpleNameSyntax name) 509protected override INamedTypeSymbol DetermineTypeToGenerateIn(SemanticModel semanticModel, SimpleNameSyntax simpleName, CancellationToken cancellationToken) 629Debug.Assert(name is SimpleNameSyntax); 630namespaceContainers.Add(((SimpleNameSyntax)name).Identifier.ValueText); 708internal override bool IsGenericName(SimpleNameSyntax simpleName) 712=> expression is SimpleNameSyntax; 715Solution updatedSolution, SyntaxNode modifiedRoot, Document document, SimpleNameSyntax simpleName, string includeUsingsOrImports, CancellationToken cancellationToken) 760SimpleNameSyntax propertyName, 781SimpleNameSyntax propertyName, ITypeSymbol propertyType) 803SimpleNameSyntax propertyName,
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (6)
309private static readonly Action<SyntaxEditor, InvocationExpressionSyntax, SimpleNameSyntax, SimpleNameSyntax> s_replaceGetReferenceInvocation = 318private static readonly Action<SyntaxEditor, InvocationExpressionSyntax, SimpleNameSyntax, SimpleNameSyntax> s_replaceSetReferenceInvocation = 357Action<SyntaxEditor, InvocationExpressionSyntax, SimpleNameSyntax, SimpleNameSyntax> replace)
SignatureHelp\GenericNameSignatureHelpProvider.cs (1)
86if (genericIdentifier.Parent is not SimpleNameSyntax simpleName)
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (1)
71else if (invocationExpression.Expression is SimpleNameSyntax &&
SpellCheck\CSharpSpellcheckCodeFixProvider.cs (3)
22internal sealed partial class CSharpSpellCheckCodeFixProvider : AbstractSpellCheckCodeFixProvider<SimpleNameSyntax> 49protected override bool ShouldSpellCheck(SimpleNameSyntax name) 62protected override bool IsGeneric(SimpleNameSyntax nameNode)
src\Analyzers\CSharp\Analyzers\QualifyMemberAccess\CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (1)
18: AbstractQualifyMemberAccessDiagnosticAnalyzer<SyntaxKind, ExpressionSyntax, SimpleNameSyntax>
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
89if (invokedExpression is not SimpleNameSyntax and not MemberAccessExpressionSyntax)
src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastDiagnosticAnalyzer.cs (1)
93[NotNullWhen(true)] out SimpleNameSyntax? caseOrSelectName,
src\Analyzers\CSharp\Analyzers\SimplifyPropertyPattern\SimplifyPropertyPatternHelpers.cs (1)
52if (expression is SimpleNameSyntax)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (1)
111memberAccessExpression.Expression is not SimpleNameSyntax)
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
52[NotNullWhen(true)] out SimpleNameSyntax? leftName,
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (5)
33=> node is SimpleNameSyntax; 87var simpleName = (SimpleNameSyntax)node; 119var simpleName = (SimpleNameSyntax)node;
src\Analyzers\CSharp\CodeFixes\GenerateEnumMember\CSharpGenerateEnumMemberService.cs (2)
20AbstractGenerateEnumMemberService<CSharpGenerateEnumMemberService, SimpleNameSyntax, ExpressionSyntax> 26SemanticDocument document, SimpleNameSyntax identifierName, CancellationToken cancellationToken,
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateConversionCodeFixProvider.cs (1)
43node is SimpleNameSyntax ||
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateMethodCodeFixProvider.cs (1)
62node is SimpleNameSyntax ||
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (4)
26AbstractGenerateConversionService<CSharpGenerateConversionService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax> 43SemanticDocument document, AbstractGenerateParameterizedMemberService<CSharpGenerateConversionService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>.State state) 218protected override string GetImplicitConversionDisplayText(AbstractGenerateParameterizedMemberService<CSharpGenerateConversionService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>.State state) 221protected override string GetExplicitConversionDisplayText(AbstractGenerateParameterizedMemberService<CSharpGenerateConversionService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>.State state)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (2)
26AbstractGenerateDeconstructMethodService<CSharpGenerateDeconstructMethodService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax> 31protected override AbstractInvocationInfo CreateInvocationMethodInfo(SemanticDocument document, AbstractGenerateParameterizedMemberService<CSharpGenerateDeconstructMethodService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>.State state)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateMethodService.cs (4)
27AbstractGenerateMethodService<CSharpGenerateMethodService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax> 33=> node is SimpleNameSyntax; 38protected override AbstractInvocationInfo CreateInvocationMethodInfo(SemanticDocument document, AbstractGenerateParameterizedMemberService<CSharpGenerateMethodService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>.State state) 80SimpleNameSyntax simpleName,
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (2)
25internal abstract class CSharpGenerateParameterizedMemberService<TService> : AbstractGenerateParameterizedMemberService<TService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax> 26where TService : AbstractGenerateParameterizedMemberService<TService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>
src\Analyzers\CSharp\CodeFixes\GenerateVariable\CSharpGenerateVariableCodeFixProvider.cs (1)
38=> node is SimpleNameSyntax or PropertyDeclarationSyntax or MemberBindingExpressionSyntax;
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (1)
130var invokeName =
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
160else if (instanceReference.Syntax is SimpleNameSyntax name)
src\Analyzers\CSharp\CodeFixes\QualifyMemberAccess\CSharpQualifyMemberAccessCodeFixProvider.cs (4)
19internal sealed class CSharpQualifyMemberAccessCodeFixProvider() : AbstractQualifyMemberAccessCodeFixprovider<SimpleNameSyntax, InvocationExpressionSyntax> 21protected override SimpleNameSyntax? GetNode(Diagnostic diagnostic, CancellationToken cancellationToken) 26case SimpleNameSyntax simpleNameSyntax: 29return invocationExpressionSyntax.Expression as SimpleNameSyntax;
src\Analyzers\CSharp\CodeFixes\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastCodeFixProvider.cs (1)
50var castOrSelectName = castOrSelectMemberAccess.Name;
src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (1)
105if (innerExpression is SimpleNameSyntax innerName)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (5)
282parameterList.DescendantNodes().OfType<SimpleNameSyntax>(), 314SimpleNameSyntax originalName, 315SimpleNameSyntax currentName) 329SimpleNameSyntax originalName, 330SimpleNameSyntax currentName,
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (4)
Semantics\ExpressionBodiedMemberTests.cs (1)
202var semanticInfo = GetSemanticInfoForTest<SimpleNameSyntax>(@"
Semantics\LocalFunctionTests.cs (3)
501Assert.Equal("A", ((SimpleNameSyntax)attribute.Name).Identifier.ValueText); 549Assert.Equal("A", ((SimpleNameSyntax)attribute.Name).Identifier.ValueText); 813Assert.Equal("A", ((SimpleNameSyntax)attribute.Name).Identifier.ValueText);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (14)
Compilation\GetSemanticInfoTests.cs (4)
274var v9right = v9val.Name; 1883var nameSyntaxToBind = (SimpleNameSyntax)GetExprSyntaxForBinding(GetExprSyntaxList(tree)); 4440var rightSyntax = qualifiedSyntax.Right;
Compilation\SemanticModelAPITests.cs (2)
821var cBase = (cDecl.BaseList.Types[0].Type as AliasQualifiedNameSyntax).Name; 2725var right = ((QualifiedNameSyntax)speculatedTypeSyntax).Right;
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (1)
2534var rightName = type.Right;
DocumentationComments\CrefTests.cs (4)
5753var parameterTypeContainingType = parameterType.DescendantNodes().OfType<SimpleNameSyntax>().First(); 5797var typeSyntax = cref.DescendantNodes().OfType<SimpleNameSyntax>().First();
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (1)
1018var memberNameSyntax = memberAccessSyntax.Name;
Symbols\DestructorTests.cs (1)
413var finalizeSyntax = tree.GetCompilationUnitRoot().DescendantNodes().OfType<MemberAccessExpressionSyntax>().Single().Name;
Symbols\ExtensionMethodTests.cs (1)
2728var symbolInfo = model.GetSymbolInfo((SimpleNameSyntax)node);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (4)
Syntax\SyntaxDiffingTests.cs (4)
308var node = root.FindNode(span, getInnermostNodeForTie: true) as SimpleNameSyntax; 373var node = root.FindNode(span, getInnermostNodeForTie: true) as SimpleNameSyntax;
Microsoft.CodeAnalysis.CSharp.Workspaces (89)
Classification\SyntaxClassification\NameSyntaxClassifier.cs (9)
32if (syntax is SimpleNameSyntax name) 46SimpleNameSyntax name, 61SimpleNameSyntax name, 92SimpleNameSyntax name, 126SimpleNameSyntax name, 269private static bool IsInVarContext(SimpleNameSyntax name) 281SimpleNameSyntax name, 303SimpleNameSyntax name, 316private static bool TryClassifySomeContextualKeywordIdentifiersAsKeywords(SimpleNameSyntax name, SymbolInfo symbolInfo, SegmentedList<ClassifiedSpan> result)
CodeGeneration\CSharpSyntaxGenerator.cs (8)
3145(SimpleNameSyntax)simpleName); 3378var sname = (SimpleNameSyntax)expression; 3387return qname.WithRight((SimpleNameSyntax)this.WithTypeArguments(qname.Right, typeArguments)); 3391return aname.WithName((SimpleNameSyntax)this.WithTypeArguments(aname.Name, typeArguments)); 3396return sma.WithName((SimpleNameSyntax)this.WithTypeArguments(sma.Name, typeArguments)); 3404=> SyntaxFactory.QualifiedName((NameSyntax)left, (SimpleNameSyntax)right).WithAdditionalAnnotations(Simplifier.Annotation); 3409(SimpleNameSyntax)name);
ExternalAccess\Pythia\Api\PythiaSyntaxExtensions.cs (1)
25public static SimpleNameSyntax? GetRightmostName(this ExpressionSyntax node)
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (2)
643if (type is SimpleNameSyntax simpleName) 659private static string GetSimpleTypeName(SimpleNameSyntax name)
Rename\CSharpRenameRewriterLanguageService.cs (3)
444identifierToken = ((SimpleNameSyntax)expressionOfInvocation).Identifier; 537if (token.Parent is SimpleNameSyntax && 1204return enclosingStatement ?? enclosingNameMemberCrefOrnull ?? token.GetAncestors(n => n is SimpleNameSyntax).FirstOrDefault();
Simplification\CSharpSimplificationService.cs (1)
115if (parentOfToken is SimpleNameSyntax && parent.IsKind(SyntaxKind.XmlNameAttribute))
Simplification\CSharpSimplificationService.Expander.cs (20)
423var newNode = (SimpleNameSyntax)base.VisitGenericName(node); 432var newNode = (SimpleNameSyntax)base.VisitIdentifierName(node); 437private ExpressionSyntax VisitSimpleName(SimpleNameSyntax rewrittenSimpleName, SimpleNameSyntax originalSimpleName) 616newNode = ((SimpleNameSyntax)newNode).WithIdentifier(identifier); 707(SimpleNameSyntax)newNode.WithLeadingTrivia(null)) 767private IList<ISymbol> TypeArgumentSymbolsPresentInName(SimpleNameSyntax simpleName) 787private static bool IsInvocationWithDynamicArguments(SimpleNameSyntax originalSimpleName, SemanticModel semanticModel) 866private static bool IsPropertyNameOfObjectInitializer(SimpleNameSyntax identifierName) 919(SimpleNameSyntax)rewrittenNode.WithLeadingTrivia(null)) 960(SimpleNameSyntax)rewrittenNode)); 969(SimpleNameSyntax)rewrittenNode)); 974Debug.Assert(rewrittenNode is SimpleNameSyntax); 978var right = (SimpleNameSyntax)rewrittenNode; 983var right = (SimpleNameSyntax)rewrittenNode; 992(SimpleNameSyntax)rewrittenNode));
Simplification\Reducers\CSharpEscapingReducer.cs (3)
113var expression = (SimpleNameSyntax)parent; 114var newExpression = expression.WithIdentifier(result);
Simplification\Reducers\CSharpExtensionMethodReducer.cs (3)
45else if (node.Expression is SimpleNameSyntax) 47rewrittenNode = TryReduceExtensionMethod(node, semanticModel, rewrittenNode, (SimpleNameSyntax)node.Expression); 53private static InvocationExpressionSyntax TryReduceExtensionMethod(InvocationExpressionSyntax node, SemanticModel semanticModel, InvocationExpressionSyntax rewrittenNode, SimpleNameSyntax expressionName)
Simplification\Simplifiers\MemberAccessExpressionSimplifier.cs (1)
91: node is SimpleNameSyntax;
Simplification\Simplifiers\NameSimplifier.cs (4)
165replacementNode = ((SimpleNameSyntax)replacementNode).WithIdentifier(identifierToken); 206if (name is SimpleNameSyntax simpleName) 224if (aliasQualifiedName.Name is SimpleNameSyntax && 312var simpleName = ((AliasQualifiedNameSyntax)name).Name
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
97var memberName = GetRightmostInvocationExpression(initializerExpression).GetRightmostName();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (4)
149else if (expression is SimpleNameSyntax simpleName) 159private static bool AddSimpleName(SimpleNameSyntax simpleName, List<string> parts) 659public static SimpleNameSyntax? GetRightmostName(this ExpressionSyntax node) 671if (node is SimpleNameSyntax simple)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberAccessExpressionSyntaxExtensions.cs (1)
16public static SimpleNameSyntax GetNameWithTriviaMoved(this MemberAccessExpressionSyntax memberAccess)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SimpleNameSyntaxExtensions.cs (2)
14public static ExpressionSyntax GetLeftSideOfDot(this SimpleNameSyntax name) 38public static bool LooksLikeStandaloneTypeName(this SimpleNameSyntax simpleName)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
429token.Parent is not SimpleNameSyntax simpleName)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (8)
160var name = node as SimpleNameSyntax; 169var name = node as SimpleNameSyntax; 557var simpleName = (SimpleNameSyntax)node; 1332=> ((SimpleNameSyntax)node).Identifier; 1567=> node is SimpleNameSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\NameSyntaxComparer.cs (3)
75private static IList<SimpleNameSyntax> DecomposeNameParts(NameSyntax name) 77var result = new List<SimpleNameSyntax>(); 82private static void DecomposeNameParts(NameSyntax name, List<SimpleNameSyntax> result)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (4)
139if (node is SimpleNameSyntax nameSyntaxNode) 168if (IsPotentialConflictWithImportedType((SimpleNameSyntax)node)) 188private bool IsPotentialConflictWithImportedType(SimpleNameSyntax node) 213private void ProduceConflicts(SimpleNameSyntax node, Action<INamespaceSymbol> addConflict, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (4)
47if (typeSyntax is not SimpleNameSyntax) 50var simpleNameSyntax = (SimpleNameSyntax)typeSyntax; 108ISymbol symbol, ExpressionSyntax container, SimpleNameSyntax syntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (4)
269if (typeSyntax is not SimpleNameSyntax) 272var simpleNameSyntax = (SimpleNameSyntax)typeSyntax; 343private static TypeSyntax AddGlobalAlias(INamespaceOrTypeSymbol symbol, SimpleNameSyntax syntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
80=> SyntaxFactory.MemberBindingExpression((SimpleNameSyntax)name);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\CSharpSimplificationHelpers.cs (1)
34if (parentOfToken is SimpleNameSyntax && parent.Kind() == SyntaxKind.XmlNameAttribute)
Microsoft.Extensions.Logging.Generators (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
178public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name) 183SimpleNameSyntax simple => simple,
Microsoft.Extensions.Options.SourceGeneration (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
178public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name) 183SimpleNameSyntax simple => simple,
Microsoft.Gen.Logging (2)
src\Generators\Shared\RoslynExtensions.cs (2)
133public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name) 138SimpleNameSyntax simple => simple,
Microsoft.Gen.Metrics (2)
src\Generators\Shared\RoslynExtensions.cs (2)
133public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name) 138SimpleNameSyntax simple => simple,
Microsoft.Interop.ComInterfaceGenerator (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
178public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name) 183SimpleNameSyntax simple => simple,
Microsoft.Interop.LibraryImportGenerator (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
178public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name) 183SimpleNameSyntax simple => simple,
Microsoft.Interop.LibraryImportGenerator.Downlevel (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
178public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name) 183SimpleNameSyntax simple => simple,
Microsoft.Interop.SourceGeneration (6)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
178public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name) 183SimpleNameSyntax simple => simple,
Utils\SyntaxFactoryExtensions.cs (4)
47public static InvocationExpressionSyntax MethodInvocation(ExpressionSyntax objectOrClass, SimpleNameSyntax methodName) 55public static InvocationExpressionSyntax MethodInvocation(ExpressionSyntax objectOrClass, SimpleNameSyntax methodName, params ArgumentSyntax[] arguments) 68public static ExpressionStatementSyntax MethodInvocationStatement(ExpressionSyntax objectOrClass, SimpleNameSyntax methodName, params ArgumentSyntax[] arguments) 86public static MemberAccessExpressionSyntax Dot(this ExpressionSyntax expression, SimpleNameSyntax member) =>
System.Text.Json.SourceGeneration (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
178public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name) 183SimpleNameSyntax simple => simple,
System.Text.RegularExpressions.Generator (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
178public static SimpleNameSyntax GetUnqualifiedName(this NameSyntax name) 183SimpleNameSyntax simple => simple,