379 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)
156 public static SimpleNameSyntax GetUnqualifiedName (this NameSyntax name) 160 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); 1542SimpleNameSyntax node, 1697void adjustIdentifierMapIfAny(SimpleNameSyntax node, bool invoked) 1725void reportPrimaryConstructorParameterShadowing(SimpleNameSyntax node, Symbol symbol, string name, bool invoked, LookupResult lookupResult, ArrayBuilder<Symbol> members, BindingDiagnosticBag diagnostics) 1786private void LookupIdentifier(LookupResult lookupResult, SimpleNameSyntax node, bool invoked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1828private static bool IsOutVarDiscardIdentifier(SimpleNameSyntax node) 1947private BoundExpression BindNonMethod(SimpleNameSyntax node, Symbol symbol, BindingDiagnosticBag diagnostics, LookupResultKind resultKind, bool indexed, bool isError) 2201bool isUsedBeforeDeclaration(SimpleNameSyntax node, LocalSymbol localSymbol) 2225private bool ReportSimpleProgramLocalReferencedOutsideOfTopLevelStatement(SimpleNameSyntax node, Symbol symbol, BindingDiagnosticBag diagnostics) 2237protected virtual BoundExpression BindRangeVariable(SimpleNameSyntax node, RangeVariableSymbol qv, BindingDiagnosticBag diagnostics) 7530SimpleNameSyntax right, 7601SimpleNameSyntax right, 7752SimpleNameSyntax right, 7823SimpleNameSyntax 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, 1585SimpleNameSyntax rightName,
BoundTree\BoundExpression.cs (1)
16public SimpleNameSyntax? InterceptableNameSyntax
Compilation\CSharpCompilation.cs (1)
2454internal (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)
143Syntax.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)
5812private SimpleNameSyntax ParseSimpleName(NameOptions options = NameOptions.None) 5823SimpleNameSyntax name = id; 6651var name = this.ParseSimpleName(allowedParts); 6682var 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)
1082case { Parent: SimpleNameSyntax { Parent: MemberAccessExpressionSyntax { Parent: InvocationExpressionSyntax } memberAccess } rhs } when memberAccess.Name == rhs: 1083case { Parent: SimpleNameSyntax { Parent: MemberBindingExpressionSyntax { Parent: InvocationExpressionSyntax } memberBinding } rhs1 } when memberBinding.Name == rhs1: 1084case { Parent: SimpleNameSyntax { Parent: InvocationExpressionSyntax invocation } simpleName } when invocation.Expression == simpleName: 1087case { Parent: SimpleNameSyntax { Parent: not (MemberAccessExpressionSyntax or MemberBindingExpressionSyntax) } }: 1088case { Parent: SimpleNameSyntax { Parent: MemberAccessExpressionSyntax memberAccess } rhs } when memberAccess.Name == rhs: 1089case { Parent: SimpleNameSyntax { Parent: MemberBindingExpressionSyntax memberBinding } rhs1 } when memberBinding.Name == rhs1: 1295case { Parent: SimpleNameSyntax { Parent: MemberAccessExpressionSyntax { Parent: InvocationExpressionSyntax } memberAccess } rhs } when memberAccess.Name == rhs: 1296case { Parent: SimpleNameSyntax { Parent: InvocationExpressionSyntax invocation } simpleName } when invocation.Expression == simpleName: 1299case { Parent: SimpleNameSyntax { Parent: not MemberAccessExpressionSyntax } }: 1300case { 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 (23)
src\Analyzers\CSharp\Analyzers\QualifyMemberAccess\CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (1)
18: AbstractQualifyMemberAccessDiagnosticAnalyzer<SyntaxKind, ExpressionSyntax, SimpleNameSyntax>
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
93if (invokedExpression is not SimpleNameSyntax and not MemberAccessExpressionSyntax)
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)
96var memberName = GetRightmostInvocationExpression(initializerExpression).GetRightmostName();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (4)
148else if (expression is SimpleNameSyntax simpleName) 158private static bool AddSimpleName(SimpleNameSyntax simpleName, List<string> parts) 658public static SimpleNameSyntax? GetRightmostName(this ExpressionSyntax node) 670if (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)
156var name = node as SimpleNameSyntax; 165var name = node as SimpleNameSyntax; 549var simpleName = (SimpleNameSyntax)node; 1328=> ((SimpleNameSyntax)node).Identifier; 1557=> 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)
35=> node is SimpleNameSyntax; 89var simpleName = (SimpleNameSyntax)node; 121var 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)
41=> node is SimpleNameSyntax or PropertyDeclarationSyntax or MemberBindingExpressionSyntax;
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (1)
137var 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\CSharpSimplifyLinqExpressionCodeFixProvider.cs (1)
18internal sealed class CSharpSimplifyLinqExpressionCodeFixProvider() : AbstractSimplifyLinqExpressionCodeFixProvider<InvocationExpressionSyntax, SimpleNameSyntax, ExpressionSyntax>
src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (1)
105if (innerExpression is SimpleNameSyntax innerName)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (5)
239parameterList.DescendantNodes().OfType<SimpleNameSyntax>(), 271SimpleNameSyntax originalName, 272SimpleNameSyntax currentName) 286SimpleNameSyntax originalName, 287SimpleNameSyntax 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)
83=> 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 (96)
AddImport\CSharpAddImportFeatureService.cs (13)
35internal class CSharpAddImportFeatureService : AbstractAddImportFeatureService<SimpleNameSyntax> 50string diagnosticId, ISyntaxFacts syntaxFacts, SyntaxNode node, out SimpleNameSyntax nameNode) 76if (node is SimpleNameSyntax) 87var memberAccessName = (node.Parent as MemberAccessExpressionSyntax)?.Name; 88var conditionalAccessName = (((node.Parent as ConditionalAccessExpressionSyntax)?.WhenNotNull as InvocationExpressionSyntax)?.Expression as MemberBindingExpressionSyntax)?.Name; 118nameNode = node as SimpleNameSyntax; 154protected override bool CanAddImportForNamespace(string diagnosticId, SyntaxNode node, out SimpleNameSyntax nameNode) 165protected override bool CanAddImportForType(string diagnosticId, SyntaxNode node, out SimpleNameSyntax nameNode) 200private static bool TryFindStandaloneType(SyntaxNode node, out SimpleNameSyntax nameNode) 207nameNode = node as SimpleNameSyntax; 211private static SimpleNameSyntax GetLeftMostSimpleName(QualifiedNameSyntax qn) 216if (left is SimpleNameSyntax simpleName) 538if (nameSyntax is SimpleNameSyntax simpleName)
CodeFixes\GenerateType\GenerateTypeCodeFixProvider.cs (1)
52case SimpleNameSyntax simple:
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)
179private SimpleNameSyntax CreateMethodNameForInvocation() 570var 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)
34AbstractGenerateTypeService<CSharpGenerateTypeService, SimpleNameSyntax, ObjectCreationExpressionSyntax, ExpressionSyntax, TypeDeclarationSyntax, ArgumentSyntax> 44protected override ExpressionSyntax GetLeftSideOfDot(SimpleNameSyntax simpleName) 130SimpleNameSyntax simpleName, 412if (simpleAssignmentExpression.Left is not SimpleNameSyntax name) 533protected override INamedTypeSymbol DetermineTypeToGenerateIn(SemanticModel semanticModel, SimpleNameSyntax simpleName, CancellationToken cancellationToken) 653Debug.Assert(name is SimpleNameSyntax); 654namespaceContainers.Add(((SimpleNameSyntax)name).Identifier.ValueText); 732internal override bool IsGenericName(SimpleNameSyntax simpleName) 736=> expression is SimpleNameSyntax; 739Solution updatedSolution, SyntaxNode modifiedRoot, Document document, SimpleNameSyntax simpleName, string includeUsingsOrImports, CancellationToken cancellationToken) 784SimpleNameSyntax propertyName, 805SimpleNameSyntax propertyName, ITypeSymbol propertyType) 827SimpleNameSyntax 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)
21internal sealed partial class CSharpSpellCheckCodeFixProvider : AbstractSpellCheckCodeFixProvider<SimpleNameSyntax> 37protected override bool ShouldSpellCheck(SimpleNameSyntax name) 50protected 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)
93if (invokedExpression is not SimpleNameSyntax and not MemberAccessExpressionSyntax)
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)
35=> node is SimpleNameSyntax; 89var simpleName = (SimpleNameSyntax)node; 121var 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)
41=> node is SimpleNameSyntax or PropertyDeclarationSyntax or MemberBindingExpressionSyntax;
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (1)
137var 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\CSharpSimplifyLinqExpressionCodeFixProvider.cs (1)
18internal sealed class CSharpSimplifyLinqExpressionCodeFixProvider() : AbstractSimplifyLinqExpressionCodeFixProvider<InvocationExpressionSyntax, SimpleNameSyntax, ExpressionSyntax>
src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (1)
105if (innerExpression is SimpleNameSyntax innerName)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (5)
239parameterList.DescendantNodes().OfType<SimpleNameSyntax>(), 271SimpleNameSyntax originalName, 272SimpleNameSyntax currentName) 286SimpleNameSyntax originalName, 287SimpleNameSyntax 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)
3164(SimpleNameSyntax)simpleName); 3397var sname = (SimpleNameSyntax)expression; 3406return qname.WithRight((SimpleNameSyntax)this.WithTypeArguments(qname.Right, typeArguments)); 3410return aname.WithName((SimpleNameSyntax)this.WithTypeArguments(aname.Name, typeArguments)); 3415return sma.WithName((SimpleNameSyntax)this.WithTypeArguments(sma.Name, typeArguments)); 3423=> SyntaxFactory.QualifiedName((NameSyntax)left, (SimpleNameSyntax)right).WithAdditionalAnnotations(Simplifier.Annotation); 3428(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)
445identifierToken = ((SimpleNameSyntax)expressionOfInvocation).Identifier; 542if (token.Parent is SimpleNameSyntax && 1209return enclosingStatement ?? enclosingNameMemberCrefOrnull ?? token.GetAncestors(n => n is SimpleNameSyntax).FirstOrDefault();
Simplification\CSharpSimplificationService.cs (1)
114if (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)
96var memberName = GetRightmostInvocationExpression(initializerExpression).GetRightmostName();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (4)
148else if (expression is SimpleNameSyntax simpleName) 158private static bool AddSimpleName(SimpleNameSyntax simpleName, List<string> parts) 658public static SimpleNameSyntax? GetRightmostName(this ExpressionSyntax node) 670if (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)
420token.Parent is not SimpleNameSyntax simpleName)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (8)
156var name = node as SimpleNameSyntax; 165var name = node as SimpleNameSyntax; 549var simpleName = (SimpleNameSyntax)node; 1328=> ((SimpleNameSyntax)node).Identifier; 1557=> 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)
83=> 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,