6 implementations of Name
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
31public string Name { get; }
Microsoft.CodeAnalysis.CSharp (2)
Symbols\PublicModel\PreprocessingSymbol.cs (1)
102string ISymbol.Name => _name;
Symbols\PublicModel\Symbol.cs (1)
199string ISymbol.Name => UnderlyingSymbol.Name;
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
71public string Name => _symbol.Name;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Symbol.vb (1)
1307Private ReadOnly Property ISymbol_Name As String Implements ISymbol.Name, ISymbolInternal.Name
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
31public string Name { get; }
3088 references to Name
ConfigurationSchemaGenerator (12)
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (4)
671string propertyName = property.Name; 698string parameterName = parameter.Name; 962if (firstParam.Name == "argument" && firstParam.Type.SpecialType == SpecialType.System_Object 963&& secondParam.Name == "paramName" && secondParam.Type.Equals(_typeSymbols.String, SymbolEqualityComparer.Default))
RuntimeSource\Configuration.Binder\Parser\BinderInvocation.cs (2)
57Name: string methodName, 60Name: string containingTypeName,
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (1)
19switch (invocation.Operation.TargetMethod.Name)
RuntimeSource\Configuration.Binder\Parser\Extensions.cs (1)
102? type.Name
RuntimeSource\Configuration.Binder\Parser\OptionsBuilderConfigurationExtensions.cs (2)
32if (targetMethod.Name is "Bind") 36else if (targetMethod.Name is "BindConfiguration")
RuntimeSource\Configuration.Binder\Specs\Members\MemberSpec.cs (1)
15Name = member.Name;
RuntimeSource\SourceGenerators\TypeRef.cs (1)
18Name = type.Name;
ILLink.RoslynAnalyzer (13)
INamedTypeSymbolExtensions.cs (1)
23 !currentName.Equals (currentType.Name.AsSpan (), StringComparison.Ordinal)) {
ISymbolExtensions.cs (3)
23 if (attr.AttributeClass?.Name == attributeName) 146 sb.Append (parameterSymbol.Name); 208 => methodSymbol.Name is WellKnownMemberNames.EntryPointMethodName or WellKnownMemberNames.TopLevelStatementsEntryPointMethodName &&
TrimAnalysis\GenericParameterValue.cs (1)
32 => new string[] { GenericParameter.TypeParameterSymbol.Name, GenericParameter.TypeParameterSymbol.ContainingSymbol.GetDisplayName () };
TrimAnalysis\HandleCallAction.cs (2)
166 foreach (var method in type.Type.GetMethodsOnTypeHierarchy (m => m.Name == name, bindingFlags)) 172 foreach (var nestedType in type.Type.GetNestedTypesOnType (t => t.Name == name, bindingFlags))
TrimAnalysis\MethodProxy.cs (1)
16 public string Name { get => Method.Name; }
TrimAnalysis\ReflectionAccessAnalyzer.cs (3)
58 foreach (var @event in typeSymbol.GetEventsOnTypeHierarchy (e => e.Name == name, bindingFlags)) 64 foreach (var field in typeSymbol.GetFieldsOnTypeHierarchy (f => f.Name == name, bindingFlags)) 70 foreach (var prop in typeSymbol.GetPropertiesOnTypeHierarchy (p => p.Name == name, bindingFlags))
TrimAnalysis\TrimAnalysisVisitor.cs (1)
158 switch (field.Name) {
TrimAnalysis\TypeProxy.cs (1)
32 public string? Namespace { get => Type.ContainingNamespace?.Name; }
Microsoft.Analyzers.Extra (11)
AsyncCallInsideUsingBlockAnalyzer.cs (2)
199return invocation.TargetMethod.Name is "Wait" or "GetAwaiter"; 204return operation.Property.Name is "Result";
CallAnalysis\CallAnalyzer.Handlers.cs (1)
39if (_state.InterfaceMethodNames.Contains(target.Name))
CallAnalysis\CallAnalyzer.Registrar.cs (1)
191_ = _state.InterfaceMethodNames.Add(method.Name);
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
245if (param.Name == paramName)
CallAnalysis\Fixers\LegacyLoggingFixer.FixDetails.cs (2)
125Level = method.Name.Substring("Log".Length); 201switch (p.Name)
CallAnalysis\StartsEndsWith.cs (1)
59var diagnostic = Diagnostic.Create(DiagDescriptors.StartsEndsWith, op.Syntax.GetLocation(), op.TargetMethod.Name);
MakeExeTypesInternalAnalyzer.cs (1)
134var diagnostic = Diagnostic.Create(DiagDescriptors.MakeExeTypesInternal, type.Locations[0], type.Name);
UsingToStringInLoggersAnalyzer.cs (2)
58return attributeSymbol.Name == "LoggerMessageAttribute" 67&& argOperation.TargetMethod.Name == "ToString")
Microsoft.Analyzers.Local (4)
CallAnalysis\CallAnalyzer.Handlers.cs (1)
39if (_state.InterfaceMethodNames.Contains(target.Name))
CallAnalysis\CallAnalyzer.Registrar.cs (1)
191_ = _state.InterfaceMethodNames.Add(method.Name);
CallAnalysis\Throws.cs (2)
40$"Microsoft.Shared.Diagnostics.Throws.{creationOp.Type.Name}"); 46if (creationOp.Type.Name == "ArgumentNullException")
Microsoft.AspNetCore.Analyzers (21)
BuildServiceProviderAnalyzer.cs (3)
29if (serviceItem.UseMethod.Name == "BuildServiceProvider") 34serviceItem.UseMethod.Name, 35serviceAnalysis.ConfigureServicesMethod.Name));
OptionsAnalyzer.cs (2)
30property.Property?.ContainingType?.Name != null && 31property.Property.ContainingType.Name.EndsWith("Options", StringComparison.Ordinal))
OptionsFacts.cs (1)
17string.Equals(item.Property.Name, SymbolNames.MvcOptions.EnableEndpointRoutingPropertyName, StringComparison.Ordinal))
StartupFacts.cs (8)
65if (symbol.Name == null || 66!symbol.Name.StartsWith(SymbolNames.ConfigureServicesMethodPrefix, StringComparison.OrdinalIgnoreCase) || 67!symbol.Name.EndsWith(SymbolNames.ConfigureServicesMethodSuffix, StringComparison.OrdinalIgnoreCase)) 103if (symbol.Name == null || 104!symbol.Name.StartsWith(SymbolNames.ConfigureMethodPrefix, StringComparison.OrdinalIgnoreCase)) 138if (string.Equals(symbol.Name, SymbolNames.SignalRAppBuilderExtensions.UseSignalRMethodName, StringComparison.Ordinal) || 139string.Equals(symbol.Name, SymbolNames.HubEndpointRouteBuilderExtensions.MapHubMethodName, StringComparison.Ordinal) || 140string.Equals(symbol.Name, SymbolNames.ComponentEndpointRouteBuilderExtensions.MapBlazorHubMethodName, StringComparison.Ordinal))
UseAuthorizationAnalyzer.cs (3)
36var middleware = middlewareItem.UseMethod.Name; 52middlewareItem.UseMethod.Name)); 72middlewareItem.UseMethod.Name));
UseMvcAnalyzer.cs (4)
38if (middlewareItem.UseMethod.Name == "UseMvc" || middlewareItem.UseMethod.Name == "UseMvcWithDefaultRoute") 46middlewareItem.UseMethod.Name, 47optionsAnalysis.ConfigureServicesMethod.Name));
Microsoft.AspNetCore.Analyzers.Test (8)
ConfigureMethodVisitorTest.cs (1)
86.Select(m => m.ContainingType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + "." + m.Name)
StartupAnalyzerTest.cs (7)
61Assert.Collection(ConfigureServicesMethods, m => Assert.Equal("ConfigureServices", m.Name)); 62Assert.Collection(ConfigureMethods, m => Assert.Equal("Configure", m.Name)); 111ConfigureServicesMethods.OrderBy(m => m.Name), 112m => Assert.Equal("ConfigureServices", m.Name)); 115ConfigureMethods.OrderBy(m => m.Name), 116m => Assert.Equal("Configure", m.Name), 117m => Assert.Equal("ConfigureProduction", m.Name));
Microsoft.AspNetCore.App.Analyzers (72)
Authorization\AddAuthorizationBuilderAnalyzer.cs (1)
46.FirstOrDefault(member => member is { Name: "AddAuthorization", Parameters.Length: 2 });
Authorization\AuthorizationOptionsTypes.cs (4)
25.FirstOrDefault(member => member.Name == "DefaultPolicy"); 27.FirstOrDefault(member => member.Name == "FallbackPolicy"); 29.FirstOrDefault(member => member.Name == "InvokeHandlersAfterFailure"); 32.FirstOrDefault(member => member.Name == "GetPolicy");
Http\HeaderDictionaryAddAnalyzer.cs (5)
48Name: "Add", 51Name: "IDictionary", 54Name: "Generic", 57Name: "Collections", 60Name: "System",
Http\HeaderDictionaryIndexerAnalyzer.cs (4)
54Name: "IHeaderDictionary", 57Name: "Http", 60Name: "AspNetCore", 63Name: "Microsoft",
Kestrel\ListenOnIPv6AnyAnalyzer.cs (10)
103Name: "IPAddress", 104ContainingNamespace: { Name: "Net", ContainingNamespace: { Name: "System", ContainingNamespace.IsGlobalNamespace: true } } 112TargetMethod: { Name: "Listen" }, 115Name: "KestrelServerOptions", 118Name: "Core", 121Name: "Kestrel", 124Name: "Server", 127Name: "AspNetCore", 130Name: "Microsoft",
Mvc\DetectAmbiguousActionRoutes.cs (1)
127return actionSymbol.Name;
Mvc\DetectOverriddenAuthorizeAttribute.cs (5)
40ReportOverriddenAuthorizeAttributeDiagnosticsIfAny(context, authorizeAttributes, currentClass.Name); 42allowAnonClass = currentClass.Name; 74ReportOverriddenAuthorizeAttributeDiagnosticsIfAny(context, authorizeAttributes, currentMethod.ContainingType.Name, currentMethod.Name); 102ReportOverriddenAuthorizeAttributeDiagnosticsIfAny(context, authorizeAttributes.Where(a => a.IsTargetingMethod), currentClass.Name);
RenderTreeBuilder\RenderTreeBuilderAnalyzer.cs (1)
62&& targetMethod.Parameters[SequenceParameterOrdinal].Name == "sequence";
RouteEmbeddedLanguage\Infrastructure\RoutePatternParametersDetector.cs (2)
48return parameterSymbol.Name; // No route metadata attribute! 61return parameterSymbol.Name; // We have the attribute, but name isn't specified!
RouteEmbeddedLanguage\Infrastructure\RouteStringSyntaxDetector.cs (6)
338Name: "StringSyntaxAttribute", 341Name: nameof(CodeAnalysis), 344Name: nameof(System.Diagnostics), 347Name: nameof(System), 413var parameter = parameters.FirstOrDefault(p => p.Name == name); 493var parameter = parameters.FirstOrDefault(p => p.Name == name);
RouteEmbeddedLanguage\Infrastructure\RouteUsageDetector.cs (3)
160switch (mapMethodSymbol.Name) 262if (!method.Name.StartsWith("Map", StringComparison.Ordinal)) 316if (name == parameterSymbol.Name)
RouteEmbeddedLanguage\RoutePatternHighlighter.cs (1)
98.Where(i => i.Identifier.Text == matchingParameter.Name)
RouteHandlers\DetectAmbiguousRoutes.cs (7)
99return method.Name switch 111return method.Name is "RequireAuthorization" or "AllowAnonymous"; 115return method.Name switch 130return method.Name == "RequireCors"; 134return method.Name == "CacheOutput"; 138return method.Name is "RequireRateLimiting" or "DisableRateLimiting"; 196if (invocation.TargetMethod.Name == "MapGroup" &&
RouteHandlers\DetectMismatchedParameterOptionality.cs (1)
23var paramName = parameter.Name;
RouteHandlers\DetectMisplacedLambdaAttribute.cs (4)
50attribute.AttributeClass?.Name, 51methodSymbol.Name)); 60if (@namespace.Name.Equals("AspNetCore", System.StringComparison.Ordinal) && @namespace.ContainingNamespace.Name.Equals("Microsoft", System.StringComparison.Ordinal))
RouteHandlers\DisallowMvcBindArgumentsOnParameters.cs (2)
36var methodName = invocation.TargetMethod.Name; 41modelBindingAttribute.AttributeClass.Name,
RouteHandlers\DisallowNonParsableComplexTypesOnParameters.cs (6)
77handlerDelegateParameter.Name, 78parameterTypeSymbol.Name 92var resolvedParameter = routeUsage.UsageContext.ResolvedParameters.FirstOrDefault(rp => rp.Symbol.Name == handlerDelegateParameter.Name); 106parameter.Name, 107parameterTypeSymbol.Name
RouteHandlers\DisallowReturningActionResultFromMapMethods.cs (3)
50invocationOperation.TargetMethod.Name)); 84invocationOperation.TargetMethod.Name)); 91if (returnType is not INamedTypeSymbol { Name: "Task" or "ValueTask", IsGenericType: true, TypeArguments: { Length: 1 } } taskLike)
RouteHandlers\RouteHandlerAnalyzer.cs (1)
200return targetMethod.Name.StartsWith("Map", StringComparison.Ordinal) &&
src\Shared\Roslyn\MvcFacts.cs (3)
48if (!type.Name.EndsWith("Controller", StringComparison.OrdinalIgnoreCase) && 118if (method.Name != disposableDispose.Name)
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (2)
284.Where(node => string.Equals(node.Identifier.Value as string, operation.TargetMethod.Name, StringComparison.Ordinal)) 343if (!string.Equals(methodSymbol.Name, disallowedMethodName, StringComparison.Ordinal))
Microsoft.AspNetCore.Components.Analyzers (2)
ComponentInternalUsageDiagnosticAnalzyer.cs (1)
44if (@namespace == null || !string.Equals(NamespaceParts[i], @namespace.Name, StringComparison.Ordinal))
ComponentParameterUsageAnalyzer.cs (1)
108propertyReference.Member.Name));
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
ComponentInternalUsageDiagnosticAnalzyer.cs (1)
44if (@namespace == null || !string.Equals(NamespaceParts[i], @namespace.Name, StringComparison.Ordinal))
ComponentParameterUsageAnalyzer.cs (1)
108propertyReference.Member.Name));
Microsoft.AspNetCore.Http.RequestDelegateGenerator (16)
StaticRouteHandlerModel\Emitters\DiagnosticEmitter.cs (1)
45diagnostics.Add(Diagnostic.Create(DiagnosticDescriptors.InaccessibleTypesNotSupported, location, typeSymbol.Name));
StaticRouteHandlerModel\EndpointParameter.cs (11)
21public EndpointParameter(Endpoint endpoint, IParameterSymbol parameter, WellKnownTypes wellKnownTypes) : this(endpoint, parameter.Type, parameter.Name, wellKnownTypes) 30private EndpointParameter(Endpoint endpoint, IPropertySymbol property, IParameterSymbol? parameter, WellKnownTypes wellKnownTypes) : this(endpoint, property.Type, property.Name, wellKnownTypes) 45var propertyInfo = $"typeof({property.ContainingType.ToDisplayString()})!.GetProperty({SymbolDisplay.FormatLiteral(property.Name, true)})!"; 72LookupName = GetEscapedParameterName(fromRouteAttribute, symbol.Name); 79LookupName = GetEscapedParameterName(fromQueryAttribute, symbol.Name); 86LookupName = GetEscapedParameterName(fromHeaderAttribute, symbol.Name); 94LookupName = GetEscapedParameterName(fromFormAttribute, symbol.Name); 116endpoint.Diagnostics.Add(Diagnostic.Create(DiagnosticDescriptors.UnableToResolveParameterDescriptor, location, symbol.Name)); 214LookupName = symbol.Name; 482lookupTable.Add(new ParameterLookupKey(property.Name, property.Type), property); 497var key = new ParameterLookupKey(parameter.Name!, parameter.Type);
StaticRouteHandlerModel\InvocationOperationExtensions.cs (4)
30targetOperation.TargetMethod.ContainingNamespace is { Name: "Builder", ContainingNamespace: { Name: "AspNetCore", ContainingNamespace: { Name: "Microsoft", ContainingNamespace.IsGlobalNamespace: true } } } && 31targetOperation.TargetMethod.ContainingAssembly.Name is "Microsoft.AspNetCore.Routing" &&
Microsoft.AspNetCore.Mvc.Analyzers (12)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (3)
92attribute.AttributeClass.Name)); 106attribute.AttributeClass.Name)); 120attribute.AttributeClass.Name));
AvoidHtmlPartialAnalyzer.cs (2)
29if (string.Equals(SymbolNames.PartialMethod, method.Name, StringComparison.Ordinal)) 36else if (string.Equals(SymbolNames.RenderPartialMethod, method.Name, StringComparison.Ordinal))
src\Shared\Roslyn\MvcFacts.cs (3)
48if (!type.Name.EndsWith("Controller", StringComparison.OrdinalIgnoreCase) && 118if (method.Name != disposableDispose.Name)
TopLevelParameterNameAnalyzer.cs (4)
77parameter.Type.Name, 78parameter.Name)); 173return symbol.Name; 198if (string.Equals(constructorParameters[i].Name, "binderType", StringComparison.Ordinal))
Microsoft.AspNetCore.Mvc.Api.Analyzers (14)
ActualApiResponseMetadataFactory.cs (3)
261if (property.Name != statusCodeActionResultStatusProperty.Name) 284if (attributes[i].AttributeClass.Name == attributeName)
AddResponseTypeAttributeCodeFixAction.cs (2)
157field.Name.StartsWith("Status", StringComparison.Ordinal) && 161statusCodeConstants[statusCode] = field.Name;
ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzer.cs (1)
188if (propertyReference.Property.Name != "IsValid")
src\Shared\Roslyn\MvcFacts.cs (3)
48if (!type.Name.EndsWith("Controller", StringComparison.OrdinalIgnoreCase) && 118if (method.Name != disposableDispose.Name)
SymbolApiConventionMatcher.cs (4)
19if (!IsNameMatch(method.Name, conventionMethod.Name, methodNameMatchBehavior)) 49!IsNameMatch(methodParameters[i].Name, conventionParameter.Name, nameMatchBehavior))
SymbolApiResponseMetadataProvider.cs (1)
211if (string.Equals(parameter.Name, StatusCodeConstructorParameter, StringComparison.Ordinal) &&
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (26)
HubClientProxyGenerator.Parser.cs (11)
233sourceGenerationSpec.SetterMethodName = registerCallbackProviderMethodSymbol.Name; 234sourceGenerationSpec.SetterClassName = registerCallbackProviderClassSymbol.Name; 236sourceGenerationSpec.SetterTypeParameterName = registerCallbackProviderMethodSymbol.TypeParameters[0].Name; 237sourceGenerationSpec.SetterHubConnectionParameterName = registerCallbackProviderMethodSymbol.Parameters[0].Name; 238sourceGenerationSpec.SetterProviderParameterName = registerCallbackProviderMethodSymbol.Parameters[1].Name; 271providerSymbols[symbol.Name] = (symbol, memberAccess); 280TypeName = providerSymbol.Name, 297Name = member.Name 301if (!(member.ReturnsVoid || member.ReturnType is INamedTypeSymbol { Arity: 0, Name: "Task" })) 306methodSpec.Name, member.ReturnType.Name)); 316Name = parameter.Name,
HubServerProxyGenerator.Parser.cs (15)
222sourceGenerationSpec.GetterMethodName = getProxyMethodSymbol.Name; 223sourceGenerationSpec.GetterClassName = getProxyClassSymbol.Name; 225sourceGenerationSpec.GetterTypeParameterName = getProxyMethodSymbol.TypeParameters[0].Name; 226sourceGenerationSpec.GetterHubConnectionParameterName = getProxyMethodSymbol.Parameters[0].Name; 248hubSymbols[symbol.Name] = (symbol, memberAccess); 257ClassTypeName = $"Generated{hubSymbol.Name}", 274Name = member.Name, 283if (member.ReturnType is INamedTypeSymbol { Arity: 1, Name: "Task" } a 284&& a.TypeArguments[0] is INamedTypeSymbol { Arity: 1, Name: "ChannelReader" } b) 289else if (member.ReturnType is INamedTypeSymbol { Arity: 1, Name: "IAsyncEnumerable" } c) 304Name = parameter.Name, 312case INamedTypeSymbol { Arity: 1, Name: "ChannelReader" }: 315case INamedTypeSymbol { Arity: 1, Name: "IAsyncEnumerable" }: 323member.ReturnType is not INamedTypeSymbol { Name: "Task" or "ValueTask" }) 328methodSpec.Name, member.ReturnType.Name));
Microsoft.CodeAnalysis (31)
CommandLine\CommonCompiler.cs (1)
626foreach (var assembly in currentAssembly.Modules.First().ReferencedAssemblySymbols.OrderBy(a => a.Name))
Compilation\Compilation.cs (4)
3232pePdbFilePath = pePdbFilePath ?? FileNameUtilities.ChangeExtension(SourceModule.Name, "pdb"); 3436pdbFilePath ?? FileNameUtilities.ChangeExtension(SourceModule.Name, "pdb"), 3656return string.Format("{0}: {1} {2} -> {3} {4}", this.AssemblyName, source.TypeKind.ToString(), source.Name, destination.TypeKind.ToString(), destination.Name);
DiagnosticAnalyzer\AnalysisContextInfo.cs (2)
88if (_symbol?.Name != null) 90sb.AppendLine($"{nameof(ISymbol)}: {_symbol.Name} ({_symbol.Kind})");
DiagnosticAnalyzer\AnalyzerDriver.cs (2)
2911declaredSymbol.Name == otherSymbol.Name &&
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
552if (methodContext.TypeParameters[i].Name == typeParameterName) 564if (containingType.TypeParameters[i].Name == typeParameterName)
DiagnosticAnalyzer\SymbolDeclaredCompilationEvent.cs (1)
51var name = Symbol.Name;
DocumentationCommentId.cs (7)
425_builder.Append(EncodeName(symbol.Name)); 436_builder.Append(EncodeName(symbol.Name)); 447var name = EncodePropertyName(symbol.Name); 460_builder.Append(EncodeName(symbol.Name)); 517_builder.Append(EncodeName(symbol.Name)); 528_builder.Append(EncodeName(symbol.Name)); 564_builder.Append(EncodeName(symbol.Name));
Operations\ControlFlowGraphBuilder.cs (1)
3338foreach (ISymbol candidate in valueType.GetMembers(method.Name))
SymbolDisplay\AbstractSymbolDisplayVisitor.cs (3)
196if (!ctor.Parameters.Any() && type.Name == "FlagsAttribute") 200containingSymbol.Name == "System" && 324var enumField = new EnumField(field.Name, underlyingSpecialType.ConvertUnderlyingValueToUInt64(field.ConstantValue), field);
SymbolDisplay\AbstractSymbolDisplayVisitor_Minimal.cs (3)
26? SemanticModelOpt.LookupNamespacesAndTypes(PositionOpt, name: symbol.Name) 27: SemanticModelOpt.LookupSymbols(PositionOpt, name: symbol.Name); 44ImmutableArray<ISymbol> typeOnlySymbols = SemanticModelOpt.LookupNamespacesAndTypes(PositionOpt, name: symbol.Name);
Symbols\ISymbolExtensions.cs (5)
90return field.IsTupleElement() && !field.IsImplicitlyDeclared ? field.Name : null; 127Name: WellKnownMemberNames.LockTypeName, 132Name: nameof(System.Threading), 135Name: nameof(System), 152if (scopeType is not INamedTypeSymbol { Name: WellKnownMemberNames.LockScopeTypeName, Arity: 0, IsValueType: true, IsRefLikeType: true, DeclaredAccessibility: Accessibility.Public } ||
Microsoft.CodeAnalysis.CodeStyle (161)
src\Analyzers\Core\Analyzers\ConvertTypeofToNameof\AbstractConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
65var parentProperty = operationParent.Property.Name;
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (1)
116if (conversion.IsUserDefined && conversion.MethodSymbol is { Name: WellKnownMemberNames.ImplicitConversionName })
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (1)
64if (owningSymbol is not IMethodSymbol { Name: nameof(GetHashCode) } method)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.OperationDeconstructor.cs (1)
78if (targetMethod.Name == nameof(GetHashCode) &&
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (4)
118if (string.IsNullOrEmpty(symbol.Name)) 149if (!cache.TryGetValue(symbol.Name, out var failureReason)) 151if (applicableRule.NamingStyle.IsNameCompliant(symbol.Name, out failureReason)) 156cache.TryAdd(symbol.Name, failureReason);
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
832attribute.AttributeConstructor?.Parameters is [_, { Name: "checkId", Type.SpecialType: SpecialType.System_String }, ..] && 840if (attribute.AttributeConstructor.Parameters[0].Name == "category" &&
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\SuppressMessageAttributeState.cs (1)
65builder.Add((propertyReference.Property.Name, simpleAssignment.Value));
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (5)
533if (debuggerDisplayAttributeArguments.Any(arg => arg.Contains(member.Name))) 857&& methodSymbol.Name is "GetAwaiter" or "GetResult") 872if (_iNotifyCompletionType != null && memberSymbol.ContainingType.AllInterfaces.Contains(_iNotifyCompletionType) && memberSymbol.Name == "IsCompleted") 904if (methodSymbol.Name.StartsWith(prefix)) 906var suffix = methodSymbol.Name[prefix.Length..];
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (2)
141parameter.Name, 205parameter.Name == DiscardVariableName ||
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (6)
81if (expression is IInvocationOperation { TargetMethod.Name: nameof(ToString) } invocation && 128&& method.Name == nameof(ToString); 143if (member.Name == nameof(CultureInfo.InvariantCulture)) 146if (member.Name == "InvariantInfo") 166TargetMethod: { Name: nameof(FormattableString.Invariant), ContainingType: var containingType }, 199var targetName = invocation.TargetMethod.Name;
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (2)
107if (s_nonEnumerableReturningLinqPredicateMethodNames.Contains(method.Name) || 108s_nonEnumerableReturningLinqSelectorMethodNames.Contains(method.Name))
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (3)
147fieldNames.Add(field.Name); 474static (field, property) => field.Name.EndsWith(property.Name, StringComparison.OrdinalIgnoreCase),
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
174syntaxFacts.GetIdentifierOfIdentifierName(identifier).ValueText == localSymbol.Name)
src\Analyzers\Core\Analyzers\UseExplicitTupleName\UseExplicitTupleNameDiagnosticAnalyzer.cs (3)
62nameof(ElementName), namedField.Name); 87!fieldSymbol.Name.Equals(unnamedField.Name))
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (1)
25Name: nameof(Nullable<int>.Value),
src\Analyzers\Core\Analyzers\UseObjectInitializer\UseNamedMemberInitializerAnalyzer.cs (1)
168statement, leftMemberAccess, rightExpression, typeMember?.Name ?? identifier.ValueText));
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
248if (p.Name == searchArgumentName)
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
552if (methodContext.TypeParameters[i].Name == typeParameterName) 564if (containingType.TypeParameters[i].Name == typeParameterName)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IMethodSymbolExtensions.cs (2)
73=> symbol.Name switch 103=> methodSymbol.Name is WellKnownMemberNames.EntryPointMethodName or WellKnownMemberNames.TopLevelStatementsEntryPointMethodName &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (9)
71return type.GetBaseTypesAndThis().SelectMany(t => t.GetMembers(symbol.Name)) 466if (namedParameter != null && seenNames.Add(namedParameter.Name)) 600comparer.Equals(member.Name, kvp.Key.Name) && 660Name: nameof(Equals), 673Name: "CollectionBuilderAttribute", 676Name: nameof(System.Runtime.CompilerServices), 679Name: nameof(System.Runtime), 682Name: nameof(System),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamespaceOrTypeSymbolExtensions.cs (1)
82result.Add(namespaceOrTypeSymbol.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IParameterSymbolExtensions.cs (1)
42foreach (var member in containingType.GetMembers(parameter.Name))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (16)
109foreach (var member in baseType.GetMembers(symbol.Name)) 671=> symbol.Name == WellKnownMemberNames.GetAwaiter && 683if (!returnType.GetMembers().OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.IsCompleted && p.Type.SpecialType == SpecialType.System_Boolean && p.GetMethod != null)) 697if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }])) 701return methods.Any(m => m.Name == WellKnownMemberNames.GetResult && !m.Parameters.Any()); 705=> symbol.Name == WellKnownMemberNames.GetEnumeratorMethodName && 722if (!members.OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.CurrentPropertyName && p.GetMethod != null)) 732Name: WellKnownMemberNames.MoveNextMethodName, 745=> symbol.Name == WellKnownMemberNames.GetAsyncEnumeratorMethodName && 762if (!members.OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.CurrentPropertyName && p.GetMethod != null)) 771if (!members.OfType<IMethodSymbol>().Any(x => x.Name == WellKnownMemberNames.MoveNextAsyncMethodName)) 797=> symbol.Name.StartsWith("_") && 798(symbol.Name.Length == 1 || uint.TryParse(symbol.Name[1..], out _) || symbol.Name.All(n => n.Equals('_'))); 809ContainingNamespace.Name: nameof(System),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (8)
236b.ContainingNamespace.Name == "System" && 251&& symbol.ContainingNamespace?.Name == "System" 713if (attributeData.AttributeClass?.Name == nameof(ReferenceAssemblyAttribute) 749Name: nameof(Span<int>), 751ContainingNamespace: { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true } 757Name: nameof(ReadOnlySpan<int>), 759ContainingNamespace: { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true } 772return type?.RemoveUnavailableTypeParameters(compilation, availableTypeParameters.Select(t => t.Name).ToSet());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
83symbol = updatedContainingType.GetTypeMembers(symbol.Name, symbol.Arity).First(m => m.TypeKind == symbol.TypeKind);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
64if (availableTypeParameterNames.Contains(symbol.Name))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
41if (symbol.IsErrorType() && symbol.Name == string.Empty)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (1)
23var baseName = RemovePrefixesAndSuffixes(symbol, rules, symbol.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (1)
94var implementedInterfaceMembersWithSameName = implementedInterface.GetMembers(symbol.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (2)
20visitor.WriteString(symbol.Name); 71if (aliasSymbol.Name == name &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousTypeSymbolKey.cs (1)
24var propertyNames = properties.SelectAsArray(p => p.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (4)
56var localName = symbol.Name; 244if (!SymbolKey.Equals(reader.Compilation, name, symbol.Name)) 246reason = $"location {index} did not match name: {symbol.Name} != {name}"; 267SymbolKey.Equals(semanticModel.Compilation, symbol.Name, localName))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BuiltinOperatorSymbolKey.cs (1)
19visitor.WriteString(symbol.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
70/// the "same" <see cref="ISymbol.Name"/>.</item> 77/// cref="SyntaxTree"/> is enumerated to list all the symbols with the same <see cref="ISymbol.Name"/> and <see
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ErrorTypeSymbolKey.cs (3)
19visitor.WriteString(symbol.Name); 56while (namespaceSymbol != null && namespaceSymbol.Name != "") 58builder.Add(namespaceSymbol.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (2)
20visitor.WriteString(symbol.Name); 118if (errorType.Name != name || errorType.Arity != arity)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.PreprocessingSymbolKey.cs (1)
14=> visitor.WriteString(symbol.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
31friendlyNames.Add(element.IsImplicitlyDeclared ? null : element.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
457symbol.Name == newSymbol.Name && 462return symbol.Name == newSymbol.Name; 465return symbol.Name == newSymbol.Name; 472return symbol.Name == newSymbol.Name && 480return symbol.Name == newSymbol.Name && 1124var parameter1 = signature1Parameters.FirstOrDefault(p => p.Name == name); 1127var parameter2 = signature2Parameters.FirstOrDefault(p => p.Name == name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
47AttributeClass.Name: "InterceptsLocationAttribute",
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (6)
49=> IdentifiersMatch(event1.Name, event2.Name, caseSensitive); 53if (!IdentifiersMatch(property1.Name, property2.Name, caseSensitive) || 85if (!IdentifiersMatch(method1.Name, method2.Name, caseSensitive))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.AssemblyComparers.cs (3)
16=> AssemblyIdentityComparer.SimpleNameComparer.Equals(x?.Name, y?.Name); 19=> obj is null ? 0 : AssemblyIdentityComparer.SimpleNameComparer.GetHashCode(obj.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (27)
154x.Name == y.Name && 162x.Name == y.Name && 209x.Name != y.Name) 278=> AssembliesAreEquivalent(x.ContainingAssembly, y.ContainingAssembly) && x.Name == y.Name; 359x.Name != y.Name || 376if (xNamespace.Name != yNamespace.Name) 381if (xNamespace.Name == "") 399!AssemblyIdentityComparer.SimpleNameComparer.Equals(x.ContainingAssembly.Name, y.ContainingAssembly.Name) && 435if (xElement.Name != yElement.Name) 535if (p1.Name != p2.Name || 550x.Name != y.Name) 568x.Name == y.Name && 611x.Name == y.Name && 659=> x.Name == y.Name;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (11)
92Hash.Combine(x.Name, 99Hash.Combine(x.Name, 124Hash.Combine(x.Name, currentHash))))))); 141=> CombineHashCodes(x.ContainingAssembly, Hash.Combine(x.Name, currentHash)); 174Hash.Combine(x.Name, 202return Hash.Combine(p.Name, 214return Hash.Combine(x.Name, currentHash); 219Hash.Combine(x.Name, 227Hash.Combine(x.Name, 243Hash.Combine(x.Name, 255Hash.Combine(x.Name,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.ParameterSymbolEqualityComparer.cs (4)
39x.Name == y.Name 40: string.Equals(x.Name, y.Name, StringComparison.OrdinalIgnoreCase);
Microsoft.CodeAnalysis.CodeStyle.Fixes (119)
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
202if (argumentName.Equals(parameters[j].Name))
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
440methodParameterNames.AddRange(method.Parameters.Select(p => p.Name));
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (2)
202[new ParameterName(parameter.Name, isFixed: true)], 234var uniqueName = NameGenerator.EnsureUniqueness(argumentNameSuggestion, method.Parameters.Select(p => p.Name));
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (3)
56var typeName = symbol.Name; 116if (string.IsNullOrEmpty(current.Name)) 119result.Add(current.Name);
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (6)
169delegatedConstructor.Parameters.Select(p => p.Name).ToList(), 175if (delegatedConstructor.Parameters.Select(p => p.Name).Intersect(remainingParameterNames.Select(n => n.BestNameForParameter)).Any()) 270? ctorParameter.Name == parameterName 271: string.Equals(ctorParameter.Name, parameterName, StringComparison.OrdinalIgnoreCase); 447typeName: TypeToGenerateIn.Name, 506TypeToGenerateIn.Name,
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.cs (2)
54state.ClassType.Name, 55string.Join(", ", constructor.Parameters.Select(p => p.Name))),
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\GenerateDefaultConstructorsCodeAction.cs (1)
67typeName: classType.Name,
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (2)
194isColorColorCase = typeInfo.Type != null && semanticInfo.Symbol != null && semanticInfo.Symbol.Name == typeInfo.Type.Name;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (1)
238var typeLocalName = parameter.Type.GetLocalName(fallback: parameter.Name);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (1)
74name: typeParameter.Name,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (1)
61if (_availableTypeParameterNames.Contains(symbol.Name))
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
181return ContainingMethod is { IsImplicitlyDeclared: false, Name: not WellKnownMemberNames.TopLevelStatementsEntryPointMethodName }
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
258generator.MemberAccessExpression(throughExpression, @event.Name),
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (2)
94return string.Format(CodeFixesResources.Implement_interface_through_0, options.ThroughMember.Name); 122options.ThroughMember?.Name;
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.cs (2)
115memberName: interfaceMember.Name, 116generateInvisibly: generator.ShouldGenerateInvisibleMember(document.Project.ParseOptions!, interfaceMember, interfaceMember.Name, supportsImplementingLessAccessibleMember),
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
110if (name == parameter.Name)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (7)
164if (IsReservedName(member.Name) || 170string.Format("{0}_{1}", member.ContainingType.Name, member.Name), 176return member.Name; 208memberName = generateInvisibleMember ? member.Name : memberName; 244if (member.Name != memberName) 299var accessibility = member.Name == memberName || generateAbstractly
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Conflicts.cs (2)
51if (!IdentifiersMatch(member1.Name, member2.Name))
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (3)
168g.IdentifierName(disposedValueField.Name), g.TrueLiteralExpression())); 171g.LogicalNotExpression(g.IdentifierName(disposedValueField.Name)), 179name: disposeMethod.Name,
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Method.cs (1)
64conflictingMethod.Name),
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
86symbol.Name,
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (3)
63var isEntryPoint = methodSymbol.IsStatic && IsLikelyEntryPointName(methodSymbol.Name, document); 132if (methodSymbol.Name.EndsWith(AsyncSuffix)) 162var name = methodSymbol.Name;
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (3)
62methodSymbol.Name.Length > AsyncSuffix.Length && 63methodSymbol.Name.EndsWith(AsyncSuffix)) 75var name = methodSymbol.Name;
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (1)
86var fixedNames = style.MakeCompliant(symbol.Name);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
181let caseLabel = (TMemberAccessExpression)generator.MemberAccessExpression(generator.TypeExpression(enumType), e.Name).WithAdditionalAnnotations(Simplifier.Annotation)
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
585var declarationStatement = CreateLocalDeclarationStatement(declaredLocal.Type, declaredLocal.Name);
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
46var title = string.Format(TitleFormat, type.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (6)
47if (!ctor.Parameters.Any() && type.Name == "FlagsAttribute") 51containingSymbol.Name == "System" && 143if (IsValidName(enumType, field.Name)) 147generator.IdentifierName(field.Name)); 220: -x.field.Name.CompareTo(y.field.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (8)
52if (info.Context.GenerateMembers && info.Context.MergeNestedNamespaces && @namespace.Name != string.Empty) 56@namespace.Name 66names.Add(childNamespace.Name); 78name = @namespace.Name; 401Name: "NullableAttribute" or "NullableContextAttribute" or "NativeIntegerAttribute" or "DynamicAttribute", 404Name: nameof(System.Runtime.CompilerServices), 407Name: nameof(System.Runtime), 410Name: nameof(System),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (6)
307name.HasValue ? name.Value : parameter.Name, 375accessor.Name, 536name ?? method.Name, 565name ?? property.Name, 589name ?? @event.Name, 606name ?? field.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\INamedTypeSymbolExtensions.cs (1)
26namedType.Name,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructorInfo.cs (1)
84=> info == null ? constructor.ContainingType.Name : info._typeName;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationDestructorInfo.cs (1)
52=> info == null ? constructor.ContainingType.Name : info._typeName;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
92return this.GetMembers().Select(m => m.Name).ToList();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (6)
31.Concat(method.Name) 32.Concat(containingType.Name); 47if (method.TypeParameters.Select(t => t.Name).SequenceEqual(newNames)) 70method.Name, 81if (parameterList.Select(p => p.Name).SequenceEqual(parameterNames)) 96method.Name,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IParameterSymbolExtensions.cs (2)
24return parameter.Name == parameterName 46parameter.Name,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IPropertySymbolExtensions.cs (3)
18if (parameterList.Select(p => p.Name).SequenceEqual(parameterNames)) 33property.Name, 59property.Name,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\KnownTypes.cs (1)
35return returnType.Name is "Task" or "ValueTask";
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (20)
70return factory.Argument(parameter.RefKind, factory.IdentifierName(parameter.Name)); 108? generator.GenericName(method.Name, method.TypeArguments) 109: generator.IdentifierName(method.Name)); 120var name = generator.IdentifierName(throughMember.Name); 172generator.IdentifierName(explicitlyImplementedProperty.Name)); 186? factory.GenericName(classOrStructType.Name, classOrStructType.TypeArguments) 187: factory.IdentifierName(classOrStructType.Name); 205throughExpression, generator.IdentifierName(property.Name)); 224return [generator.ReturnStatement(generator.MemberAccessExpression(generator.ThisExpression(), property.Name))]; 244throughExpression, generator.IdentifierName(property.Name)); 265return [generator.ExpressionStatement(generator.AssignmentStatement(generator.MemberAccessExpression(generator.ThisExpression(), property.Name), generator.IdentifierName(parameter.Name)))]; 284value = symbol.Name; 299TryGetValue(parameterToNewFieldMap, parameter.Name, out var fieldName)) 321TryGetValue(parameterToNewPropertyMap, parameter.Name, out var propertyName)) 360var parameterName = parameter.Name; 430factory.IdentifierName(parameter.Name)))); 440factory.IdentifierName(parameter.Name), 453factory.IdentifierName(parameter.Name))).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation); 462var condition = factory.CreateNullCheckExpression(generatorInternal, semanticModel, parameter.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
231var symbolNameExpression = factory.IdentifierName(member.Name); 370var name = containingType.Name;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (3)
101initHash = initHash * hashFactor + Hash.GetFNVHashCode(baseHashCode.Name); 106initHash = initHash * hashFactor + Hash.GetFNVHashCode(symbol.Name); 226factory.IdentifierName(member.Name)).WithAdditionalAnnotations(Simplification.Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
446if (property.Name is nameof(Array.Length) or nameof(Array.LongLength))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (2)
153generator.IdentifierName(fieldOrProperty.Name)), 154generator.IdentifierName(parameter.Name)));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (1)
222if (syntaxFacts.StringComparer.Equals(name, localSymbol.Name))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (1)
83return GenerateUniqueName(baseName, filteredCandidates.Select(s => s.Name).Concat(usedNames));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
124symbol.Name == nameof(Enum.HasFlag) &&
Microsoft.CodeAnalysis.CSharp (49)
Compilation\CSharpCompilation.cs (1)
1460return current.GetNestedNamespace(namespaceSymbol.Name);
Compiler\DocumentationCommentCompiler.cs (1)
79/// <param name="assemblyName">Assembly name override, if specified. Otherwise the <see cref="ISymbol.Name"/> of the source assembly is used.</param>
SymbolDisplay\SymbolDisplayVisitor.cs (9)
162Builder.Add(CreatePart(SymbolDisplayPartKind.ModuleName, symbol, symbol.Name)); 200Builder.Add(CreatePart(SymbolDisplayPartKind.NamespaceName, symbol, symbol.Name)); 275Builder.Add(CreatePart(SymbolDisplayPartKind.ConstantName, symbol, symbol.Name)); 279Builder.Add(CreatePart(SymbolDisplayPartKind.LocalName, symbol, symbol.Name)); 324Builder.Add(CreatePart(SymbolDisplayPartKind.RangeVariableName, symbol, symbol.Name)); 329Builder.Add(CreatePart(SymbolDisplayPartKind.LabelName, symbol, symbol.Name)); 334Builder.Add(CreatePart(SymbolDisplayPartKind.AliasName, symbol, symbol.Name)); 347var part = new SymbolDisplayPart(SymbolDisplayPartKind.Text, symbol, symbol.Name); 468&& symbol.Name != WellKnownMemberNames.EnumBackingFieldName;
SymbolDisplay\SymbolDisplayVisitor.Members.cs (22)
72Builder.Add(CreatePart(SymbolDisplayPartKind.EnumMemberName, symbol, symbol.Name)); 76Builder.Add(CreatePart(SymbolDisplayPartKind.ConstantName, symbol, symbol.Name)); 80Builder.Add(CreatePart(SymbolDisplayPartKind.FieldName, symbol, symbol.Name)); 201bool getMemberNameWithoutInterfaceName = symbol.Name.LastIndexOf('.') > 0; 215ExplicitInterfaceHelpers.GetMemberNameWithoutInterfaceName(symbol.Name))); 219this.Builder.Add(CreatePart(SymbolDisplayPartKind.PropertyName, symbol, symbol.Name)); 265if (symbol.Name.LastIndexOf('.') > 0) 270ExplicitInterfaceHelpers.GetMemberNameWithoutInterfaceName(symbol.Name))); 274this.Builder.Add(CreatePart(SymbolDisplayPartKind.EventName, symbol, symbol.Name)); 428Builder.Add(CreatePart(SymbolDisplayPartKind.MethodName, symbol, symbol.Name)); 435Builder.Add(CreatePart(SymbolDisplayPartKind.ExtensionMethodName, symbol, symbol.Name)); 474? symbol.Name 475: symbol.ContainingType.Name; 489Builder.Add(CreatePart(partKind, symbol, symbol.Name)); 494Builder.Add(CreatePart(partKind, symbol, symbol.ContainingType.Name)); 525ExplicitInterfaceHelpers.GetMemberNameWithoutInterfaceName(symbol.Name))); 541Builder.Add(CreatePart(SymbolDisplayPartKind.MethodName, symbol, symbol.Name)); 562Builder.Add(CreatePart(SymbolDisplayPartKind.MethodName, symbol, symbol.Name)); 625Debug.Assert(conventionType.Name.StartsWith("CallConv")); 627Builder.Add(CreatePart(SymbolDisplayPartKind.ClassName, conventionType, conventionType.Name[CallConvLength..])); 798var includeName = symbol.Name.Length != 0 && (Format.ParameterOptions.IncludesOption(SymbolDisplayParameterOptions.IncludeName) || 858Builder.Add(CreatePart(kind, symbol, symbol.Name));
SymbolDisplay\SymbolDisplayVisitor.Types.cs (5)
164Builder.Add(CreatePart(SymbolDisplayPartKind.TypeParameterName, symbol, symbol.Name)); 171Builder.Add(CreatePart(SymbolDisplayPartKind.Keyword, symbol, symbol.Name)); 371symbolName ??= symbol.Name; 564Builder.Add(CreatePart(SymbolDisplayPartKind.FieldName, element, element.Name)); 582return property.Type.ToDisplayString(Format) + " " + property.Name;
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (5)
30var aliasName = alias.Name; 78? SemanticModelOpt.LookupNamespacesAndTypes(PositionOpt, name: symbol.Name) 79: SemanticModelOpt.LookupSymbols(PositionOpt, name: symbol.Name); 113Builder.Add(CreatePart(SymbolDisplayPartKind.NamespaceName, symbol, symbol.Name)); 254var identifierName = SyntaxFactory.IdentifierName(symbol.Name);
Symbols\ModuleSymbol.cs (1)
361return cns.GetNestedNamespace(namespaceSymbol.Name);
Symbols\PublicModel\AssemblySymbol.cs (1)
70var myKeys = UnderlyingAssemblySymbol.GetInternalsVisibleToPublicKeys(assemblyWantingAccess.Name);
Symbols\TypedConstantExtensions.cs (4)
100return typeName + "." + field.Name; 122valueStringBuilder.Append(field.Name); 178return typeName + "." + field.Name; 200valueStringBuilder.Append(field.Name);
Microsoft.CodeAnalysis.CSharp.CodeStyle (48)
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
366var variableName = outSymbol.Name;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (1)
142if (createMethod.Parameters is [{ Name: "capacity" or "initialCapacity" }, ..])
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (3)
173if (expressionType is null || expressionType.Name.EndsWith("Builder", StringComparison.Ordinal)) 390if (BannedTypes.Contains(member?.ContainingType.Name)) 395if (BannedTypes.Contains(type?.Name))
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
55parameter.Type.Name != nameof(IEnumerable<int>))
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (11)
196convertedType.Name == nameof(ReadOnlySpan<int>) && 200convertedType.Name == nameof(Span<int>) && 209type.Name == nameof(Span<int>) && 267if (type.Name is nameof(ObservableCollection<int>) or nameof(ReadOnlyObservableCollection<int>)) 354var capacityConstructor = GetAccessibleInstanceConstructor(constructors, c => c.Parameters is [{ Name: "capacity", Type.SpecialType: SpecialType.System_Int32 }]); 554if (identifier.Identifier.ValueText != local.Name) 929if (originalCreateMethod.Name is CreateRangeName) 936Name: nameof(IEnumerable<int>), 946else if (originalCreateMethod.Name is CreateName) 983Name: nameof(Span<int>) or nameof(ReadOnlySpan<int>), 1052if (BannedTypes.Contains(type.Name))
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (1)
82else if (firstParameter is { Type.SpecialType: SpecialType.System_Int32, Name: "capacity" })
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
207if (symbol?.Name == nameof(ReferenceEquals) &&
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (4)
208.Select(s => s.Name) 209.Concat(existingSymbols.Select(s => s.Name)) 214if (reservedNames.Contains(element.Name)) 250var localName = local.Name;
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (1)
111.GetMembers(method.Name)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (6)
16=> method is { ContainingType.SpecialType: SpecialType.System_String, Name: nameof(string.Remove) }; 119(parameter.Name == "start" || parameter.Name == "startIndex"); 123(parameter.Name == "count" || parameter.Name == "length"); 148: method.ContainingType.GetMembers(method.Name)
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
257if (identifierName.Identifier.ValueText == local.Name &&
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
353var variableName = _localSymbol.Name;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
181if (identifierName.Identifier.ValueText == asOperand?.Name &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (5)
158returnType.Name is not nameof(Task) and not nameof(ValueTask) && 159UnwrapTupleType(containingType).Name.Equals(returnType.Name) && 177: returnType.Name; 179return methodSymbol.Name.Equals("To" + returnTypeName, StringComparison.Ordinal);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ConversionExtensions.cs (1)
20conversion.MethodSymbol.Name == "op_Implicit";
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ILocalSymbolExtensions.cs (2)
21HasTypeParameterWithName(localFunctionOrMethodDeclaration, localSymbol.Type.Name) && 22HasTypeParameterWithName(localFunctionStatement, localSymbol.Type.Name))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (2)
448if (SyntaxFacts.GetContextualKeywordKind(parameter.Name) is not SyntaxKind.UnderscoreToken) 450return parameter.Name;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\TypeSyntaxExtensions.cs (1)
44if (type.Name == "var")
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
1465if (originalParameter.Name != rewrittenParameter.Name &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
324Name: nameof(Func<int>) or nameof(Action<int>), 325ContainingSymbol: INamespaceSymbol { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true }
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (65)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (1)
162generator.IdentifierName(parameter.Name),
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (2)
224if (methodSymbol.Name == "Clone") 766yield return XmlParamElement(result.Symbol.Name, XmlEmptyElement(
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (5)
28if (methodSymbol.Name == nameof(Equals) && 45TargetMethod: IMethodSymbol { Name: nameof(Equals) }, 80if (methodSymbol.Name == nameof(GetHashCode) && 631TargetMethod.Name: nameof(Equals), 768TargetMethod.Name: nameof(Equals),
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
123title = string.Format(titleFormat, $"{memberContainer}.{matchingMember.Name}");
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (1)
98usedIdentifiers.Add(typeParameter.Name);
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
103var methodDecl = SyntaxFactory.DestructorDeclaration(classType.Name).AddBodyStatements(disposeStatement);
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (3)
122if (parameter.Name == capture.Name) 141(node, generator) => IdentifierName(parameter.Name.ToIdentifierToken()).WithTriviaFrom(node));
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
225var parameter = method.Parameters.Where(p => p.Name == identifier.Text).FirstOrDefault();
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
163e => SingleVariableDesignation(Identifier(e.Name.EscapeIdentifier())))]));
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
98return returnType.Name != nameof(Task);
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
248PromoteParameter(generator, Parameter(parameter.Name.ToIdentifierToken()), parameter))]);
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (2)
175var orderedKVPs = properties.OrderBy(kvp => constructor.Parameters.FirstOrDefault(p => p.Name == kvp.Value)?.Ordinal); 179var (removedMember, (memberDeclaration, _)) = removedMembers.FirstOrDefault(kvp => kvp.Key.Name == memberName);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (2)
30attributes.OrderBy(a => a.AttributeClass?.Name) 42attributes.OrderBy(a => a.AttributeClass?.Name)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (1)
66var member = EnumMemberDeclaration(enumMember.Name.ToIdentifierToken())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EventGenerator.cs (2)
124[VariableDeclarator(@event.Name.ToIdentifierToken())])))); 138identifier: @event.Name.ToIdentifierToken(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (1)
105[AddAnnotationsTo(field, VariableDeclarator(field.Name.ToIdentifierToken(), null, initializer))]));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (7)
131identifier: method.Name.ToIdentifierToken(), 153Name: nameof(EnumeratorCancellationAttribute), 154ContainingNamespace.Name: nameof(System.Runtime.CompilerServices), 155ContainingNamespace.ContainingNamespace.Name: nameof(System.Runtime), 156ContainingNamespace.ContainingNamespace.ContainingNamespace.Name: nameof(System), 171identifier: method.Name.ToIdentifierToken(), 263typeParameter.Name.ToIdentifierName(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (4)
203RecordKeyword, classOrStructKeyword, namedType.Name.ToIdentifierToken(), 212typeDeclaration = TypeDeclaration(kind, namedType.Name.ToIdentifierToken()); 237namedType.Name.ToIdentifierToken(), 255namedType.Name.ToIdentifierToken(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamespaceGenerator.cs (1)
158NameEquals(alias.Name.ToIdentifierName()),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\OperatorGenerator.cs (1)
84throw new ArgumentException(string.Format(WorkspaceExtensionsResources.Cannot_generate_code_for_unsupported_operator_0, method.Name), nameof(method));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ParameterGenerator.cs (1)
68return Parameter(parameter.Name.ToIdentifierToken())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (1)
129identifier: property.Name.ToIdentifierToken(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\TypeParameterGenerator.cs (1)
36symbol.Name.ToIdentifierToken());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (3)
114_importedTypes.Add((type.Name, type.Arity), ns); 121_importedExtensionMethods.Add(method.Name, ns); 256foreach (var conflictingSymbol in _importedExtensionMethods[method.Name])
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (1)
89typeParameter.Name.ToIdentifierName(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (1)
87var syntax = AddInformationTo(symbol.Name.ToIdentifierName(), symbol);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (9)
48=> AddInformationTo(symbol.Name.ToIdentifierName(), symbol); 149? null : symbol.Signature.UnmanagedCallingConventionTypes.Select(type => GetConventionForString(type.Name["CallConv".Length..])), 188if (symbol.Name == string.Empty || symbol.IsAnonymousType) 195if (symbol.TypeKind == TypeKind.Error && symbol.Name == "var") 200return symbol.Name.ToIdentifierName(); 208symbol.Name.ToIdentifierToken(), 256var name = element.IsImplicitlyDeclared ? default : Identifier(element.Name); 320var syntax = AddInformationTo(symbol.Name.ToIdentifierName(), symbol); 362TypeSyntax typeSyntax = AddInformationTo(symbol.Name.ToIdentifierName(), symbol);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (4)
38(otherSideType.Name == string.Empty || otherSideType.Name == "var"); 780.Where(p => p.Name == name) 2220if (descendant.Identifier.ValueText != symbol.Name)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\CSharpInitializeParameterService.cs (2)
62var left = (ArgumentSyntax)generator.Argument(generator.MemberAccessExpression(generator.ThisExpression(), generator.IdentifierName(fieldOrProperty.Name))); 63var right = (ArgumentSyntax)generator.Argument(generator.IdentifierName(parameter.Name));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (3)
44var initializer = EqualsValueClause(IdentifierName(parameter.Name.EscapeIdentifier())); 122identifierName.Identifier.ValueText == parameter.Name) 128IdentifierName(fieldOrProperty.Name.EscapeIdentifier()).WithTriviaFrom(identifierName));
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (3)
src\Analyzers\CSharp\Tests\NamingStyles\NamingStylesTests.cs (3)
1448Assert.Equal("c", symbolRenamedOperation._symbol.Name); 1473Assert.Equal("test", symbolRenamedOperation._symbol.Name); 1503Assert.Equal("arg", symbolRenamedOperation._symbol.Name);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (3)
EventHookup\EventHookupSessionManager_EventHookupSession.cs (3)
207var basename = namingRule.NamingStyle.CreateName([string.Format("{0}_{1}", objectPart, eventSymbol.Name)]); 209var reservedNames = semanticModel.LookupSymbols(plusEqualsToken.SpanStart).Select(m => m.Name); 257: eventSymbol.ContainingType.Name;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (14)
SymbolKey\SymbolKeyCompilationsTests.cs (8)
77var originalSymbols = GetSourceSymbols(comp1, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name); 78var newSymbols = GetSourceSymbols(comp2, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name); 107var originalSymbols = GetSourceSymbols(comp1, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name); 108var newSymbols = GetSourceSymbols(comp2, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name); 287var originalSymbols = GetSourceSymbols(originalComp, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name).ToArray(); 288var newSymbols = GetSourceSymbols(newComp, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name).ToArray(); 308var originalSymbols = GetSourceSymbols(originalComp, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name).ToArray(); 309var newSymbols = GetSourceSymbols(newComp, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name).ToArray();
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (4)
66var originalSymbols = GetSourceSymbols(comp1, SymbolCategory.DeclaredType).OrderBy(s => s.Name).ToList(); 266if (local.Name == "fi") 270else if (local.Name == "ary") 274else if (local.Name == "dt")
SymbolKey\SymbolKeyTestBase.cs (2)
43var newlist = newSymbols.OrderBy(s => s.Name).ToList(); 44var origlist = originalSymbols.OrderBy(s => s.Name).ToList();
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (36)
CodeGen\CodeGenDeconstructTests.cs (7)
3580Assert.Equal(decl.Identifier.ValueText, symbol.Name); 3612Assert.Equal(decl.Identifier.ValueText, field.Name); 4409Assert.Equal("x", symbol.Name); 5650Assert.Equal("var", x1Type.Name); 5659Assert.Equal("var", x2Type.Name); 5694Assert.Equal("var", x1Type.Name); 5703Assert.Equal("var", x2Type.Name);
CodeGen\CodeGenTupleTest.cs (6)
3693Assert.Equal("a", yType.TupleElements[0].Name); 3697Assert.Equal("Item2", yType.TupleElements[1].Name); 3701Assert.Equal("b", yType.TupleElements[2].Name); 6068Assert.All(tuple8WithoutNames.GetMembers().OfType<IFieldSymbol>().Where(f => f.Name != "Rest").Select(f => f.Locations.FirstOrDefault()), 17375Assert.Equal("Alice", sym.Symbol.Name); 22859AssertEx.SetEqual(xSymbol.GetMembers().OfType<IFieldSymbol>().Select(f => f.Name),
CodeGen\GotoTest.cs (2)
1150Assert.Equal("L0", symbol.Name); 1163Assert.Equal("C", symbol.Name);
CodeGen\IndexAndRangeTests.cs (3)
40Assert.Equal(methodName, symbol.Name); 42Assert.Equal(containingTypeName, symbol.ContainingType.Name); 1003Assert.Equal("S", property.ContainingType.Name);
CodeGen\SwitchTests.cs (1)
3042var pid = ((NamedTypeSymbol)comp.GlobalNamespace.GetMembers().Single(s => s.Name.StartsWith("<PrivateImplementationDetails>", StringComparison.Ordinal)));
Emit\CompilationEmitTests.cs (17)
4017Assert.Equal(name, assembly.Name); 4020Assert.Equal(nameWithExtension, module.Name); 4053Assert.Equal("?", assembly.Name); 4056Assert.Equal(name + extension, module.Name); 4067Assert.Equal(module.Name, peReader.GetString(peReader.GetModuleDefinition().Name)); 4083Assert.Equal(name, assembly.Name); 4086Assert.Equal(name + extension, module.Name); 4098Assert.Equal(module.Name, peReader.GetString(peReader.GetModuleDefinition().Name)); 4114Assert.Equal(name, assembly.Name); 4117Assert.Equal(name + extension, module.Name); 4129Assert.Equal(module.Name, peReader.GetString(peReader.GetModuleDefinition().Name)); 4145Assert.Equal(name, assembly.Name); 4148Assert.Equal(name + extension, module.Name); 4160Assert.Equal(module.Name, peReader.GetString(peReader.GetModuleDefinition().Name)); 4176Assert.Equal(name, assembly.Name); 4179Assert.Equal(name + extension, module.Name); 4191Assert.Equal(module.Name, peReader.GetString(peReader.GetModuleDefinition().Name));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (72)
Attributes\AttributeTests.cs (2)
1432switch (a.AttributeClass.Name) 1467Assert.Equal("Unexpected Attr", a.AttributeClass.Name);
Attributes\AttributeTests_Assembly.cs (9)
1023.Where(a => string.Equals(a.AttributeClass.Name, attrTypeName, StringComparison.Ordinal)); 1087switch (a.AttributeClass.Name) 1102Assert.Equal("Unexpected Attr", a.AttributeClass.Name); 1208switch (a.AttributeClass.Name) 1217Assert.Equal("Unexpected Attr", a.AttributeClass.Name); 1287switch (a.AttributeClass.Name) 1302Assert.Equal("Unexpected Attr", a.AttributeClass.Name); 1381switch (a.AttributeClass.Name) 1399Assert.Equal("Unexpected Attr", a.AttributeClass.Name);
Attributes\AttributeTests_Conditional.cs (2)
211Where(a => a.AttributeClass.Name != "CompilerGeneratedAttribute"). 212Select(a => a.AttributeClass.Name);
Attributes\AttributeTests_Dynamic.cs (1)
521var synthesizedDynamicAttributes = attributes.Where((attr) => string.Equals(attr.AttributeClass.Name, "DynamicAttribute", StringComparison.Ordinal));
Attributes\AttributeTests_IsByRefLike.cs (2)
1077Assert.NotEqual("IsByRefLikeAttribute", attr.AttributeClass.Name); 1095var attributes = typeSymbol.GetAttributes().OrderBy(attribute => attribute.AttributeClass.Name).ToArray();
Attributes\AttributeTests_Nullable.cs (2)
580Assert.Equal("NullableAttribute", attributeType.Name); 581Assert.Equal(assemblyName, attributeType.ContainingAssembly.Name);
Attributes\AttributeTests_ReadOnlyStruct.cs (2)
646Assert.NotEqual("IsReadOnlyAttribute", attr.AttributeClass.Name); 662var attributes = typeSymbol.GetAttributes().OrderBy(attribute => attribute.AttributeClass.Name).ToArray();
Attributes\AttributeTests_RefReadOnly.cs (1)
2554var attributes = typeSymbol.GetAttributes().OrderBy(attribute => attribute.AttributeClass.Name).ToArray();
Attributes\AttributeTests_Synthesized.cs (2)
127var pid = (NamedTypeSymbol)comp.GlobalNamespace.GetMembers().Where(s => s.Name.StartsWith("<PrivateImplementationDetails>", StringComparison.Ordinal)).Single(); 405var dd = anon.GetAttributes().Where(a => a.AttributeClass.Name == "DebuggerDisplayAttribute").Single();
Attributes\AttributeTests_Tuples.cs (1)
618var synthesizedTupleElementNamesAttr = attributes.Where(attr => string.Equals(attr.AttributeClass.Name, "TupleElementNamesAttribute", StringComparison.Ordinal));
Diagnostics\DiagnosticAnalyzerTests.cs (5)
1653if (nodeContext.ContainingSymbol.Name.StartsWith("Funky") && nodeContext.Compilation.Language == "C#") 2329sortedCallbackEntityNames.Add($"Operation: {operationContext.ContainingSymbol.Name}"); 2330ReportOperationDiagnostics(operationContext.Operation, operationContext.ContainingSymbol.Name, operationContext.ReportDiagnostic); 4135var diagnostic = CodeAnalysis.Diagnostic.Create(Rule, context.Node.GetLocation(), context.Node.Kind(), context.ContainingSymbol.Name); 4210Assert.Equal("C1", symbol.Name);
Diagnostics\GetDiagnosticsTests.cs (8)
182Assert.True(declaredSymbolNames.Contains(compilation.GlobalNamespace.Name)); 231Assert.True(declaredSymbolNames.Contains(compilation.GlobalNamespace.Name)); 351var added = declaredSymbolNames.Add(symbol.Name); 1040reportDiagnostic(CodeAnalysis.Diagnostic.Create(Descriptor, location, containingSymbol.Name)); 1632AssertEx.SetEqual(expectedSymbolCallbacks, analyzer.AnalyzedSymbols.Select(s => s.Name).ToHashSet()); 1662AssertEx.SetEqual(expectedBlockSymbolCallbacks, actualBlockSymbolCallbacks.Select(s => s.Name).ToHashSet()); 1667AssertEx.SetEqual(expectedSymbolStartSymbolCallbacks, analyzer.AnalyzedSymbolStartSymbols.Select(s => s.Name).ToHashSet()); 1669AssertEx.SetEqual(expectedSymbolStartSymbolCallbacks, analyzer.AnalyzedSymbolEndSymbols.Select(s => s.Name).ToHashSet());
FlowAnalysis\FlowTestBase.cs (2)
231symbols = symbols.OrderBy(n => n.Name); 234return symbols.Any() ? string.Join(", ", symbols.Select(symbol => symbol.Name)) : null;
FlowAnalysis\FlowTests.cs (1)
5842var property = declarations.Select(d => model.GetDeclaredSymbol(d)).Where(p => p.ContainingSymbol.Name == "Program").Single();
FlowAnalysis\IterationJumpYieldStatementTests.cs (2)
917Assert.True(flow.VariablesDeclared.Any((s) => s.Name == "b")); 918Assert.True(flow.VariablesDeclared.Any((s) => s.Name == "s"));
FlowAnalysis\RegionAnalysisTests.cs (5)
1372string.Join(", ", new string[] { "f" }.Concat((results2.ReadOutside).Select(symbol => symbol.Name)).OrderBy(name => name))); 1376string.Join(", ", new string[] { "f" }.Concat((results2.WrittenOutside).Select(symbol => symbol.Name)).OrderBy(name => name))); 1515Assert.Equal("this", dataFlows.ReadInside.Single().Name); 3335Assert.Equal("Int32", intsym.Type.Name); 3336Assert.Equal("Int64", longsym.Type.Name);
RefReadonlyParameterTests.cs (2)
1485Assert.Equal("Assembly2", modifier.ContainingAssembly.Name); 1497Assert.Equal("Assembly1", modifier.ContainingAssembly.Name);
Semantics\LockTests.cs (1)
185Assert.Equal("l", localSymbol.Name);
Semantics\OutVarTests.cs (3)
967Assert.Equal(decl.Identifier().ValueText, symbol.Name); 1141Assert.Equal(decl.Identifier().ValueText, symbol.Name); 32733Assert.Equal(decl.Identifier().ValueText, symbol.Name);
Semantics\PatternMatchingTestBase.cs (5)
82Assert.Equal(designation.Identifier.ValueText, symbol.Name); 143Assert.Equal(designation.Identifier.ValueText, symbol.Name); 169Assert.Equal(declarator.Identifier.ValueText, symbol.Name); 183Assert.Equal(designation.Identifier.ValueText, symbol.Name); 245Assert.Equal(designation.Identifier.ValueText, symbol.Name);
Semantics\PatternMatchingTests_ListPatterns.cs (7)
3331Assert.Equal(name, local.Name); 3338Assert.Equal(name, local.Name); 4096Assert.Equal(name, local.Name); 4183Assert.Equal(name, local.Name); 4260Assert.Equal(name, local.Name); 4375Assert.Equal(name, local.Name); 4567Assert.Equal(name, local.Name);
Semantics\RecordTests.cs (7)
25151return GetAttributeStrings(symbol.GetAttributes().Where(a => a.AttributeClass!.Name is "A" or "B" or "C" or "D")); 25213switch (a.AttributeClass!.Name) 25290switch (a.AttributeClass!.Name) 25351switch (a.AttributeClass!.Name) 25432switch (a.AttributeClass!.Name) 25516switch (a.AttributeClass!.Name) 25580switch (a.AttributeClass!.Name)
Microsoft.CodeAnalysis.CSharp.Features (141)
ChangeSignature\CSharpChangeSignatureService.cs (1)
820if (identifier == null || identifier.ToString() != declaredParameters.ElementAt(i).Name)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (3)
262=> parameters.Select(p => NameGenerator.EnsureUniqueness(p.Name, reservedNames)).ToList(); 317baseName: declaredSymbol.Name, 318reservedNames: declaredSymbol.ContainingType.GetMembers().Select(m => m.Name));
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
423if (localSymbol.Type.ContainsAnonymousType() || localSymbol.Type is IErrorTypeSymbol { Name: null or "" })
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (8)
158var unspecifiedNamedParameters = attributeNamedParameters.Where(p => !existingNamedParameters.Contains(p.Name)); 164where !existingNamedParameters.Contains(p.Name) 166displayText: p.Name.ToIdentifierToken().ToString(), 171sortText: p.Name, 187where !existingNamedParameters.Contains(p.Name) 189displayText: p.Name.ToIdentifierToken().ToString(), 194sortText: p.Name, 202=> existingNamedParameters.Except(parameterList.Select(p => p.Name)).IsEmpty();
Completion\CompletionProviders\CompletionUtilities.cs (2)
171return symbol.Name; 174return symbol.Name.EscapeIdentifier(isQueryContext: context.IsInQuery);
Completion\CompletionProviders\CrefCompletionProvider.cs (1)
241foreach (var group in symbols.GroupBy(s => s.Name))
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (1)
57if (info.Type is IErrorTypeSymbol { Name.Length: > 0 } &&
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (5)
87if (type.IsErrorType() && (type.Name == "var" || type.Name == string.Empty)) 123LooksLikeWellKnownCollectionType(compilation, type.Name)) 306if (!currentParameterNames.Contains(overloadParameter.Name) && 309result.Add((overloadParameter.Name, NameDeclarationInfo.GetGlyph(SymbolKind.Parameter, declarationInfo.DeclaredAccessibility)));
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.NameGenerator.cs (2)
34var name = alias.Name; 102var name = type.Name;
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (2)
255var memberDisplayName = $"{displayText}.{staticSymbol.Name}"; 256var additionalFilterTexts = ImmutableArray.Create(staticSymbol.Name);
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.ItemGetter.cs (3)
185IEventSymbol eventSymbol => eventSymbol.Name, 201builder.Append(symbol.Name); 220builder.Append(symbol.Name);
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (6)
92.Where(p => !existingNamedParameters.Contains(p.Name)) 115var escapedName = parameter.Name.ToIdentifierToken().ToString(); 139return existingNamedParameters.Except(parameterList.Select(p => p.Name)).IsEmpty(); 275=> x == y || x != null && y != null && x.Name.Equals(y.Name); 278=> obj.Name.GetHashCode();
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (1)
197=> symbol.Name.EscapeIdentifier();
Completion\CompletionProviders\ObjectCreationCompletionProvider.cs (2)
83return (symbol.Name, "", symbol.Name);
Completion\CompletionProviders\PartialTypeCompletionProvider.cs (1)
79=> [KeyValuePairUtil.Create(InsertionTextOnLessThan, symbol.Name.EscapeIdentifier())];
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (1)
86displayText: member.Name.EscapeIdentifier(),
Completion\CompletionProviders\TupleNameCompletionProvider.cs (2)
107displayText: field.Name, 112filterText: field.Name));
ConvertAutoPropertyToFullProperty\CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (2)
42var fieldName = rule.NamingStyle.MakeCompliant(property.Name).First(); 43return NameGenerator.GenerateUniqueName(fieldName, n => !(property.ContainingType.Name == n || property.ContainingType.GetMembers(n).Any()));
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (1)
250methodSymbol.Name == nameof(IList.Add) &&
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
353var fieldName = field.Name.ToIdentifierName();
Debugging\BreakpointResolver.cs (2)
25.Where(m => m.Name == name || 30return (type.Name == name) ? members.Concat(type.Constructors) : members;
Diagnostics\Analyzers\TypeSyntaxSimplifierWalker.cs (1)
101var name = alias.Target.Name;
DocumentHighlighting\CSharpDocumentHighlightsService.cs (1)
47if (symbol is INamedTypeSymbol && symbol.Name != "var")
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (7)
200where (string?)nameSyntax.Identifier.Value == localOrParameter.Name && 1008Name: 1117oldSymbol != null && newSymbol != null && oldSymbol.Name != newSymbol.Name)) 1129var oldSynthesizedAutoProperty = (IPropertySymbol?)oldSymbol?.ContainingType.GetMembers(oldSymbol.Name).FirstOrDefault(m => m.IsSynthesizedAutoProperty()); 1130var newSynthesizedAutoProperty = (IPropertySymbol?)newSymbol?.ContainingType.GetMembers(newSymbol.Name).FirstOrDefault(m => m.IsSynthesizedAutoProperty()); 1991MethodKind.Ordinary when symbol.Name == WellKnownMemberNames.TopLevelStatementsEntryPointMethodName => CSharpFeaturesResources.top_level_code,
EncapsulateField\CSharpEncapsulateFieldService.cs (7)
100field.Name, 162return (field.Name, MakeUnique(GeneratePropertyName(field.Name), field.ContainingType)); 167var newPropertyName = GeneratePropertyName(field.Name); 169if (newPropertyName == field.Name) 172return (MakeUnique(GenerateFieldName(field.Name), field.ContainingType), newPropertyName); 180if (newFieldName == field.Name)
ExtractMethod\CSharpMethodExtractor.Analyzer.cs (1)
39var info = model.GetSpeculativeTypeInfo(SelectionResult.FinalSpan.Start, SyntaxFactory.ParseName(symbol.Name), SpeculativeBindingOption.BindAsExpression);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
595Name: nameof(Task.ConfigureAwait),
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (5)
139string.Format(fieldOrProperty.Kind == SymbolKind.Field ? FeaturesResources.Initialize_field_0 : FeaturesResources.Initialize_property_0, fieldOrProperty.Name), 155string.Format(FeaturesResources.Create_and_assign_field_0, field.Name), 158string.Format(FeaturesResources.Create_and_assign_property_0, property.Name), 228initializer: IdentifierName(parameter.Name.EscapeIdentifier())); 260initializer: IdentifierName(parameter.Name.EscapeIdentifier()));
InlineHints\CSharpInlineTypeHintsService.cs (1)
155return type is not null or IErrorTypeSymbol && type.Name != "var";
IntroduceVariable\CSharpIntroduceLocalForExpressionCodeRefactoringProvider.cs (1)
106if (field.Name == tupleUnderlyingType.TupleElements[index].Name)
NavigationBar\CSharpNavigationBarItemService.cs (2)
110type.Name, 199member.Name,
SignatureHelp\AbstractCSharpSignatureHelpProvider.cs (1)
51parameter.Name,
SignatureHelp\AttributeSignatureHelpProvider.cs (2)
183namedParameter, namedParameter.Name.ToIdentifierToken().ToString()), 191namedParameter.Name,
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (2)
268if (indexer.Name != WellKnownMemberNames.Indexer) 271result.Add(new SymbolDisplayPart(SymbolDisplayPartKind.PropertyName, indexer, indexer.Name));
SignatureHelp\GenericNameSignatureHelpProvider.cs (2)
218parameter.Name, 238parts.Add(new SymbolDisplayPart(SymbolDisplayPartKind.TypeParameterName, typeParam, typeParam.Name));
SignatureHelp\GenericNameSignatureHelpProvider_Method.cs (1)
55result.Add(new SymbolDisplayPart(SymbolDisplayPartKind.MethodName, method, method.Name));
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_DelegateAndFunctionPointerInvoke.cs (1)
88parameter.Name,
SignatureHelp\TupleConstructionSignatureHelpProvider.cs (1)
187var elementName = element.IsImplicitlyDeclared ? string.Empty : element.Name;
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
366var variableName = outSymbol.Name;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (1)
142if (createMethod.Parameters is [{ Name: "capacity" or "initialCapacity" }, ..])
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (3)
173if (expressionType is null || expressionType.Name.EndsWith("Builder", StringComparison.Ordinal)) 390if (BannedTypes.Contains(member?.ContainingType.Name)) 395if (BannedTypes.Contains(type?.Name))
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
55parameter.Type.Name != nameof(IEnumerable<int>))
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (11)
196convertedType.Name == nameof(ReadOnlySpan<int>) && 200convertedType.Name == nameof(Span<int>) && 209type.Name == nameof(Span<int>) && 267if (type.Name is nameof(ObservableCollection<int>) or nameof(ReadOnlyObservableCollection<int>)) 354var capacityConstructor = GetAccessibleInstanceConstructor(constructors, c => c.Parameters is [{ Name: "capacity", Type.SpecialType: SpecialType.System_Int32 }]); 554if (identifier.Identifier.ValueText != local.Name) 929if (originalCreateMethod.Name is CreateRangeName) 936Name: nameof(IEnumerable<int>), 946else if (originalCreateMethod.Name is CreateName) 983Name: nameof(Span<int>) or nameof(ReadOnlySpan<int>), 1052if (BannedTypes.Contains(type.Name))
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (1)
82else if (firstParameter is { Type.SpecialType: SpecialType.System_Int32, Name: "capacity" })
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
207if (symbol?.Name == nameof(ReferenceEquals) &&
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (4)
208.Select(s => s.Name) 209.Concat(existingSymbols.Select(s => s.Name)) 214if (reservedNames.Contains(element.Name)) 250var localName = local.Name;
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (1)
111.GetMembers(method.Name)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (6)
16=> method is { ContainingType.SpecialType: SpecialType.System_String, Name: nameof(string.Remove) }; 119(parameter.Name == "start" || parameter.Name == "startIndex"); 123(parameter.Name == "count" || parameter.Name == "length"); 148: method.ContainingType.GetMembers(method.Name)
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
257if (identifierName.Identifier.ValueText == local.Name &&
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
353var variableName = _localSymbol.Name;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
181if (identifierName.Identifier.ValueText == asOperand?.Name &&
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (1)
162generator.IdentifierName(parameter.Name),
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (2)
224if (methodSymbol.Name == "Clone") 766yield return XmlParamElement(result.Symbol.Name, XmlEmptyElement(
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (5)
28if (methodSymbol.Name == nameof(Equals) && 45TargetMethod: IMethodSymbol { Name: nameof(Equals) }, 80if (methodSymbol.Name == nameof(GetHashCode) && 631TargetMethod.Name: nameof(Equals), 768TargetMethod.Name: nameof(Equals),
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
123title = string.Format(titleFormat, $"{memberContainer}.{matchingMember.Name}");
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (1)
98usedIdentifiers.Add(typeParameter.Name);
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
103var methodDecl = SyntaxFactory.DestructorDeclaration(classType.Name).AddBodyStatements(disposeStatement);
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (3)
122if (parameter.Name == capture.Name) 141(node, generator) => IdentifierName(parameter.Name.ToIdentifierToken()).WithTriviaFrom(node));
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
225var parameter = method.Parameters.Where(p => p.Name == identifier.Text).FirstOrDefault();
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
163e => SingleVariableDesignation(Identifier(e.Name.EscapeIdentifier())))]));
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
98return returnType.Name != nameof(Task);
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
248PromoteParameter(generator, Parameter(parameter.Name.ToIdentifierToken()), parameter))]);
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (2)
175var orderedKVPs = properties.OrderBy(kvp => constructor.Parameters.FirstOrDefault(p => p.Name == kvp.Value)?.Ordinal); 179var (removedMember, (memberDeclaration, _)) = removedMembers.FirstOrDefault(kvp => kvp.Key.Name == memberName);
UseNamedArguments\CSharpUseNamedArgumentsCodeRefactoringProvider.cs (3)
46if (argType?.ContainingNamespace is { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true } && 47(argType.Name == "Range" || argType.Name == "Index"))
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (3)
src\Analyzers\CSharp\Tests\NamingStyles\NamingStylesTests.cs (3)
1448Assert.Equal("c", symbolRenamedOperation._symbol.Name); 1473Assert.Equal("test", symbolRenamedOperation._symbol.Name); 1503Assert.Equal("arg", symbolRenamedOperation._symbol.Name);
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (4)
IOperation\IOperationTests.cs (1)
564Assert.Equal("b", fieldOperation.Field.Name);
IOperation\IOperationTests_ILocalFunctionStatement.cs (3)
1800Assert.Equal("d1", localFunctionD1.Name); 1810Assert.Equal("d2", localFunctionD2.Name); 1874return graph.LocalFunctions.Single(l => l.Name == name);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (3)
InteractiveSessionReferencesTests.cs (2)
155var missingB = m.ReferencedAssemblySymbols.Single(a => a.Name == "libA").Modules.Single().ReferencedAssemblySymbols.Single(a => a.Name == "libB");
InteractiveSessionTests.cs (1)
1192Assert.True(import.NamespaceOrType is INamespaceSymbol { Name: "System", ContainingNamespace.IsGlobalNamespace: true });
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (199)
Semantics\ArglistTests.cs (1)
965Assert.Equal("TypedReference", info.Symbol.Name);
Semantics\BindingTests.cs (6)
3399Assert.False(symbols.Where(s => s.Name == "MathMin").Any()); 3400Assert.True(symbols.Where(s => s.Name == "MathMax").Any()); 3401Assert.True(symbols.Where(s => s.Name == "F1").Any()); 3402Assert.False(symbols.Where(s => s.Name == "F2").Any()); 3403Assert.False(symbols.Where(s => s.Name == "MathMax2").Any()); 3404Assert.False(symbols.Where(s => s.Name == "MathMax3").Any());
Semantics\ColorColorTests.cs (1)
1258Assert.Equal(WellKnownMemberNames.DelegateInvokeName, parentInfo.Symbol.Name); // Succeeded even though the receiver has an error.
Semantics\DeconstructionTests.cs (2)
4174Assert.Equal("x1", x1.Name); 4179Assert.Equal("x2", x2.Name);
Semantics\ExpressionBodiedMemberTests.cs (8)
140Assert.Equal("i", semanticInfo.Symbol.Name); 157Assert.Equal("C", semanticInfo.Type.Name); 158Assert.Equal("c", semanticInfo.Symbol.Name); 173Assert.Equal("s", semanticInfo.Symbol.Name); 260Assert.Equal("T", semanticInfo.Type.Name); 261Assert.Equal("t", semanticInfo.Symbol.Name); 282Assert.Equal("Program", semanticInfo.Type.Name); 283Assert.Equal("Program", semanticInfo.ConvertedType.Name);
Semantics\InitOnlyMemberTests.cs (4)
3161Assert.Equal("_p", symbolSpeculation.Symbol.Name); 3166Assert.Equal("Int32", typeSpeculation.Type.Name); 4764Assert.Equal("corlibWithIsExternalInit", comp.GetTypeByMetadataName("System.Runtime.CompilerServices.IsExternalInit").ContainingAssembly.Name); 4773Assert.Equal(expectedAssemblyName, comp.GetTypeByMetadataName("System.Runtime.CompilerServices.IsExternalInit").ContainingAssembly.Name);
Semantics\InteractiveSemanticModelTests.cs (1)
266Assert.Equal("c", semanticInfo.Symbol.Name);
Semantics\LambdaDiscardParametersTests.cs (1)
115Assert.Equal("_", symbol1.Name);
Semantics\LambdaTests.cs (13)
2124Assert.Equal("MyArgumentType", typeInfo.Type.Name); 2171Assert.Equal("String", typeInfo.Type.Name); 2217Assert.Equal("String", typeInfo.Type.Name); 2263Assert.Equal("String", typeInfo.Type.Name); 2309Assert.Equal("String", typeInfo.Type.Name); 2339Assert.Equal("Char", typeInfo.Type.Name); 2366Assert.Equal("String", typeInfo.Type.Name); 2421Assert.Equal("String", typeInfo.Type.Name); 2467Assert.Equal("String", typeInfo.Type.Name); 2513Assert.Equal("String", typeInfo.Type.Name); 2546Assert.Equal("String", typeInfo.Type.Name); 2579Assert.Equal("String", typeInfo.Type.Name); 2616Assert.Equal("String", typeInfo.Type.Name);
Semantics\LocalFunctionTests.cs (3)
1064Assert.Equal("A", attrConstructor.ContainingType.Name); 10182Assert.Equal("P", property.Name); 10183Assert.Equal("MyAttribute", property.ContainingType.Name);
Semantics\LockTests.cs (1)
47Assert.Equal("o", localSymbol.Name);
Semantics\LookupTests.cs (6)
692Assert.Equal("A", baseExprType.Name); 1229var actual_lookupSymbols_as_string = actual_lookupSymbols.Select(e => e.Name); 1394var systemNS = (INamespaceSymbol)actual_lookupSymbols.Where((sym) => sym.Name.Equals("System") && sym.Kind == SymbolKind.Namespace).Single(); 1524var namespaceX = (INamespaceSymbol)actual_lookupSymbols.Where((sym) => sym.Name.Equals("X") && sym.Kind == SymbolKind.Namespace).Single(); 1533var typeA = (INamedTypeSymbol)actual_lookupSymbols.Where((sym) => sym.Name.Equals("A") && sym.Kind == SymbolKind.NamedType).Single(); 1538var aliasY = (IAliasSymbol)actual_lookupSymbols.Where((sym) => sym.Name.Equals("aliasY") && sym.Kind == SymbolKind.Alias).Single();
Semantics\MethodTypeInferenceTests.cs (4)
1122Assert.Equal("Book", bookType.Name); 1163Assert.Equal("Author", authorType.Name); 1203Assert.Equal("Book", bookResultType.Name); 1207Assert.Equal("Author", authorResultType.Name);
Semantics\NamedAndOptionalTests.cs (1)
820Assert.Equal("ss", symInfo.Symbol.Name);
Semantics\NameOfTests.cs (1)
688Assert.Equal("Goo", symbolInfo.CandidateSymbols[0].Name);
Semantics\NativeIntegerTests.cs (6)
242Assert.Equal(signed ? "IntPtr" : "UIntPtr", type.Name); 256Assert.Same(underlyingType.Name, nativeIntegerType.Name); 328return !IsSkippedMethodName(method.Name); 337return property.Parameters.Length == 0 && !IsSkippedPropertyName(property.Name); 516Assert.Contains(member.Name, memberNames);
Semantics\NonTrailingNamedArgumentsTests.cs (2)
55Assert.Equal("a", firstASymbol.Symbol.Name); 67Assert.Equal("a", secondASymbol.Symbol.Name);
Semantics\NullableReferenceTypesTests.cs (9)
158065var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 158234var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 158274var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 158315var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item"); 158350var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item"); 158484var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Get"); 158526var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 158570var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item"); 158607var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item");
Semantics\OperatorTests.cs (4)
7622symbol1.Name, symbol1.ReturnType, symbol1.Parameters[0].Type); 7655Assert.Equal(symbol1.Name, symbol1.MetadataName); 8398symbol1.Name, symbol1.ReturnType, symbol1.Parameters[0].Type, symbol1.Parameters[1].Type); 8429Assert.Equal(symbol1.Name, symbol1.MetadataName);
Semantics\QueryTests.cs (48)
1460Assert.Equal("x", x.Name); 1461Assert.Equal("Cast", info0.CastInfo.Symbol.Name); 1468Assert.Equal("y", y.Name); 1469Assert.Equal("Cast", info1.CastInfo.Symbol.Name); 1470Assert.Equal("SelectMany", info1.OperationInfo.Symbol.Name); 1476Assert.Equal("z", z.Name); 1477Assert.Equal("Cast", info2.CastInfo.Symbol.Name); 1478Assert.Equal("SelectMany", info2.OperationInfo.Symbol.Name); 1669Assert.Equal("x", x.Name); 1670Assert.Equal("Cast", info0.CastInfo.Symbol.Name); 1677Assert.Equal("y", y.Name); 1678Assert.Equal("Cast", info1.CastInfo.Symbol.Name); 1679Assert.Equal("SelectMany", info1.OperationInfo.Symbol.Name); 1685Assert.Equal("z", z.Name); 1686Assert.Equal("Cast", info2.CastInfo.Symbol.Name); 1687Assert.Equal("SelectMany", info2.OperationInfo.Symbol.Name); 1727Assert.Equal("Cast", info0.CastInfo.Symbol.Name); 1729Assert.Equal("x", model.GetDeclaredSymbol(q.FromClause).Name); 1732Assert.Equal("Cast", info1.CastInfo.Symbol.Name); 1733Assert.Equal("SelectMany", info1.OperationInfo.Symbol.Name); 1734Assert.Equal("y", model.GetDeclaredSymbol(q.Body.Clauses[0]).Name); 1767Assert.Equal("i", model.GetDeclaredSymbol(q.FromClause).Name); 1777Assert.Equal("OrderByDescending", oinfo0.Symbol.Name); 1780Assert.Equal("ThenBy", oinfo1.Symbol.Name); 2183Assert.Equal("Select", m.ReducedFrom.Name); 2238Assert.Equal("x", info.Symbol.Name); 2244Assert.Equal("w", info.Symbol.Name); 2276Assert.Equal("w", symbol.Name); 2329Assert.Equal("x8", symbol.Name); 2396Assert.Equal("SelectMany", queryInfoForFrom2.OperationInfo.Symbol.Name); 2432Assert.Equal(names[count++], symbolInfo.Symbol.Name); 2903Assert.Equal("x", x.Name); 2907Assert.Equal("Select", infoSelect.Symbol.Name); 2936Assert.Equal("x", x.Name); 2940Assert.Equal("Select", infoSelect.Symbol.Name); 3383Assert.Equal("Assembly", typeInfo2.Type.Name); 3392Assert.Equal("Assembly", typeInfo1.Type.Name); 3429Assert.Equal("Cast", info0.CastInfo.Symbol.Name); 3431Assert.Equal("x", speculativeModel.GetDeclaredSymbol(q.FromClause).Name); 3434Assert.Equal("Cast", info1.CastInfo.Symbol.Name); 3435Assert.Equal("SelectMany", info1.OperationInfo.Symbol.Name); 3436Assert.Equal("y", speculativeModel.GetDeclaredSymbol(q.Body.Clauses[0]).Name); 3474Assert.Equal("x", x.Name); 3481Assert.Equal("Select", selectClauseSymbolInfo.Symbol.Name); 3485Assert.Equal("List1", selectClauseTypeInfo.Type.Name); 3522Assert.Equal("x8", symbol.Name); 3562Assert.Equal("w", symbol.Name); 3610Assert.Equal(names[count++], symbolInfo.Symbol.Name);
Semantics\RecordStructTests.cs (1)
10520return GetAttributeStrings(symbol.GetAttributes().Where(a => a.AttributeClass!.Name is "A" or "B" or "C" or "D"));
Semantics\ScriptSemanticsTests.cs (1)
606Assert.False(symbols.Any(s => s.Name == "Roslyn"));
Semantics\StackAllocInitializerTests.cs (7)
1055Assert.Equal("Test", obj1Value.ConvertedType.Name); 1070Assert.Equal("Span", obj3Value.Type.Name); 1071Assert.Equal("Span", obj3Value.ConvertedType.Name); 1157Assert.Equal("Span", obj1Value.Type.Name); 1158Assert.Equal("Span", obj1Value.ConvertedType.Name); 1173Assert.Equal("Span", obj3Value.Type.Name); 1174Assert.Equal("Span", obj3Value.ConvertedType.Name);
Semantics\StackAllocSpanExpressionsTests.cs (7)
61Assert.Equal("Test", obj1Value.ConvertedType.Name); 76Assert.Equal("Span", obj3Value.Type.Name); 77Assert.Equal("Span", obj3Value.ConvertedType.Name); 135Assert.Equal("Span", obj1Value.Type.Name); 136Assert.Equal("Span", obj1Value.ConvertedType.Name); 151Assert.Equal("Span", obj3Value.Type.Name); 152Assert.Equal("Span", obj3Value.ConvertedType.Name);
Semantics\SuppressAccessibilityChecksTests.cs (14)
57Assert.Equal("A", semanticModel.GetTypeInfo(invocation).Type.Name); 58Assert.Equal("M", semanticModel.GetSymbolInfo(invocation).Symbol.Name); 62Assert.Equal("A", semanticModel.GetTypeInfo(invocation).Type.Name); 64Assert.Equal("M", semanticModel.GetSymbolInfo(invocation).CandidateSymbols.Single().Name); 77semanticModel.GetSpeculativeTypeInfo(position, exp, SpeculativeBindingOption.BindAsExpression).Type.Name); 80semanticModel.GetSpeculativeSymbolInfo(position, exp, SpeculativeBindingOption.BindAsExpression).Symbol.Name); 98Assert.Equal("A", creationExpression.Type.Name); 129Assert.Equal("_p", symbolInfo.Symbol.Name); 171Assert.Equal("A", semanticModel.GetTypeInfo(invocation).Type.Name); 172Assert.Equal("M", semanticModel.GetSymbolInfo(invocation).Symbol.Name); 177Assert.Equal("Int32", semanticModel.GetSpeculativeTypeInfo(position, speculativeInvocation, SpeculativeBindingOption.BindAsExpression).Type.Name); 178Assert.Equal("InternalExtension", semanticModel.GetSpeculativeSymbolInfo(position, speculativeInvocation, SpeculativeBindingOption.BindAsExpression).Symbol.Name); 236Assert.Equal("_p", symbolSpeculation.Symbol.Name); 241Assert.Equal("Int32", typeSpeculation.Type.Name);
Semantics\TopLevelStatementsTests.cs (29)
197Assert.Contains(refSymbol.Name, model1.LookupNames(localRef.SpanStart)); 199Assert.Same(refSymbol, model1.LookupSymbols(localRef.SpanStart, name: refSymbol.Name).Single()); 240Assert.Contains(declSymbol.Name, model1.LookupNames(localDecl.SpanStart)); 242Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 326Assert.Empty(model1.LookupSymbols(localRef.SpanStart).Where(s => s.Name == name)); 363Assert.Contains(declSymbol.Name, model2.LookupNames(localDecl.SpanStart)); 365Assert.Same(declSymbol, model2.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 484Assert.Contains(declSymbol.Name, model1.LookupNames(localDecl.SpanStart)); 486Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 493Assert.Contains(declSymbol.Name, model1.LookupNames(localFuncRef.SpanStart)); 495Assert.Same(declSymbol, model1.LookupSymbols(localFuncRef.SpanStart, name: declSymbol.Name).Single()); 505Assert.Empty(model2.LookupSymbols(localRef.SpanStart).Where(s => s.Name == name)); 536Assert.Contains(declSymbol.Name, model1.LookupNames(localDecl.SpanStart)); 538Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 547Assert.Contains(declSymbol.Name, model1.LookupNames(localRef.SpanStart)); 549Assert.Same(declSymbol, model1.LookupSymbols(localRef.SpanStart, name: declSymbol.Name).Single()); 576Assert.Contains(declSymbol.Name, model1.LookupNames(localDecl.SpanStart)); 578Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 585Assert.Contains(declSymbol.Name, model1.LookupNames(localFuncRef.SpanStart)); 587Assert.Same(declSymbol, model1.LookupSymbols(localFuncRef.SpanStart, name: declSymbol.Name).Single()); 594Assert.Contains(refSymbol.Name, model1.LookupNames(localRef.SpanStart)); 596Assert.Same(refSymbol, model1.LookupSymbols(localRef.SpanStart, name: refSymbol.Name).Single()); 709Assert.Equal("Program", local.ContainingSymbol.ContainingSymbol.Name); 6041Assert.Contains(declSymbol.Name, model1.LookupNames(localRef.SpanStart)); 6043Assert.Same(declSymbol, model1.LookupSymbols(localRef.SpanStart, name: declSymbol.Name).Single()); 6236Assert.Equal("A", semanticModel.GetTypeInfo(invocation).Type.Name); 6238Assert.Equal("M", semanticModel.GetSymbolInfo(invocation).CandidateSymbols.Single().Name); 6244Assert.Equal("A", semanticModel.GetTypeInfo(invocation).Type.Name); 6245Assert.Equal("M", semanticModel.GetSymbolInfo(invocation).Symbol.Name);
Semantics\TryCatchTests.cs (1)
47Assert.Equal("e", localSymbol.Name);
Semantics\UnsafeTests.cs (10)
7277Assert.Equal("p", declaredSymbol.Name); 7861Assert.Equal("p", receiverSymbol.Name); 7928Assert.Equal("s", receiverSymbol.Name); 8172Assert.Equal("p", receiverSymbol.Name); 8184Assert.Equal("i", indexSymbol.Name); 8239Assert.Equal("f", receiverSymbol.Name); 8297Assert.Equal("f", receiverSymbol.Name); 8876summaryMethod.Name, summaryMethod.ReturnType, summaryMethod.Parameters[0].Type, summaryMethod.Parameters[1].Type); 9338summaryMethod.Name, summaryMethod.ReturnType, summaryMethod.Parameters[0].Type, summaryMethod.Parameters[1].Type); 11340Assert.Equal("count", countSymbol.Name);
Semantics\UsingStatementTests.cs (3)
66Assert.Equal("i", declaredLocal.Name); 75var lookupSymbol = model.LookupSymbols(memberAccessExpression.SpanStart, name: declaredLocal.Name).Single(); 1896var actualSymbol = model.LookupSymbols(usingStatements[index - 1].SpanStart, name: symbol.Name).Single();
Semantics\Utf8StringsLiteralsTests.cs (1)
4089method.Name, method.ReturnType, method.Parameters[0].Type, method.Parameters[1].Type);
SourceGeneration\GeneratorDriverTests.cs (3)
2118static (ctx, ct) => ctx.SemanticModel.GetSymbolInfo(ctx.Node, ct).Symbol?.Name ?? "(method not found)") 2180static (ctx, ct) => ctx.SemanticModel.GetSymbolInfo(ctx.Node, ct).Symbol?.Name ?? "(method not found)") 2277static (ctx, ct) => ctx.SemanticModel.GetSymbolInfo(ctx.Node, ct).Symbol?.Name ?? "(method not found)")
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (394)
Compilation\CompilationAPITests.cs (3)
1694Assert.Equal("?", compilation.Assembly.Name); 1702Assert.Equal("?", compilation.Assembly.Name); 1710Assert.Equal("ModuleAssemblyName", compilation.Assembly.Name);
Compilation\GetImportScopesTests.cs (52)
55Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 71Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 102Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 130Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 147Assert.True(scopes.Single().Imports.Any(i => i.NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) })); 148Assert.True(scopes.Single().Imports.Any(i => i.NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) })); 175Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 198Assert.True(scopes[0].Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) }); 200Assert.True(scopes[1].Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 226Assert.True(scopes[0].Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) }); 228Assert.True(scopes[1].Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 244Assert.True(scopes.Single().Aliases.Single() is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } }); 260Assert.True(scopes.Single().Aliases.Single() is { Name: "S", Target: { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } }); 291Assert.True(scopes.Single().Aliases.Single() is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } }); 319Assert.True(scopes.Single().Aliases.Single() is { Name: "S", Target: { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } }); 336Assert.True(scopes.Single().Aliases.Any(a => a is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } })); 337Assert.True(scopes.Single().Aliases.Any(a => a is { Name: "M", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) } })); 364Assert.True(scopes.Single().Aliases.Single() is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } }); 387Assert.True(scopes[0].Aliases.Single() is { Name: "M", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) } }); 389Assert.True(scopes[1].Aliases.Single() is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } }); 418Assert.True(scopes.Single().ExternAliases.Single() is { Name: "CORE" }); 437Assert.True(scopes.Single().ExternAliases.Single() is { Name: "CORE", Target: INamespaceSymbol { IsGlobalNamespace: true } }); 459Assert.True(scopes.Single().ExternAliases.Single() is { Name: "CORE", Target: INamespaceSymbol { IsGlobalNamespace: true } }); 480Assert.True(scopes.Single().ExternAliases.Single() is { Name: "CORE", Target: INamespaceSymbol { IsGlobalNamespace: true } }); 499Assert.True(scopes.Single().ExternAliases.Single() is { Name: "CORE", Target: INamespaceSymbol { IsGlobalNamespace: true } }); 516Assert.True(scopes.Single().ExternAliases.Single() is { Name: "CORE", Target: INamespaceSymbol { IsGlobalNamespace: true } }); 536Assert.True(scopes.Single().ExternAliases.Any(a => a is { Name: "CORE1", Target: INamespaceSymbol { IsGlobalNamespace: true } })); 537Assert.True(scopes.Single().ExternAliases.Any(a => a is { Name: "CORE2", Target: INamespaceSymbol { IsGlobalNamespace: true } })); 567Assert.True(scopes.Single().ExternAliases.Single() is { Name: "CORE1", Target: INamespaceSymbol { IsGlobalNamespace: true } }); 593Assert.True(scopes[0].ExternAliases.Single() is { Name: "CORE2", Target: INamespaceSymbol { IsGlobalNamespace: true } }); 595Assert.True(scopes[1].ExternAliases.Single() is { Name: "CORE1", Target: INamespaceSymbol { IsGlobalNamespace: true } }); 622Assert.True(scopes.Single().Aliases.Single() is { Name: "M", Target: INamespaceSymbol { Name: nameof(Microsoft) } }); 625Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 648Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 652Assert.True(scopes.Single().Aliases.Single() is { Name: "M", Target: INamespaceSymbol { Name: nameof(Microsoft) } }); 682Assert.True(scopes.Single().Imports.Any(i => i.NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) })); 684Assert.True(scopes.Single().Imports.Any(i => i.NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: false, Name: nameof(System.IO) })); 688Assert.True(scopes.Single().Aliases.Any(i => i is { Name: "M", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) } })); 690Assert.True(scopes.Single().Aliases.Any(i => i is { Name: "T", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: false, Name: nameof(System.Threading) } }));
Compilation\GetSemanticInfoTests.cs (51)
46Assert.Equal("x", sym.Symbol.Name); 979Assert.Equal("Boolean", info.Type.Name); 1003Assert.Equal("Boolean", info.ConvertedType.Name); 1171Assert.Equal("value", parameterSymbol.Name); 1200Assert.Equal("value", parameterSymbol.Name); 1534Assert.Equal("Fld", candidate.Name); 1563Assert.Equal("Test", symbol.Name); 1613Assert.Equal("T", symbol.Name); 1709Assert.Equal("x", symbol.Name); 1744Assert.Equal("value", symbol.Name); 1779Assert.Equal("this", symbol.Name); 2359Assert.Equal("x", parameterSymbol.Name); 2402Assert.Equal("A", symbolInfo.Symbol.Name); 2409Assert.Equal("B", symbolInfo.Symbol.Name); 2413Assert.Equal("D", symbolInfo.Symbol.Name); 2419Assert.Equal("B", symbolInfo.Symbol.Name); 2425Assert.Equal("B", symbolInfo.Symbol.Name); 2728Assert.Equal("c", symbol.Name); 4059Assert.Equal("Any", method1.Name); 4072Assert.Equal("Any", method2.Name); 4942Assert.Equal("X", symbolInfo.Symbol.Name); 4946Assert.Equal("Z", symbolInfo.Symbol.Name); 4950Assert.Equal("A", symbolInfo.Symbol.Name); 4954Assert.Equal("B", symbolInfo.Symbol.Name); 4997Assert.Equal("X", symbolInfo.Symbol.Name); 5001Assert.Equal("x", symbolInfo.Symbol.Name); 5005Assert.Equal("Y", symbolInfo.Symbol.Name); 5009Assert.Equal("Z", symbolInfo.Symbol.Name); 5026Assert.Equal("Z", symbolInfo.Symbol.Name); 5040Assert.Equal("Z", symbolInfo.Symbol.Name); 5056Assert.Equal("Z", symbolInfo.Symbol.Name); 5072Assert.Equal("Z", symbolInfo.Symbol.Name); 5088Assert.Equal("Z", symbolInfo.Symbol.Name); 5104Assert.Equal("Z", symbolInfo.Symbol.Name); 5121Assert.Equal("Z", symbolInfo.Symbol.Name); 5138Assert.Equal("Z", symbolInfo.Symbol.Name); 5154Assert.Equal("Z", symbolInfo.Symbol.Name); 5170Assert.Equal("Z", symbolInfo.Symbol.Name); 5187Assert.Equal("Z", symbolInfo.Symbol.Name); 5204Assert.Equal("Z", symbolInfo.Symbol.Name); 5221Assert.Equal("Z", symbolInfo.Symbol.Name); 5237Assert.Equal("Z", symbolInfo.Symbol.Name); 5253Assert.Equal("Z", symbolInfo.Symbol.Name); 5269Assert.Equal("Z", symbolInfo.Symbol.Name); 5285Assert.Equal("Z", symbolInfo.Symbol.Name); 5302Assert.Equal("Z", symbolInfo.Symbol.Name); 5319Assert.Equal("Z", symbolInfo.Symbol.Name); 5336Assert.Equal("Z", symbolInfo.Symbol.Name); 5353Assert.Equal("Z", symbolInfo.Symbol.Name); 5370Assert.Equal("Z", symbolInfo.Symbol.Name); 5387Assert.Equal("Z", symbolInfo.Symbol.Name);
Compilation\GetUnusedImportDirectivesTests.cs (2)
198Assert.Equal("Console", info.Symbol.Name); 200Assert.Equal("System", info.Symbol.ContainingSymbol.Name);
Compilation\IndexedProperties_BindingTests.cs (1)
144Assert.Equal(name, sym.Symbol.Name);
Compilation\SemanticModelAPITests.cs (58)
156Assert.Equal("Slice", symbolInfo.Symbol.Name); 409Assert.Equal(string.Empty, symbol.Name); 430Assert.Equal(string.Empty, symbol.Name); 843var typeA = mems.Where(s => s.Name == "A").Select(s => s); 845var invalid = mems.Where(s => s.Name == WellKnownMemberNames.TopLevelStatementsEntryPointTypeName).Select(s => s); 1045orderby apsym.Name 1046select apsym.Name; 1076orderby apsym.Name 1077select apsym.Name; 1117orderby apsym.Name 1118select apsym.Name; 1161orderby apsym.Name 1162select apsym.Name; 1272Assert.Equal("", aliasTarget.Name); 1434Assert.Equal("String", typeInfo.Type.Name); 1435Assert.Equal("Object", typeInfo.ConvertedType.Name); 1472Assert.Equal("Int16", typeInfo.Type.Name); 1473Assert.Equal("Int32", typeInfo.ConvertedType.Name); 1520Assert.Equal("Int16", typeInfo.Type.Name); 1521Assert.Equal("Int32", typeInfo.ConvertedType.Name); 1568Assert.Equal("E", typeInfo.Type.Name); 1569Assert.Equal("E", typeInfo.ConvertedType.Name); 1608Assert.Equal("Int16", typeInfo.Type.Name); 1609Assert.Equal("Int32", typeInfo.ConvertedType.Name); 1693Assert.Equal("String", typeInfo.Type.Name); 1694Assert.Equal("Object", typeInfo.ConvertedType.Name); 1733Assert.Equal("var", aliasSymbol.Name); 1789Assert.Equal("z", local.Name); 1791Assert.Equal("Int32", ((ILocalSymbol)local).Type.Name); 1795Assert.Equal("Int32", typeInfo.Type.Name); 1801Assert.Equal("z", info.Symbol.Name); 1808Assert.Equal("y", info2.Symbol.Name); 1842Assert.Equal("z", local.Name); 1844Assert.Equal("Int32", ((ILocalSymbol)local).Type.Name); 1855Assert.Equal("y", local.Name); 1857Assert.Equal("String", ((ILocalSymbol)local).Type.Name); 1888Assert.Equal("label", label.Name); 1966Assert.Equal("z", parameterSymbol.Name); 2044Assert.Equal("Int32", typeInfo.Type.Name); 2287Assert.Equal("p", symbol.Name); 2395Assert.Equal("z", local.Name); 2397Assert.Equal("Int32", ((ILocalSymbol)local).Type.Name); 2401Assert.Equal("Int32", typeInfo.Type.Name); 2407Assert.Equal("z", info.Symbol.Name); 2578Assert.Equal("z", local.Name); 2580Assert.Equal("Int32", ((ILocalSymbol)local).Type.Name); 2592Assert.Equal("y", local.Name); 2594Assert.Equal("String", ((ILocalSymbol)local).Type.Name); 2606Assert.Equal("y", local.Name); 2608Assert.Equal("Int32", ((ILocalSymbol)local).Type.Name); 2614Assert.Equal("x", paramSymbol.Name); 2615Assert.Equal("Int32", paramSymbol.Type.Name); 2649Assert.Equal("label", label.Name); 2687Assert.Equal("z", parameterSymbol.Name); 3133Assert.Equal("x", symbol.Name); 3849Assert.Equal("Alias", symbol.Name); 3854Assert.Equal("lib", target.ContainingAssembly.Name); 4762Assert.Equal("NET5_0_OR_GREATER", preprocessingSymbol.Name);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (102)
83Assert.Equal("B", symbol.Name); 108Assert.Equal("", symbol.Name); 129Assert.Equal("D", symbol.Name); 152Assert.Equal("C", symbol.Name); 261Assert.Equal("C", typeSymbol.Name); 282Assert.Equal("M", methodSymbol.Name); 305Assert.Equal("P", propertySymbol.Name); 385Assert.Equal("E", eventSymbol.Name); 412Assert.Equal("E", eventSymbol.Name); 434Assert.Equal("Iter3", symbol.Name); 456Assert.Equal("Prop", symbol.Name); 479Assert.Equal(WellKnownMemberNames.Indexer, symbol.Name); 503Assert.Equal("Iter3", symbol.Name); 525Assert.Equal("Prop", symbol.Name); 548Assert.Equal(WellKnownMemberNames.Indexer, symbol.Name); 572Assert.Equal("x", symbol.Name); 594Assert.Equal("x", symbol.Name); 598Assert.Equal("y", symbol.Name); 622Assert.Equal("label1", symbol1.Name); 627Assert.Equal("label2", symbol2.Name); 780Assert.Equal("x", symbol.Name); 802Assert.Equal("x", symbol.Name); 806Assert.Equal("y", symbol.Name); 826Assert.Equal("x", symbol.Name); 842Assert.Equal("x", symbol.Name); 862Assert.Equal("x", symbol.Name); 866Assert.Equal("y", symbol.Name); 886Assert.Equal("T", symbol.Name); 906Assert.Equal("T", symbol.Name); 945Assert.Equal("St", structSymbol.Name); 950Assert.Equal("field", fSymbol.Name); 951Assert.Equal("T", fSymbol.Type.Name); 957Assert.Equal("Em", enumSymbol.Name); 971Assert.Equal("V", ptsym.Name); 975Assert.Equal("ReturnEnum", mSymbol.Name); 983Assert.Equal("p1", mSymbol.Parameters[0].Name); 984Assert.Equal("St", mSymbol.Parameters[0].Type.Name); 989Assert.Equal("p1", psym.Name); 1388Assert.True(symbolsInC.Any(s => s.Name == "A" && s.Kind == SymbolKind.NamedType)); 1389Assert.True(symbolsInC.Any(s => s.Name == "B" && s.Kind == SymbolKind.NamedType)); 1390Assert.True(symbolsInC.Any(s => s.Name == "C" && s.Kind == SymbolKind.NamedType)); 1391Assert.True(symbolsInC.Any(s => s.Name == "M" && s.Kind == SymbolKind.Method && s.ContainingType.Name == "A")); 1392Assert.True(symbolsInC.Any(s => s.Name == "M" && s.Kind == SymbolKind.Method && s.ContainingType.Name == "B")); 1393Assert.True(symbolsInC.Any(s => s.Name == "M" && s.Kind == SymbolKind.Method && s.ContainingType.Name == "C")); 1394Assert.True(symbolsInC.Any(s => s.Name == "F" && s.Kind == SymbolKind.Method && s.ContainingType.Name == "C")); 1395Assert.True(symbolsInC.Any(s => s.Name == "System" && s.Kind == SymbolKind.Namespace)); 1396Assert.True(symbolsInC.Any(s => s.Name == "Microsoft" && s.Kind == SymbolKind.Namespace)); 2258Assert.Equal("String", info.Type.Name); 2260Assert.Equal("F", info.Symbol.Name); 2294Assert.Equal("String", info.Type.Name); 2297Assert.Equal("F", info.CandidateSymbols[0].Name); 2333Assert.Equal("F", info.CandidateSymbols[0].Name); 2369Assert.Equal("F", info.CandidateSymbols[0].Name); 2433Assert.Equal("C", info.Type.Name); 2465Assert.Equal("C", info.Type.Name); 2473Assert.Equal("Int32", info.Type.Name); 2504Assert.Equal("System", info.Symbol.Name); 2540Assert.Equal("D", info.Type.Name); 2541Assert.Equal("N", info.Type.ContainingNamespace.Name); 2569Assert.Equal("String", info.Type.Name); 2600Assert.Equal("System", info.Symbol.Name); 2623Assert.Equal("Double", info.ConvertedType.Name); 2647Assert.Equal("Double", info.ConvertedType.Name); 2651Assert.Equal("Double", info.ConvertedType.Name); 2679Assert.Equal("Double", info.ConvertedType.Name); 2706Assert.Equal("Double", info.ConvertedType.Name); 2710Assert.Equal("Int64", info.ConvertedType.Name); 2819Assert.Equal("N1", n1.Name); 2855Assert.Equal("I.M", explicitMethodSymbol.Name); 2863Assert.Equal("I.P", explicitPropertySymbol.Name); 2875Assert.Equal("I.get_P", explicitPropertyGetterSymbol.Name); 2885Assert.Equal("I.set_P", explicitPropertySetterSymbol.Name); 3218Assert.Equal("Int32", info.ConvertedType.Name); 3241Assert.Equal("strin", info.Type.Name); 3275Assert.Equal("D1", initInfo.ConvertedType.Name); 3287Assert.Equal("D2", argInfo.ConvertedType.Name); 3482Assert.Equal("aaa", symbol.Name); 3505Assert.Equal("aaa", symbol.Name); 3532Assert.Equal("aaa", symbol1.Name); 3538Assert.Equal("bbb", symbol2.Name); 3569Assert.Equal("aaa", symbol.Name); 3591Assert.Equal("Goo", symbol.Name); 3616Assert.Equal("Goo", symbol.Name); 3640Assert.Equal("EnumX", enumTypeSymbol.Name); 3644Assert.Equal("FieldM", symbol.Name); 3648Assert.Equal("FieldM", fSymbol.Name); 3673Assert.Equal("x", parameter.Name); 3742Assert.Equal("System", declSymbol.Name); 4296Assert.Equal("O", aliasSymbol.Name); 4298Assert.Equal("ObsoleteAttribute", aliasSymbol.Target.Name); 4342Assert.Equal("O", aliasSymbol.Name); 4344Assert.Equal("ObsoleteAttribute", aliasSymbol.Target.Name); 4365Assert.Equal("O", aliasSymbol.Name); 4367Assert.Equal("ObsoleteAttribute", aliasSymbol.Target.Name); 4387Assert.Equal("O", aliasSymbol.Name); 4389Assert.Equal("ObsoleteAttribute", aliasSymbol.Target.Name); 5179Assert.Contains(symbols, s => s.Name == "Local"); 5208Assert.Contains(symbols, s => s.Name == "local1");
Compilation\SemanticModelGetSemanticInfoTests.cs (21)
4622Assert.Equal("j", symbol.Name); 4690Assert.Equal("C", symbol.Name); 4727Assert.Equal("Y", symbol.Name); 4763Assert.Equal("B", symbol.Name); 4799Assert.Equal("D", symbol.Name); 4831Assert.Equal("B", symbol.Name); 5667Assert.Equal("str", lambdaSym.Parameters[0].Name); 5703Assert.Equal("str", lambdaSym.Parameters[0].Name); 6232Assert.Equal("args", semanticInfo.Symbol.Name); 8333Assert.Equal("x", semanticInfo.Symbol.Name); 8351Assert.Equal("AttributeUsageAttribute", semanticInfo.Type.Name); 9236Assert.Equal("B", type.Name); 9266Assert.Equal("B", type.Name); 10941Assert.Equal("Program", semanticInfo.Type.Name); 12194Assert.Equal("Stat", semanticInfo.CandidateSymbols.First().Name); 12264Assert.Equal("X", semanticInfo.CandidateSymbols.First().Name); 12330Assert.Equal("T", semanticInfo.CandidateSymbols.First().Name); 14388Assert.Equal("InterfaceType", semanticInfo.CandidateSymbols.First().Name); 15378Assert.Equal(expectedNames[i++], infoSymbol?.Name); 15382Assert.Equal(expectedNames[i++], infoSymbol2.Name); 15436Assert.Equal("C", info.Type.Name);
Compilation\SemanticModelGetSemanticInfoTests_LateBound.cs (4)
40Assert.Equal("C", semanticInfo.Type.Name); 64Assert.Equal("C", semanticInfo.Type.Name); 85Assert.Equal("C", semanticInfo.Type.Name); 111Assert.Equal("C", semanticInfo.Type.Name);
Compilation\SymbolVisitorTests.cs (38)
41_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 58_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 76_output.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name + ": "); 83_output.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name + ": "); 100_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 109_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 119_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 127_output.Append(symbol.GetType().Name + " " + symbol.Name); 138_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 146_output.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name + ": "); 164_output.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 178_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 182_output.Append(symbol.GetType().Name + " " + symbol.Name); 209_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 229_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 250_output.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name + ": "); 258_output.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name + ": "); 278_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 288_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 299_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 307_output.Append(symbol.GetType().Name + " " + symbol.Name); 319_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 328_output.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name + ": "); 349_output.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 365_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 369_output.Append(symbol.GetType().Name + " " + symbol.Name); 392argument.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 401argument.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 410argument.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 421argument.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 429argument.Append(symbol.GetType().Name + " " + symbol.Name); 441argument.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name + ": "); 449argument.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name + ": "); 457argument.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 467argument.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name + ": "); 500argument.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 515argument.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 519argument.Append(symbol.GetType().Name + " " + symbol.Name);
DocumentationComments\CrefTests.cs (4)
2018AssertEx.SetEqual(info.CandidateSymbols.Select(sym => sym.ContainingAssembly.Name), "Lib1", "Lib2"); 5719Assert.Equal(WellKnownMemberNames.AdditionOperatorName, symbol.Name); 6220Assert.Equal("A", alias.Name); 6253Assert.Equal("A", alias.Name);
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (3)
1029Assert.Equal("d", localD.Name); 1030Assert.Equal("Disposable", localD.Type.Name); 1034Assert.Equal("Dispose", methodDispose.Name);
Symbols\AnonymousTypesSemanticsTests.cs (2)
1075Assert.Equal(name, type.Name); 2028Assert.Equal("get_" + fieldName, getter.Name);
Symbols\AssemblyAndNamespaceTests.cs (6)
34Assert.Equal(simpleName, sym.Name, StringComparer.OrdinalIgnoreCase); 36Assert.Equal(String.Empty, sym.GlobalNamespace.Name); 60Assert.Equal("Test.dll", sym.Name); 63Assert.Equal(String.Empty, sym.GlobalNamespace.Name); 71Assert.Equal("Test", sym.ContainingAssembly.Name); 72Assert.Equal("Test", sym.ContainingSymbol.Name);
Symbols\DefaultInterfaceImplementationTests.cs (2)
16592var test1P2 = test1.GetMembers().OfType<PropertySymbol>().Where(p => p.Name.StartsWith(i1.Name)).Single(); 30005var test1P2 = test1.GetMembers().OfType<EventSymbol>().Where(p => p.Name.StartsWith(i1.Name)).Single();
Symbols\ErrorTypeSymbolTests.cs (1)
71var types = new[] { "C1", "C2", "C3", "C4", "C5", "C6", "C7" }.Select(name => allTypes.First(t => t.Name == name).BaseType()).ToArray();
Symbols\ExtensionMethodTests.cs (5)
3155Assert.Equal("InstanceMethod", firstInvocationSymbol.Name); 3161Assert.Equal("ExtensionMethod", secondInvocationSymbol.Name); 3784var symbols = model.LookupSymbols(member.Expression.EndPosition, type, includeReducedExtensionMethods: true).Select(s => s.Name).ToArray(); 3919Assert.Empty(model.LookupSymbols(instance.Position, baseClass, includeReducedExtensionMethods: true).Where(s => s.Name == "SetMembers")); 4014Assert.Empty(model.LookupSymbols(instance.Position, baseClass, includeReducedExtensionMethods: true).Where(s => s.Name == "SetMembers"));
Symbols\ImplicitClassTests.cs (2)
119Assert.Equal("A", model.GetDeclaredSymbol(namespaceDecl).Name); 120Assert.Equal("Goo", model.GetDeclaredSymbol(methodDecl).Name);
Symbols\IndexerTests.cs (1)
2847Assert.Equal(WellKnownMemberNames.Indexer, idxSymbol2.Symbol.Name);
Symbols\Metadata\PE\LoadingMethods.cs (1)
1182Assert.Equal(m.Name == ".cctor" ? MethodKind.StaticConstructor : MethodKind.Constructor, ((MethodSymbol)m).MethodKind);
Symbols\Retargeting\NoPia.cs (1)
2676Assert.Equal("Pia.dll", test.ContainingModule.Name);
Symbols\Source\DeclaringSyntaxNodeTests.cs (2)
144Assert.Equal(name, sym.Name); 360var members = symbol.GetMembers(member.Name);
Symbols\Source\EventTests.cs (1)
43var actual = string.Join(", ", actualSymbols.Where(s => !s.IsImplicitlyDeclared).Select(symbol => symbol.Name).OrderBy(name => name));
Symbols\Source\ExternAliasTests.cs (2)
489Assert.Equal("A", externAliasSymbol.Name); 495Assert.Equal("C", usingAliasSymbol.Name);
Symbols\Source\MethodTests.cs (4)
77ct.Name 118Assert.Equal(WellKnownMemberNames.InstanceConstructorName, m.Name); 122Assert.Equal("x", x.Name); 124Assert.Equal("Int32", x.Type.Name); // fully qualified to work around a metadata reader bug
Symbols\Source\NullablePublicAPITests.cs (13)
288return c.GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("M")).ToArray(); 480var members = c.GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("M")).ToArray(); 488members = e.GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("M")).Select(m => m.ReduceExtensionMethod(m.Parameters[0].Type)).ToArray(); 693comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("I")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 757comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("I")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 822comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("I")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 889comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("IB")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 1179context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_descriptor2, declarator.GetLocation(), declaredSymbol.Name, declaredSymbol.NullableAnnotation)); 2636Assert.Equal("s", symbol.Name); 4124var o2Result = lookupResults.OfType<ILocalSymbol>().First(l => l.Name == "o2"); 4125var o8Result = lookupResults.OfType<ILocalSymbol>().First(l => l.Name == "o8"); 4129var o1Result = lookupResults.OfType<IParameterSymbol>().First(p => p.Name == "o1"); 4130var oResult = lookupResults.OfType<IParameterSymbol>().First(p => p.Name == "o");
Symbols\Source\UsingAliasTests.cs (1)
525Assert.Equal("for", alias.Name);
Symbols\TypeTests.cs (3)
624if (m.Name == "field1") 629else if (m.Name == "field2") 1681var locals = localvars.OrderBy(s => s.Name).Select(s => s).ToArray();
Symbols\UnsignedRightShiftTests.cs (8)
131Assert.Equal("op_UnsignedRightShift", unsignedShiftSymbol.Name); 132Assert.Equal("op_RightShift", shiftSymbol.Name); 634Assert.Equal("op_UnsignedRightShift", unsignedShiftSymbol.Name); 635Assert.Equal("op_RightShift", shiftSymbol.Name); 1184Assert.Equal("op_UnsignedRightShift", unsignedShiftSymbol.Name); 1185Assert.Equal("op_RightShift", shiftSymbol.Name); 1592Assert.Equal("op_UnsignedRightShift", unsignedShiftSymbol.Name); 1593Assert.Equal("op_RightShift", shiftSymbol.Name);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (6)
AttributeValidation.cs (1)
30var isUnmanagedTypeAttributes = attributeType.GetAttributes().OrderBy(attribute => attribute.AttributeClass.Name).ToArray();
CompilationTestUtils.cs (1)
350return symbols.Select(s => s.Name).Distinct().ToList();
CSharpTestBase.cs (2)
1787return attributes.Select(a => a.AttributeClass.Name); 1792return attributes.Select(a => a.AttributeClass.Name);
TestAttributesVisitor.cs (2)
160var name = attribute.AttributeClass!.Name; 212if (containingType.Name == name && containingType.ContainingNamespace.QualifiedName == namespaceName)
Microsoft.CodeAnalysis.CSharp.Workspaces (97)
Classification\SyntaxClassification\NameSyntaxClassifier.cs (2)
159symbol is IParameterSymbol { ContainingSymbol: IMethodSymbol { Name: WellKnownMemberNames.TopLevelStatementsEntryPointMethodName } }) 212if (parameterSymbol.IsImplicitlyDeclared && parameterSymbol.Name == "value")
CodeGeneration\CSharpSyntaxGenerator.cs (2)
372=> SyntaxFactory.DestructorDeclaration(destructorMethod.ContainingType.Name).WithBody(SyntaxFactory.Block()); 1738SyntaxFactory.Identifier(typeParameter.Name));
Recommendations\CSharpRecommendationServiceRunner.cs (2)
392if (context.ContainingTypeDeclaration != null && symbol.ContainingSymbol.Name == WellKnownMemberNames.TopLevelStatementsEntryPointMethodName) 452var parameterName = parameterSymbol.Name;
Recommendations\CSharpRecommendationServiceRunner_Operators.cs (2)
38if (method.Name is WellKnownMemberNames.TrueOperatorName or WellKnownMemberNames.FalseOperatorName) 64switch (symbol.Name)
Rename\CSharpRenameRewriterLanguageService.cs (22)
573if (oldIdentifier != _renamedSymbol.Name) 761.Where(s => s.MatchesKind(SymbolKind.Local, SymbolKind.Parameter) && s.Name == token.ValueText); 798AddSymbolSourceSpans(conflicts, namedType.GetMembers(renamedSymbol.Name), reverseMappedLocations); 803containingNamedType.Name == renamedSymbol.Name) 909if (renamedSymbol.ContainingType != null && renamedSymbol.ContainingType.GetMembers(renamedSymbol.Name).Contains(renamedSymbol)) 912.Where(t => t.Name == renamedSymbol.Name) 983string.Compare(renameSymbol.Name, "Current", StringComparison.OrdinalIgnoreCase) == 0; 988(string.Compare(renameSymbol.Name, WellKnownMemberNames.MoveNextMethodName, StringComparison.OrdinalIgnoreCase) == 0 || 989string.Compare(renameSymbol.Name, WellKnownMemberNames.GetEnumeratorMethodName, StringComparison.OrdinalIgnoreCase) == 0 || 990string.Compare(renameSymbol.Name, WellKnownMemberNames.GetAwaiter, StringComparison.OrdinalIgnoreCase) == 0 || 991string.Compare(renameSymbol.Name, WellKnownMemberNames.DeconstructMethodName, StringComparison.OrdinalIgnoreCase) == 0)); 997if (renamedSymbol.Name != renameSymbol.Name) 1032if ((renamedSymbol.Name == "MoveNext" || renamedSymbol.Name == "GetEnumerator" || renamedSymbol.Name == "Current") && renamedSymbol.GetAllTypeArguments().Length == 0) 1042renamedSymbol.Name) 1056if (symbol.Name == "MoveNext") 1063else if (symbol.Name == "GetEnumerator") 1074else if (symbol.Kind == SymbolKind.Property && symbol.Name == "Current")
Simplification\CSharpSimplificationService.Expander.cs (2)
542var aliasAnnotationInfo = AliasAnnotation.Create(aliasInfo.Name); 592var name = symbol.Name;
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (1)
259var aliasName = aliasReplacement.Name;
Simplification\Simplifiers\ExpressionSimplifier.cs (2)
143var text = aliasReplacement.Name; 157aliasReplacement.Name,
Simplification\Simplifiers\NameSimplifier.cs (2)
119var text = aliasReplacement.Name; 132aliasReplacement.Name,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (5)
158returnType.Name is not nameof(Task) and not nameof(ValueTask) && 159UnwrapTupleType(containingType).Name.Equals(returnType.Name) && 177: returnType.Name; 179return methodSymbol.Name.Equals("To" + returnTypeName, StringComparison.Ordinal);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ConversionExtensions.cs (1)
20conversion.MethodSymbol.Name == "op_Implicit";
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ILocalSymbolExtensions.cs (2)
21HasTypeParameterWithName(localFunctionOrMethodDeclaration, localSymbol.Type.Name) && 22HasTypeParameterWithName(localFunctionStatement, localSymbol.Type.Name))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (2)
448if (SyntaxFacts.GetContextualKeywordKind(parameter.Name) is not SyntaxKind.UnderscoreToken) 450return parameter.Name;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\TypeSyntaxExtensions.cs (1)
44if (type.Name == "var")
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
1465if (originalParameter.Name != rewrittenParameter.Name &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
324Name: nameof(Func<int>) or nameof(Action<int>), 325ContainingSymbol: INamespaceSymbol { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true }
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (2)
30attributes.OrderBy(a => a.AttributeClass?.Name) 42attributes.OrderBy(a => a.AttributeClass?.Name)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (1)
66var member = EnumMemberDeclaration(enumMember.Name.ToIdentifierToken())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EventGenerator.cs (2)
124[VariableDeclarator(@event.Name.ToIdentifierToken())])))); 138identifier: @event.Name.ToIdentifierToken(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (1)
105[AddAnnotationsTo(field, VariableDeclarator(field.Name.ToIdentifierToken(), null, initializer))]));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (7)
131identifier: method.Name.ToIdentifierToken(), 153Name: nameof(EnumeratorCancellationAttribute), 154ContainingNamespace.Name: nameof(System.Runtime.CompilerServices), 155ContainingNamespace.ContainingNamespace.Name: nameof(System.Runtime), 156ContainingNamespace.ContainingNamespace.ContainingNamespace.Name: nameof(System), 171identifier: method.Name.ToIdentifierToken(), 263typeParameter.Name.ToIdentifierName(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (4)
203RecordKeyword, classOrStructKeyword, namedType.Name.ToIdentifierToken(), 212typeDeclaration = TypeDeclaration(kind, namedType.Name.ToIdentifierToken()); 237namedType.Name.ToIdentifierToken(), 255namedType.Name.ToIdentifierToken(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamespaceGenerator.cs (1)
158NameEquals(alias.Name.ToIdentifierName()),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\OperatorGenerator.cs (1)
84throw new ArgumentException(string.Format(WorkspaceExtensionsResources.Cannot_generate_code_for_unsupported_operator_0, method.Name), nameof(method));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ParameterGenerator.cs (1)
68return Parameter(parameter.Name.ToIdentifierToken())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (1)
129identifier: property.Name.ToIdentifierToken(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\TypeParameterGenerator.cs (1)
36symbol.Name.ToIdentifierToken());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (3)
114_importedTypes.Add((type.Name, type.Arity), ns); 121_importedExtensionMethods.Add(method.Name, ns); 256foreach (var conflictingSymbol in _importedExtensionMethods[method.Name])
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (1)
89typeParameter.Name.ToIdentifierName(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (1)
87var syntax = AddInformationTo(symbol.Name.ToIdentifierName(), symbol);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (9)
48=> AddInformationTo(symbol.Name.ToIdentifierName(), symbol); 149? null : symbol.Signature.UnmanagedCallingConventionTypes.Select(type => GetConventionForString(type.Name["CallConv".Length..])), 188if (symbol.Name == string.Empty || symbol.IsAnonymousType) 195if (symbol.TypeKind == TypeKind.Error && symbol.Name == "var") 200return symbol.Name.ToIdentifierName(); 208symbol.Name.ToIdentifierToken(), 256var name = element.IsImplicitlyDeclared ? default : Identifier(element.Name); 320var syntax = AddInformationTo(symbol.Name.ToIdentifierName(), symbol); 362TypeSyntax typeSyntax = AddInformationTo(symbol.Name.ToIdentifierName(), symbol);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (4)
38(otherSideType.Name == string.Empty || otherSideType.Name == "var"); 780.Where(p => p.Name == name) 2220if (descendant.Identifier.ValueText != symbol.Name)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\CSharpInitializeParameterService.cs (2)
62var left = (ArgumentSyntax)generator.Argument(generator.MemberAccessExpression(generator.ThisExpression(), generator.IdentifierName(fieldOrProperty.Name))); 63var right = (ArgumentSyntax)generator.Argument(generator.IdentifierName(parameter.Name));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (3)
44var initializer = EqualsValueClause(IdentifierName(parameter.Name.EscapeIdentifier())); 122identifierName.Identifier.ValueText == parameter.Name) 128IdentifierName(fieldOrProperty.Name.EscapeIdentifier()).WithTriviaFrom(identifierName));
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (5)
CodeGeneration\SymbolEditorTests.cs (3)
560Assert.Equal("X", newSymbol.Name); 597Assert.Equal("X", newSymbol.Name); 655Assert.Equal("C", newSymbol.Name);
CodeGeneration\SyntaxGeneratorTests.cs (2)
990m.Name == WellKnownMemberNames.ExplicitConversionName && m.Parameters[0].Type.Equals(gcHandleType)); 998m.Name == WellKnownMemberNames.ImplicitConversionName && m.Parameters[0].Type.Equals(_emptyCompilation.GetSpecialType(SpecialType.System_Byte)));
Microsoft.CodeAnalysis.EditorFeatures (4)
InlineRename\AbstractEditorInlineRenameService.SymbolRenameInfo.cs (4)
86var searchName = this.RenameSymbol.Name; 91searchName = _info.GetWithoutAttributeSuffix(this.RenameSymbol.Name); 126public string DisplayName => RenameSymbol.Name; 168if (symbolSourceDocument != null && WorkspacePathUtilities.TypeNameMatchesDocumentName(symbolSourceDocument, RenameSymbol.Name))
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
PullMemberUp\TestPullMemberUpService.cs (2)
55destination = allInterfaces.SingleOrDefault(@interface => @interface.Name == DestinationName); 62if (i.Name == DestinationName)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (9)
CodeGeneration\CodeGenerationTests.cs (1)
257var expectedMessage = string.Format(WorkspaceExtensionsResources.Cannot_generate_code_for_unsupported_operator_0, method.Name);
SymbolFinder\DependentTypeFinderTests.cs (4)
492AssertEx.SetEqual(immediateDerived.Select(d => d.Name), 500AssertEx.SetEqual(transitiveDerived.Select(d => d.Name), 545AssertEx.SetEqual(immediateImpls.Select(d => d.Name), 552AssertEx.SetEqual(transitiveImpls.Select(d => d.Name),
Utilities\SymbolEquivalenceComparerTests.cs (4)
1718var namespace1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetNamespaceMembers().Single(n => n.Name == "N").GetNamespaceMembers().Single(n => n.Name == "M"); 1719var namespace2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetNamespaceMembers().Single(n => n.Name == "N").GetNamespaceMembers().Single(n => n.Name == "M");
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (1)
Diagnostics\DiagnosticServiceTests.vb (1)
1785_symbolNames.Add(context.Symbol.Name)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
InstructionDecoder.cs (1)
100builder.Append(parameter.Name);
Microsoft.CodeAnalysis.Features (275)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (2)
78var parameterName = _missingParameters[i].Name; 92var signature = $"{_containingType.Name}({parameterString})";
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.State.cs (2)
120!parameterNamesForSelectedMembers.Except(constructorParams.Select(p => p.Name)).Any(); 133if (!constructorParamNames.Contains(parameter.Name))
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (2)
100=> methodSymbol is { Name: nameof(ToString), Arity: 0, Parameters.IsEmpty: true }; 103=> methodSymbol is { Name: DebuggerDisplayMethodName, Arity: 0, Parameters.IsEmpty: true };
AddImport\SymbolReferenceFinder.cs (1)
314Equals(propertyType.Name, symbol.Name))
AddImport\SymbolReferenceFinder_PackageAssemblySearch.cs (1)
188if (assemblySymbol?.Name == result.AssemblyName)
ChangeSignature\AbstractChangeSignatureService.cs (8)
118if (method.Name == WellKnownMemberNames.DelegateBeginInvokeName && 316if (methodSymbol.Name == WellKnownMemberNames.DelegateBeginInvokeName && 526newArguments.Add(argument.WithName(param.Name).WithAdditionalAnnotations(Formatter.Annotation)); 549newArguments.Add(paramsArrayArgument.WithName(param.Name).WithAdditionalAnnotations(Formatter.Annotation)); 617var match = originalParameters.FirstOrDefault(p => p.Name == name); 850newArgument = AddNameToArgument(newArgument, parameters[indexInListOfPreexistingArguments].Name); 856newArgument = AddNameToArgument(newArgument, parameters[indexInListOfPreexistingArguments].Name); 883newArgument = AddNameToArgument(newArgument, parameters[indexInListOfPreexistingArguments].Name);
CodeRefactorings\MoveType\AbstractMoveTypeService.State.cs (2)
62typeSymbol.Name == string.Empty) 68TypeName = typeSymbol.Name;
Completion\CommonCompletionUtilities.cs (1)
220if (!symbol.Name.TryGetWithoutAttributeSuffix(syntaxFacts.IsCaseSensitive, out name) ||
Completion\Providers\AbstractContextVariableArgumentProvider.cs (6)
70&& !string.Equals(candidate.Name, context.Parameter.Name, StringComparison.OrdinalIgnoreCase)) 138bestSymbolName = overridingName ?? bestSymbol.Name; 155if (string.Equals(bestSymbol.Name, context.Parameter.Name)) 156return string.Equals(symbol.Name, context.Parameter.Name); 158if (string.Equals(bestSymbol.Name, context.Parameter.Name, StringComparison.OrdinalIgnoreCase)) 159return string.Equals(symbol.Name, context.Parameter.Name, StringComparison.OrdinalIgnoreCase);
Completion\Providers\AbstractDocCommentCompletionProvider.cs (3)
163var names = GetParameters(symbol).Select(p => p.Name); 188.Select(parameter => CreateCompletionItem(parameter.Name)); 263var names = symbols.Select(p => p.Name).ToSet();
Completion\Providers\AbstractOverrideCompletionProvider.cs (1)
46methodSymbol.Name == "ToString" &&
Completion\Providers\AbstractPartialMethodCompletionProvider.cs (1)
76name: member.Name,
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (1)
263return kind != null && info.Symbol.Kind == kind && info.Symbol.Name == name && isGeneric == info.Symbol.GetArity() > 0;
Completion\Providers\AbstractSymbolCompletionProvider.cs (3)
244return displayText == symbol.Name || displayText is ['@', ..] || (context.IsAttributeNameContext && symbol.IsAttribute()) 246: symbol.Name; 348var symbolNameAndKind = (symbolAndSelectionInfo.Symbol.Name, symbolAndSelectionInfo.Symbol.Kind);
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionProvider.cs (2)
78Name: not null, 106var typeNameOfTarget = target.Name;
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (3)
248containingNamespace = ConcatNamespace(containingNamespace, symbol.Name); 264overloads.TryGetValue(type.Name, out var overloadInfo); 265overloads[type.Name] = overloadInfo.Aggregate(type);
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.cs (3)
160var overloadKey = (containingNamespacename, symbol.Name, isGeneric: symbol.Arity > 0); 235return symbol.Name; 243name = GetFullyQualifiedNamespaceName(symbol.ContainingNamespace, stringCache) + "." + symbol.Name;
Completion\Providers\ImportCompletionProvider\TypeImportCompletionCacheEntry.cs (2)
192var isAttribute = symbol.Name.HasAttributeSuffix(isCaseSensitive: false) && symbol.IsAttribute(); 198symbol.Name,
Completion\Providers\SymbolCompletionItem.cs (3)
70filterText: filterText ?? (displayText is ['@', ..] ? displayText : firstSymbol.Name), 71sortText: sortText ?? firstSymbol.Name, 89properties.Add(KeyValuePairUtil.Create("SymbolName", symbol.Name));
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (5)
227var className = classSymbol.Name; 235classSymbol.TypeParameters.Select(tp => g.IdentifierName(tp.Name))); 335if (originalProperty.Name != newProperty.Name) 358GetLegalName(prop.Name.ToPascalCase(trimLeadingTypePrefix: false), document), 388parameterToPropMap[parameter.Name] = prop;
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (6)
93if (type is { Name: nameof(CultureInfo), ContainingNamespace.Name: nameof(System.Globalization), ContainingNamespace.ContainingNamespace.Name: nameof(System) }) 103var shouldReplaceInvocation = invocationSymbol is { ContainingType.SpecialType: SpecialType.System_String, Name: nameof(string.Format) }; 274var param1 = invocationSymbol.Parameters.FirstOrDefault(p => syntaxFacts.StringComparer.Equals(p.Name, arg1Name)); 275var param2 = invocationSymbol.Parameters.FirstOrDefault(p => syntaxFacts.StringComparer.Equals(p.Name, arg2Name));
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (6)
415: (TNameSyntax)generator.GenericName(structNameToken, typeParameters.Select(tp => generator.IdentifierName(tp.Name))); 680if (!comparer.Equals(fields1[i].Name, fields2[i].Name)) 860generator.IdentifierName(constructor.Parameters[index].Name), 863field.Name)))).ToImmutableArray(); 935parameterToPropMap[parameter.Name] = field;
Debugging\AbstractBreakpointResolver.cs (2)
163return comparer.Equals(namespaceSymbol.Name, nameAndArity.Name) && nameAndArity.Arity == 0; 165return comparer.Equals(typeSymbol.Name, nameAndArity.Name) &&
Debugging\AbstractDataTipInfoGetter.cs (3)
48ContainingType.Name: nameof(Enumerable), 49ContainingType.ContainingNamespace.Name: nameof(System.Linq), 50ContainingType.ContainingNamespace.ContainingNamespace.Name: nameof(System),
DesignerAttribute\DesignerAttributeDiscoveryService.cs (4)
344var wellKnownType = compilation.GetTypeByMetadataName($"{wellKnownNamespace}.{errorType.Name}"); 357Name: nameof(DesignerCategoryAttribute), 358ContainingNamespace.Name: nameof(System.ComponentModel), 359ContainingNamespace.ContainingNamespace.Name: nameof(System),
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (3)
307symbol.Name, 1296diagnosticContext.Report(RudeEditKind.MemberBodyTooBig, cancellationToken, arguments: [newMember.Name]); 1300diagnosticContext.Report(RudeEditKind.MemberBodyInternalError, cancellationToken, arguments: [newMember.Name, e.ToString()]);
EditAndContinue\Utilities\Extensions.cs (1)
188static (member, parameter) => member is IFieldSymbol field && ParsePrimaryParameterBackingFieldName(field.Name, out var paramName) && paramName == parameter.Name, parameter);
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (1)
175return parameter?.Name == FormatName;
EmbeddedLanguages\EmbeddedLanguageDetector.cs (7)
178Name: nameof(IFormattable), 181Name: nameof(System), 349var localName = localSymbol.Name; 469Name: "StringSyntaxAttribute", 472Name: nameof(CodeAnalysis), 475Name: nameof(Diagnostics), 478Name: nameof(System),
EmbeddedLanguages\Json\LanguageServices\JsonLanguageDetector.cs (1)
166if (exprType.Name != nameof(JsonDocumentOptions))
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (2)
65where method.Parameters.Any(static p => p.Name == _patternName) 186if (exprType.Name == nameof(RegexOptions))
EncapsulateField\AbstractEncapsulateFieldService.cs (5)
99string.Format(FeaturesResources.Encapsulate_field_colon_0_and_use_property, field.Name), 101nameof(FeaturesResources.Encapsulate_field_colon_0_and_use_property) + "_" + field.Name), 103string.Format(FeaturesResources.Encapsulate_field_colon_0_but_still_use_field, field.Name), 105nameof(FeaturesResources.Encapsulate_field_colon_0_but_still_use_field) + "_" + field.Name), 244if (finalFieldName != field.Name && constructorLocations.Count > 0)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (2)
132Logger.Log(FunctionId.WorkCoordinator_SemanticChange_EnqueueFromType, symbol.Name); 159Logger.Log(FunctionId.WorkCoordinator_SemanticChange_EnqueueFromMember, symbol.Name);
ExtractInterface\AbstractExtractInterfaceService.cs (6)
265var candidateInterfaceName = type.TypeKind == TypeKind.Interface ? type.Name : "I" + type.Name; 386name: @event.Name)); 396name: method.Name, 416name: property.Name, 434m.Name == "<Clone>$") // TODO: Use WellKnownMemberNames.CloneMethodName when it's public.
ExtractMethod\MethodExtractor.Analyzer.cs (3)
350string.Join(", ", failedVariables.Select(v => v.Name)))); 597if (symbol.Name.IsEmpty()) 1019names.Add(field.Name ?? string.Empty);
ExtractMethod\MethodExtractor.VariableSymbol.cs (3)
80Name: nameof(CancellationToken), 83Name: nameof(System.Threading), 86Name: nameof(System),
FindUsages\FindUsagesHelpers.cs (2)
19=> symbol.IsConstructor() ? symbol.ContainingType.Name : symbol.Name;
FullyQualify\AbstractFullyQualifyService.cs (1)
207memberName = member != null ? member.Name : name;
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (1)
167compareMethod.Name != nameof(IComparable.CompareTo);
GenerateType\AbstractGenerateTypeService.cs (1)
201var name = type.Name;
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (5)
301if (targetMethod?.Name is nameof(string.IsNullOrEmpty) or nameof(string.IsNullOrWhiteSpace)) 387(TExpressionSyntax)generator.CreateNullCheckExpression(generator.SyntaxGeneratorInternal, semanticModel, parameter.Name), 401generator.Argument(generator.IdentifierName(parameter.Name))); 559generator.NameOfExpression(generator.IdentifierName(parameter.Name))); 578var nameofExpression = generator.NameOfExpression(generator.IdentifierName(parameter.Name));
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (6)
202string.Format(FeaturesResources.Create_and_assign_field_0, field.Name), 204nameof(FeaturesResources.Create_and_assign_field_0) + "_" + field.Name); 206string.Format(FeaturesResources.Create_and_assign_property_0, property.Name), 208nameof(FeaturesResources.Create_and_assign_property_0) + "_" + property.Name); 251var title = string.Format(resource, fieldOrProperty.Name); 531.GetMembers(fieldOrProperty.Name)
InitializeParameter\AbstractInitializeParameterCodeRefactoringProvider.cs (1)
135return parameter is { Name: not "" };
InlineHints\AbstractInlineParameterNameHintsService.cs (5)
176var name = parameter?.Name; 194var name = parameter?.Name; 241var methodName = method.Name; 254return SuffixMatchesParameterName(suffix, parameter.Name); 286return syntaxFacts.StringComparer.Compare(parameter.Name, argumentName) == 0;
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (2)
281var name = renameTable.TryGetValue(parameterSymbol, out var newName) ? newName : parameterSymbol.Name; 371symbol.Name,
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (2)
428? generator.GenericName(_methodSymbol.Name, _methodSymbol.TypeArguments) 429: generator.IdentifierName(_methodSymbol.Name);
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (1)
132return declarator.Symbol.Name;
LanguageServiceIndexFormat\SymbolMoniker.cs (2)
58var symbolMoniker = symbol.ContainingAssembly.Name + "#"; 62symbolMoniker += GetRequiredDocumentationCommentId(symbol.ContainingSymbol) + "#" + symbol.Name;
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.cs (1)
97typeParts.Add(Part(kind, structuralType, structuralType.Name));
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
737parts.AddRange(TypeParameterName(typeParameters[i].Name));
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
71public string Name => _symbol.Name;
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (2)
90useDecompiler = !symbol.ContainingAssembly.GetAttributes().Any(static attribute => attribute.AttributeClass?.Name == nameof(SuppressIldasmAttribute) 215topLevelNamedType.Name,
MetadataAsSource\MetadataAsSourceGeneratedFileInfo.cs (1)
45this.TemporaryFilePath = Path.Combine(rootPath, directoryName, topLevelNamedType.Name + extension);
MetadataAsSource\MetadataAsSourceHelpers.cs (1)
109if (attribute.AttributeClass?.Name == nameof(ReferenceAssemblyAttribute) &&
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (1)
315replacement = generator.GenericName(newType.Name, newTypeArgs);
NameTupleElement\AbstractNameTupleElementCodeRefactoringProvider.cs (1)
79return (root, argument, element.Name);
PreferFrameworkType\PreferFrameworkTypeCodeFixProvider.cs (1)
61? generator.QualifiedName(generator.GlobalAliasedName(generator.IdentifierName(nameof(System))), generator.IdentifierName(typeSymbol.Name))
PullMemberUp\MembersPuller.cs (2)
51var title = result.Destination.Name; 502return destination.GetMembers(fieldSymbol.Name).Any();
QuickInfo\QuickInfoUtilities.cs (2)
139NullableFlowState.MaybeNull => string.Format(FeaturesResources._0_may_be_null_here, symbol.Name), 140NullableFlowState.NotNull => string.Format(FeaturesResources._0_is_not_null_here, symbol.Name),
Rename\SymbolicRenameInfo.cs (2)
73var nameWithoutAttribute = GetWithoutAttributeSuffix(this.Symbol.Name); 80if (HasAttributeSuffix(this.Symbol.Name))
ReplaceConditionalWithStatements\AbstractReplaceConditionalWithStatementsCodeRefactoringProvider.cs (1)
239var identifier = generator.IdentifierName(symbol.Name);
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (1)
95var childMember = namedType.GetMembers().FirstOrDefault(m => syntaxFacts.StringComparer.Equals(m.Name, singleWordText));
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (2)
99var setMethodName = "Set" + getMethod.Name[GetPrefix.Length..]; 102.Where(m => setMethodName.Equals(m.Name, StringComparison.OrdinalIgnoreCase))
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (3)
41var memberName = generator.IdentifierName(propertyBackingField.Name); 340var newIdentifierToken = AddConflictAnnotation(Generator.Identifier(_propertyBackingField.Name), conflictMessage); 363var newIdentifierToken = AddConflictAnnotation(Generator.Identifier(_propertyBackingField.Name), conflictMessage);
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (3)
53var propertyName = propertySymbol.Name; 76var desiredMethodSuffix = NameGenerator.GenerateUniqueName(propertySymbol.Name, 169property.Name.ToCamelCase(),
RQName\RQNodeBuilder.cs (8)
45parts.Add(@namespace.Name); 81typeInfos.Insert(0, new RQUnconstructedTypeInfo(currentType.Name, currentType.TypeParameters.Length)); 96return new RQMemberVariable(containingType, symbol.Name); 103: RQOrdinaryMethodPropertyOrEventName.CreateOrdinaryPropertyName(symbol.Name); 178RQMethodPropertyOrEventName name = RQOrdinaryMethodPropertyOrEventName.CreateOrdinaryEventName(symbol.Name); 222name = RQOrdinaryMethodPropertyOrEventName.CreateOrdinaryMethodName(symbol.Name); 291return new RQTypeVariableType(symbol.Name); 295return new RQErrorType(symbol.Name);
Shared\Extensions\ISymbolExtensions_2.cs (3)
197ITypeParameterSymbol typeParam => typeParam.ContainingSymbol.GetDocumentationComment(compilation, expandIncludes: true, expandInheritdoc: true, cancellationToken: cancellationToken)?.GetTypeParameter(typeParam.Name) ?? DocumentationComment.Empty, 212var symbolName = methodSymbol.Name; 229return containingSymbol.OriginalDefinition.GetDocumentationComment(compilation, expandIncludes: true, expandInheritdoc: true, cancellationToken: cancellationToken)?.GetParameter(parameter.Name);
Shared\Utilities\LinkedFilesSymbolEquivalenceComparer.cs (3)
19=> x?.Name == y?.Name; 22=> symbol.Name.GetHashCode();
Snippets\SnippetFunctionService.cs (2)
72var simplifiedTypeName = await GetSimplifiedEnumNameAsync(document, fullyQualifiedEnumName, enumFields.First().Name, caseGenerationLocation, simplifierOptions, cancellationToken).ConfigureAwait(false); 81casesBuilder.AppendFormat(SwitchCaseFormat, simplifiedTypeName, member.Name);
src\Analyzers\Core\Analyzers\ConvertTypeofToNameof\AbstractConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
65var parentProperty = operationParent.Property.Name;
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (1)
116if (conversion.IsUserDefined && conversion.MethodSymbol is { Name: WellKnownMemberNames.ImplicitConversionName })
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (1)
64if (owningSymbol is not IMethodSymbol { Name: nameof(GetHashCode) } method)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.OperationDeconstructor.cs (1)
78if (targetMethod.Name == nameof(GetHashCode) &&
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (4)
118if (string.IsNullOrEmpty(symbol.Name)) 149if (!cache.TryGetValue(symbol.Name, out var failureReason)) 151if (applicableRule.NamingStyle.IsNameCompliant(symbol.Name, out failureReason)) 156cache.TryAdd(symbol.Name, failureReason);
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
832attribute.AttributeConstructor?.Parameters is [_, { Name: "checkId", Type.SpecialType: SpecialType.System_String }, ..] && 840if (attribute.AttributeConstructor.Parameters[0].Name == "category" &&
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\SuppressMessageAttributeState.cs (1)
65builder.Add((propertyReference.Property.Name, simpleAssignment.Value));
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (5)
533if (debuggerDisplayAttributeArguments.Any(arg => arg.Contains(member.Name))) 857&& methodSymbol.Name is "GetAwaiter" or "GetResult") 872if (_iNotifyCompletionType != null && memberSymbol.ContainingType.AllInterfaces.Contains(_iNotifyCompletionType) && memberSymbol.Name == "IsCompleted") 904if (methodSymbol.Name.StartsWith(prefix)) 906var suffix = methodSymbol.Name[prefix.Length..];
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
579symbol.Name);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (2)
141parameter.Name, 205parameter.Name == DiscardVariableName ||
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (6)
81if (expression is IInvocationOperation { TargetMethod.Name: nameof(ToString) } invocation && 128&& method.Name == nameof(ToString); 143if (member.Name == nameof(CultureInfo.InvariantCulture)) 146if (member.Name == "InvariantInfo") 166TargetMethod: { Name: nameof(FormattableString.Invariant), ContainingType: var containingType }, 199var targetName = invocation.TargetMethod.Name;
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (2)
107if (s_nonEnumerableReturningLinqPredicateMethodNames.Contains(method.Name) || 108s_nonEnumerableReturningLinqSelectorMethodNames.Contains(method.Name))
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (3)
147fieldNames.Add(field.Name); 474static (field, property) => field.Name.EndsWith(property.Name, StringComparison.OrdinalIgnoreCase),
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
174syntaxFacts.GetIdentifierOfIdentifierName(identifier).ValueText == localSymbol.Name)
src\Analyzers\Core\Analyzers\UseExplicitTupleName\UseExplicitTupleNameDiagnosticAnalyzer.cs (3)
62nameof(ElementName), namedField.Name); 87!fieldSymbol.Name.Equals(unnamedField.Name))
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (1)
25Name: nameof(Nullable<int>.Value),
src\Analyzers\Core\Analyzers\UseObjectInitializer\UseNamedMemberInitializerAnalyzer.cs (1)
168statement, leftMemberAccess, rightExpression, typeMember?.Name ?? identifier.ValueText));
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
248if (p.Name == searchArgumentName)
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
202if (argumentName.Equals(parameters[j].Name))
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
440methodParameterNames.AddRange(method.Parameters.Select(p => p.Name));
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (2)
202[new ParameterName(parameter.Name, isFixed: true)], 234var uniqueName = NameGenerator.EnsureUniqueness(argumentNameSuggestion, method.Parameters.Select(p => p.Name));
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (3)
56var typeName = symbol.Name; 116if (string.IsNullOrEmpty(current.Name)) 119result.Add(current.Name);
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (6)
169delegatedConstructor.Parameters.Select(p => p.Name).ToList(), 175if (delegatedConstructor.Parameters.Select(p => p.Name).Intersect(remainingParameterNames.Select(n => n.BestNameForParameter)).Any()) 270? ctorParameter.Name == parameterName 271: string.Equals(ctorParameter.Name, parameterName, StringComparison.OrdinalIgnoreCase); 447typeName: TypeToGenerateIn.Name, 506TypeToGenerateIn.Name,
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.cs (2)
54state.ClassType.Name, 55string.Join(", ", constructor.Parameters.Select(p => p.Name))),
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\GenerateDefaultConstructorsCodeAction.cs (1)
67typeName: classType.Name,
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (2)
194isColorColorCase = typeInfo.Type != null && semanticInfo.Symbol != null && semanticInfo.Symbol.Name == typeInfo.Type.Name;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (1)
238var typeLocalName = parameter.Type.GetLocalName(fallback: parameter.Name);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (1)
74name: typeParameter.Name,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (1)
61if (_availableTypeParameterNames.Contains(symbol.Name))
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
181return ContainingMethod is { IsImplicitlyDeclared: false, Name: not WellKnownMemberNames.TopLevelStatementsEntryPointMethodName }
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
258generator.MemberAccessExpression(throughExpression, @event.Name),
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (2)
94return string.Format(CodeFixesResources.Implement_interface_through_0, options.ThroughMember.Name); 122options.ThroughMember?.Name;
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.cs (2)
115memberName: interfaceMember.Name, 116generateInvisibly: generator.ShouldGenerateInvisibleMember(document.Project.ParseOptions!, interfaceMember, interfaceMember.Name, supportsImplementingLessAccessibleMember),
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
110if (name == parameter.Name)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (7)
164if (IsReservedName(member.Name) || 170string.Format("{0}_{1}", member.ContainingType.Name, member.Name), 176return member.Name; 208memberName = generateInvisibleMember ? member.Name : memberName; 244if (member.Name != memberName) 299var accessibility = member.Name == memberName || generateAbstractly
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Conflicts.cs (2)
51if (!IdentifiersMatch(member1.Name, member2.Name))
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (3)
168g.IdentifierName(disposedValueField.Name), g.TrueLiteralExpression())); 171g.LogicalNotExpression(g.IdentifierName(disposedValueField.Name)), 179name: disposeMethod.Name,
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Method.cs (1)
64conflictingMethod.Name),
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
86symbol.Name,
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (3)
63var isEntryPoint = methodSymbol.IsStatic && IsLikelyEntryPointName(methodSymbol.Name, document); 132if (methodSymbol.Name.EndsWith(AsyncSuffix)) 162var name = methodSymbol.Name;
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (3)
62methodSymbol.Name.Length > AsyncSuffix.Length && 63methodSymbol.Name.EndsWith(AsyncSuffix)) 75var name = methodSymbol.Name;
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (1)
86var fixedNames = style.MakeCompliant(symbol.Name);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
181let caseLabel = (TMemberAccessExpression)generator.MemberAccessExpression(generator.TypeExpression(enumType), e.Name).WithAdditionalAnnotations(Simplifier.Annotation)
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
585var declarationStatement = CreateLocalDeclarationStatement(declaredLocal.Type, declaredLocal.Name);
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
46var title = string.Format(TitleFormat, type.Name);
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
552if (methodContext.TypeParameters[i].Name == typeParameterName) 564if (containingType.TypeParameters[i].Name == typeParameterName)
StackTraceExplorer\AbstractStackTraceSymbolResolver.cs (2)
80return type.Name == stackFrameType.ToString(); 95if (paramSymbol.Name != stackFrameParameter.Identifier.ToString())
StackTraceExplorer\StackFrameLocalMethodResolver.cs (1)
39.Where(member => member.Name == containingMethodName)
StackTraceExplorer\StackFrameMethodSymbolResolver.cs (1)
27.Where(m => m.Name == methodName)
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
172field, property.Name,
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (1)
157? WithName((TSimpleArgumentSyntax)argument.WithoutTrivia(), parameters[i].Name).WithTriviaFrom(argument)
Microsoft.CodeAnalysis.Test.Utilities (59)
Compilation\ControlFlowGraphVerifier.cs (3)
934TargetMethod: { Name: BoundInterpolatedString.AppendFormattedMethod or BoundInterpolatedString.AppendLiteralMethod, ContainingType: INamedTypeSymbol containingType } 1994Name: WellKnownMemberNames.TopLevelStatementsEntryPointMethodName, 1997Name: WellKnownMemberNames.TopLevelStatementsEntryPointTypeName,
Compilation\OperationTreeVerifier.cs (5)
270var symbolStr = symbol != null ? (logDisplayString ? symbol.ToTestDisplayString() : symbol.Name) : "null"; 667LogString($" (Label: {operation.Label.Name})"); 684var labelStr = !(operation.Target.IsImplicitlyDeclared || _labelIdMap.ContainsKey(operation.Target)) ? $", Label: {operation.Target.Name}" : $", Label Id: {GetLabelId(operation.Target)}"; 981LogString($": {operation.Local.Name}"); 1028LogString($": {operation.Parameter.Name}");
Compilation\TestOperationVisitor.cs (4)
815semanticModel.Compilation.CreateBuiltinOperator(symbol.Name, method.ReturnType, method.Parameters[0].Type); 818semanticModel.Compilation.CreateBuiltinOperator(symbol.Name, method.ReturnType, method.Parameters[0].Type, method.Parameters[1].Type); 1489Assert.Equal("Deconstruct", method.Name); 1493Assert.Equal("ITuple", type.Name);
Diagnostics\CommonDiagnosticAnalyzers.cs (30)
610codeBlockContext.ReportDiagnostic(Diagnostic.Create(CodeBlockTopLevelRule, codeBlockContext.OwningSymbol.Locations[0], codeBlockContext.OwningSymbol.Name)); 619codeBlockContext.ReportDiagnostic(Diagnostic.Create(CodeBlockPerCompilationRule, codeBlockContext.OwningSymbol.Locations[0], codeBlockContext.OwningSymbol.Name)); 1043symbolContext.ReportDiagnostic(Diagnostic.Create(Rule, symbolContext.Symbol.Locations[0], symbolContext.Symbol.Name)); 1152if (_symbolNames.Contains(type.Name)) 1177var diagnostic = Diagnostic.Create(Descriptor, symbolContext.Symbol.Locations[0], symbolContext.Symbol.Name); 1392var diagnostic = Diagnostic.Create(Descriptor, c.OwningSymbol.Locations[0], c.OwningSymbol.Name, operationRoot.Kind); 1445var diagnostic = Diagnostic.Create(Descriptor, operation.Syntax.GetLocation(), operation.Field.Name, operation.Field.ConstantValue); 1466var diagnostic = Diagnostic.Create(Descriptor, operationContext.Operation.Syntax.GetLocation(), operationContext.ContainingSymbol.Name); 1536sortedCallbackSymbolNames.Add($"{symbolContext.Symbol.Name}(IsGeneratedCode:{symbolContext.IsGeneratedCode})"); 1561sortedCallbackSyntaxNodeNames.Add($"{context.ContainingSymbol.Name}(IsGeneratedCode:{context.IsGeneratedCode})"), 1569sortedCallbackSymbolStartNames.Add($"{context.Symbol.Name}(IsGeneratedCode:{context.IsGeneratedCode})"); 1579sortedCallbackOperationBlockStartNames.Add($"{context.OwningSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})"); 1582sortedCallbackOperationNames.Add($"{context.ContainingSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})"), 1586sortedCallbackOperationBlockEndNames.Add($"{context.OwningSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})")); 1597sortedCallbackOperationBlockNames.Add($"{context.OwningSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})"); 1601sortedCallbackSymbolEndNames.Add($"{context.Symbol.Name}(IsGeneratedCode:{context.IsGeneratedCode})")); 1611sortedCallbackCodeBlockStartNames.Add($"{context.OwningSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})"); 1614sortedCallbackCodeBlockEndNames.Add($"{context.OwningSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})")); 1624sortedCallbackCodeBlockNames.Add($"{context.OwningSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})"); 1660ReportDiagnosticsCore(addDiagnostic, symbol.Locations[0], symbol.Name); 1706var diagnostic = Diagnostic.Create(Rule, namedType.Locations[0], namedType.Name, namedTypes.Count); 1814var diagnostic = Diagnostic.Create(descriptor, symbolContext.Symbol.Locations[0], symbolContext.Symbol.Name); 2049diagnostics.Add(Diagnostic.Create(DuplicateStartActionRule, Location.None, symbolStartContext.Symbol.Name, _analyzerId)); 2059diagnostics.Add(Diagnostic.Create(DuplicateEndActionRule, Location.None, symbolEndContext.Symbol.Name, _analyzerId)); 2064symbolEndContext.ReportDiagnostic(Diagnostic.Create(rule, Location.None, symbolStartContext.Symbol.Name, _analyzerId)); 2074operationContext.ReportDiagnostic(Diagnostic.Create(OperationRule, Location.None, symbolStartContext.Symbol.Name, operationContext.ContainingSymbol.Name, operationContext.Operation.Syntax.ToString(), _analyzerId)); 2463=> reportDiagnostic(Diagnostic.Create(_rule, symbol.Locations[0], symbol.Name)); 2823var arg = $"{actionName}({symbol.Name})"; 2843var arg = $"{actionName}({containingSymbol.Name})";
Diagnostics\OperationTestAnalyzer.cs (12)
107if (operationContext.ContainingSymbol.Name.StartsWith("Funky") && operationContext.Compilation.Language != "Mumble") 555operationContext.ReportDiagnostic(Diagnostic.Create(UseDefaultArgumentDescriptor, invocation.Syntax.GetLocation(), argument.Parameter.Name)); 1182if (equalsValue.InitializedFields[0].Name.StartsWith("F")) 1193if (equalsValue.Parameter.Name.StartsWith("F")) 1450if (label.Name == "Wilma" || label.Name == "Betty") 1464if (label.Name == "Wilma" || label.Name == "Betty") 1516if (binary.OperatorKind == BinaryOperatorKind.Add && binary.OperatorMethod != null && binary.OperatorMethod.Name.Contains("Addition")) 1532if (unary.OperatorKind == UnaryOperatorKind.Minus && unary.OperatorMethod != null && unary.OperatorMethod.Name.Contains("UnaryNegation")) 1618if (leftLocal.Name == "x") 1645if (operandLocal.Name == "x")
Diagnostics\SuppressMessageAttributeTests.DiagnosticAnalyzers.cs (5)
67if (context.Symbol.Name.StartsWith(_errorSymbolPrefix, StringComparison.Ordinal)) 69context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, context.Symbol.Locations.First(), messageArgs: context.Symbol.Name)); 100context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, context.Symbol.Locations.First(), messageArgs: context.Symbol.Name)); 154context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, context.OwningSymbol.Locations.First(), messageArgs: context.OwningSymbol.Name + ":end")); 173context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, context.OwningSymbol.Locations.First(), messageArgs: context.OwningSymbol.Name + ":end"));
Microsoft.CodeAnalysis.VisualBasic (42)
Compilation\DocumentationComments\DocumentationCommentCompiler.vb (1)
55''' <param name="assemblyName">Assembly name override, if specified. Otherwise the <see cref="ISymbol.Name"/> of the source assembly is used.</param>
Compilation\VisualBasicCompilation.vb (2)
1479Debug.Assert(namespaceSymbol.Name = "", "Namespace with Nothing container should be root namespace with empty name") 1488Return containingNs.GetMembers(namespaceSymbol.Name).OfType(Of NamespaceSymbol)().FirstOrDefault()
SymbolDisplay\SymbolDisplayVisitor.Members.vb (17)
30Builder.Add(CreatePart(SymbolDisplayPartKind.EnumMemberName, symbol, symbol.Name, visitedParents)) 32Builder.Add(CreatePart(SymbolDisplayPartKind.ConstantName, symbol, symbol.Name, visitedParents)) 34Builder.Add(CreatePart(SymbolDisplayPartKind.FieldName, symbol, symbol.Name, visitedParents)) 104Builder.Add(CreatePart(SymbolDisplayPartKind.PropertyName, symbol, symbol.Name, includedContainingType)) 140Builder.Add(CreatePart(SymbolDisplayPartKind.EventName, symbol, symbol.Name, visitedParents)) 312Builder.Add(CreatePart(SymbolDisplayPartKind.MethodName, symbol, symbol.Name, visitedParents)) 317Builder.Add(CreatePart(SymbolDisplayPartKind.ExtensionMethodName, symbol, symbol.Name, visitedParents)) 326Builder.Add(CreatePart(SymbolDisplayPartKind.MethodName, symbol, symbol.Name, visitedParents)) 332Builder.Add(CreatePart(SymbolDisplayPartKind.PropertyName, associatedPropertyOrEvent, associatedPropertyOrEvent.Name, visitedParents)) 334Builder.Add(CreatePart(SymbolDisplayPartKind.EventName, associatedPropertyOrEvent, associatedPropertyOrEvent.Name, visitedParents)) 340Builder.Add(CreatePart(SymbolDisplayPartKind.MethodName, symbol, symbol.Name, visitedParents)) 350Builder.Add(CreatePart(SymbolDisplayPartKind.MethodName, symbol, symbol.Name, visitedParents)) 365Builder.Add(CreatePart(SymbolDisplayPartKind.MethodName, symbol, symbol.Name, visitedParents)) 381Dim nameToCheck As String = symbol.Name 409If CaseInsensitiveComparison.Equals(symbol.Name, WellKnownMemberNames.ImplicitConversionName) Then 411ElseIf CaseInsensitiveComparison.Equals(symbol.Name, WellKnownMemberNames.ExplicitConversionName) Then 542Builder.Add(CreatePart(kind, symbol, symbol.Name, False))
SymbolDisplay\SymbolDisplayVisitor.Types.vb (4)
86Builder.Add(CreatePart(SymbolDisplayPartKind.TypeParameterName, symbol, symbol.Name, False)) 242symbolName = symbol.Name 396Builder.Add(CreatePart(SymbolDisplayPartKind.FieldName, element, element.Name, noEscaping:=False)) 414Return prop.Name & " As " & prop.Type.ToDisplayString(Format)
SymbolDisplay\SymbolDisplayVisitor.vb (8)
186Builder.Add(CreatePart(SymbolDisplayPartKind.LabelName, symbol, symbol.Name, False)) 190Builder.Add(CreatePart(SymbolDisplayPartKind.LocalName, symbol, symbol.Name, False)) 199Builder.Add(CreatePart(SymbolDisplayPartKind.ModuleName, symbol, symbol.Name, False)) 212Dim myCaseCorrectedNSName As String = symbol.Name 280Dim name = If(symbol.Name, "<anonymous local>") 305Builder.Add(CreatePart(SymbolDisplayPartKind.RangeVariableName, symbol, symbol.Name, False)) 319Dim part = New SymbolDisplayPart(SymbolDisplayPartKind.Text, symbol, symbol.Name) 397symbol.Name <> WellKnownMemberNames.EnumBackingFieldName
SymbolDisplay\SymbolDisplayVisitor_Minimal.vb (3)
36SemanticModelOpt.LookupNamespacesAndTypes(PositionOpt, name:=symbol.Name), 37SemanticModelOpt.LookupSymbols(PositionOpt, name:=symbol.Name)) 133Dim aliasName = [alias].Name
Symbols\AssemblySymbol.vb (1)
744Dim myKeys = Me.GetInternalsVisibleToPublicKeys(assemblyWantingAccess.Name)
Symbols\ModuleSymbol.vb (1)
274Return cns.GetNestedNamespace(namespaceSymbol.Name)
Symbols\Symbol.vb (1)
1307Private ReadOnly Property ISymbol_Name As String Implements ISymbol.Name, ISymbolInternal.Name
Symbols\TypedConstant.vb (4)
91Return typeName & "." & field.Name 111valueStringBuilder.Append(field.Name) 156Return typeName & "." & field.Name 176valueStringBuilder.Append(field.Name)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (1)
247Return parameter.Name
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (37)
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateParameterizedMemberService.vb (1)
101usedIdentifiers.Add(typeParameter.Name)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EnumMemberGenerator.vb (2)
36If enumMember.Name = WellKnownMemberNames.EnumBackingFieldName Then 46Dim member = SyntaxFactory.EnumMemberDeclaration(enumMember.Name.ToIdentifierToken()) _
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EventGenerator.vb (4)
115[event].Name, 148identifier:=[event].Name.ToIdentifierToken, 157identifier:=[event].Name.ToIdentifierToken, 194Return CodeGenerationSymbolFactory.CreateParameterSymbol(parameter.GetAttributes(), parameter.RefKind, isParams:=False, type:=parameter.Type, name:=parameter.Name, hasDefaultValue:=False)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\FieldGenerator.vb (1)
87SyntaxFactory.SingletonSeparatedList(field.Name.ToModifiedIdentifier),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\MethodGenerator.vb (1)
78SyntaxFactory.MethodStatement(kind, subOrFunctionKeyword:=SyntaxFactory.Token(keyword), identifier:=method.Name.ToIdentifierToken).
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (3)
124identifier:=namedType.Name.ToIdentifierToken(), 140identifier:=namedType.Name.ToIdentifierToken(), 156namedType.Name.ToIdentifierToken,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamespaceGenerator.vb (1)
113SyntaxFactory.SimpleImportsClause(SyntaxFactory.ImportAliasClause([alias].Name.ToIdentifierToken), name)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\OperatorGenerator.vb (1)
42Throw New ArgumentException(String.Format(WorkspaceExtensionsResources.Cannot_generate_code_for_unsupported_operator_0, method.Name), NameOf(method))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ParameterGenerator.vb (2)
56parameter.Name.ToModifiedIdentifier.WithArrayBounds(argumentList), 68parameter.Name.ToModifiedIdentifier(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\PropertyGenerator.vb (1)
69Dim begin = SyntaxFactory.PropertyStatement(identifier:=[property].Name.ToIdentifierToken).
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\TypeParameterGenerator.vb (1)
19identifier:=symbol.Name.ToIdentifierToken,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationHelpers.vb (1)
75DirectCast(type, NameSyntax), explicitInterfaceOpt.Name.ToIdentifierName())))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Editing\VisualBasicImportAdder.vb (5)
101_importedTypesAndNamespaces.Add((typeOrNamespace.Name, typeOrNamespace.GetArity()), ns) 108_importedExtensionMethods.Add(method.Name, ns) 118_importedTypesAndNamespaces.Add((moduleType.Name, moduleType.GetArity()), ns) 120_importedMembers.Add(member.Name, ns) 244For Each conflictingSymbol In _importedExtensionMethods.Item(method.Name)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxGeneratorVisitor.vb (1)
61Dim result = AddInformationTo(symbol.Name.ToIdentifierName, symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SymbolExtensions.vb (4)
12If symbol.Kind <> SymbolKind.Namespace OrElse symbol.Name <> "My" Then 24If symbol.Kind <> SymbolKind.Property OrElse symbol.Name <> "Forms" Then 30type.Name <> "MyForms" Then 38containingType.Name <> "MyProject" Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (6)
38Return AddInformationTo(symbol.Name.ToIdentifierName, symbol) 77If symbol.Name = String.Empty OrElse symbol.IsAnonymousType Then 86Return symbol.Name.ToIdentifierName 90symbol.Name.ToIdentifierToken, 180Dim result = AddInformationTo(symbol.Name.ToIdentifierName, symbol) 203Return AddInformationTo(symbol.Name.ToIdentifierName, symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (1)
23otherSideType.Name = String.Empty
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\SymbolExtensions.vb (1)
18propertySymbol.ContainingType.Name = "MyForms" AndAlso
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (5)
NavigationBar\VisualBasicEditorNavigationBarItemService_CodeGeneration.vb (5)
139typeName:=destinationType.Name, 178methodName = generateCodeItem.ContainerName + "_" + eventSymbol.Name 181methodName = destinationType.Name + "_" + eventSymbol.Name 184Dim handlesSyntax = SyntaxFactory.SimpleMemberAccessExpression(containerSyntax, SyntaxFactory.Token(SyntaxKind.DotToken), eventSymbol.Name.ToIdentifierName())
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (11)
Attributes\AssemblyAttributes.vb (8)
1313Select Case a.AttributeClass.Name 1327Assert.Equal("Unexpected Attr", a.AttributeClass.Name) 1430Select Case a.AttributeClass.Name 1438Assert.Equal("Unexpected Attr", a.AttributeClass.Name) 1503Select Case a.AttributeClass.Name 1517Assert.Equal("Unexpected Attr", a.AttributeClass.Name) 1602Select Case a.AttributeClass.Name 1616Assert.Equal("Unexpected Attr", a.AttributeClass.Name)
Attributes\AttributeTests_Synthesized.vb (1)
69Dim pid = DirectCast(comp.GlobalNamespace.GetMembers().Single(Function(s) s.Name.StartsWith("<PrivateImplementationDetails>", StringComparison.Ordinal)), NamedTypeSymbol)
PrivateProtected.vb (2)
135Select Case member.Name 140Assert.Equal("private protected member", member.Name)
Microsoft.CodeAnalysis.VisualBasic.Features (43)
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.CodeAction.vb (2)
31Return String.Format(VBFeaturesResources.Create_event_0_in_1, _generatedEvent.Name, _targetSymbol.Name)
Completion\CompletionProviders\CompletionUtilities.vb (1)
87name = symbol.Name
Completion\CompletionProviders\EnumCompletionProvider.vb (1)
119Dim text = _cachedDisplayAndInsertionTextContainingTypeText & "." & symbol.Name
Completion\CompletionProviders\ObjectInitializerCompletionProvider.vb (1)
117Return symbol.Name.EscapeIdentifier()
Completion\CompletionProviders\PartialTypeCompletionProvider.vb (1)
70New KeyValuePair(Of String, String)(InsertionTextOnOpenParen, symbol.Name.EscapeIdentifier()))
ConvertAutoPropertyToFullProperty\VisualBasicConvertAutoPropertyToFullProperty.vb (1)
32Return Task.FromResult(Underscore + propertySymbol.Name)
Diagnostics\Analyzers\TypeSyntaxSimplifierWalker.vb (1)
86_aliasedNames = _aliasedNames.Add(aliasSymbol.Target.Name)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (5)
124Where String.Equals(DirectCast(identifier.Identifier.Value, String), localOrParameter.Name, StringComparison.OrdinalIgnoreCase) AndAlso 783oldSymbol IsNot Nothing AndAlso newSymbol IsNot Nothing AndAlso oldSymbol.Name <> newSymbol.Name) Then 866If oldEventSymbol.Name <> newEventSymbol.Name Then
EncapsulateField\VisualBasicEncapsulateFieldService.vb (4)
109Dim propertyName = GeneratePropertyName(field.Name) 111Return (field.Name, propertyName) 113Dim propertyName = GeneratePropertyName(field.Name) 115propertyName = NameGenerator.GenerateUniqueName(propertyName, containingTypeMemberNames.Where(Function(m) m <> field.Name).ToSet(), StringComparer.OrdinalIgnoreCase)
ExtractInterface\VisualBasicExtractInterfaceService.vb (2)
109SyntaxFactory.Identifier(extractedInterfaceSymbol.Name), 111SyntaxFactory.ParseTypeName(extractedInterfaceSymbol.Name))
ExtractMethod\VisualBasicMethodExtractor.Analyzer.vb (1)
47Dim info = semanticModel.GetSpeculativeTypeInfo(Me.SelectionResult.FinalSpan.Start, SyntaxFactory.ParseName(symbol.Name), SpeculativeBindingOption.BindAsExpression)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.vb (1)
366If Not CaseInsensitiveComparison.Equals(method.Name, NameOf(Task.ConfigureAwait)) Then
IntroduceParameter\VisualBasicIntroduceParameterCodeRefactoringProvider.vb (1)
35Return methodSymbol.Name.Equals(WellKnownMemberNames.DestructorName)
NavigationBar\VisualBasicNavigationBarItemService.vb (9)
172type.Name, 173type.Name, 193member.Name, 194member.Name, 260type.Name, 362Dim eventContainerName = eventContainer?.Name 377eventContainer.Name, 383String.Format(VBFeaturesResources._0_Events, containingType.Name), 419method.Name,
ReplacePropertyWithMethods\VisualBasicReplacePropertyWithMethods.vb (5)
132fieldReference, generator.IdentifierName(setMethod.Parameters(0).Name))) 175If explicitInterfaceImplMethod.Name = "get_" + [property].Name OrElse 176explicitInterfaceImplMethod.Name = "set_" + [property].Name Then
SignatureHelp\AbstractVisualBasicSignatureHelpProvider.vb (1)
45parameter.Name,
SignatureHelp\FunctionAggregationSignatureHelpProvider.vb (1)
116result.AddMethodName(method.Name)
SignatureHelp\GenericNameSignatureHelpProvider.Method.vb (1)
20result.Add(New SymbolDisplayPart(SymbolDisplayPartKind.MethodName, method, method.Name))
SignatureHelp\GenericNameSignatureHelpProvider.vb (1)
155parameter.Name,
SignatureHelp\InvocationExpressionSignatureHelpProvider.DelegateInvoke.vb (2)
43displayParts.Add(New SymbolDisplayPart(SymbolDisplayPartKind.MethodName, invokeMethod, invokeMethod.Name)) 57parameter.Name,
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateParameterizedMemberService.vb (1)
101usedIdentifiers.Add(typeParameter.Name)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (101)
Compilation\CompilationAPITests.vb (14)
304Assert.Equal(asmname, comp.Assembly.Name) 305Assert.Equal(asmname + ".exe", comp.SourceModule.Name) 386Assert.Equal("D", comp.GetTypeByMetadataName("C+D").Name) 387Assert.Equal("E", comp.GetTypeByMetadataName("C+D+E").Name) 392Assert.Equal("C", comp.GetTypeByMetadataName("A.B.C").Name) 393Assert.Equal("D", comp.GetTypeByMetadataName("A.B.C+D").Name) 395Assert.Equal("E", comp.GetTypeByMetadataName("A.B.C+D+E").Name) 407Assert.Equal("E", comp.Assembly.GetTypeByMetadataName("A.B.C+D+E").Name) 817AssertEx.Equal(Of String)("Object", comp.ObjectType.Name) 2069Assert.Equal("?", c.Assembly.Name) 2076Assert.Equal("?", c.Assembly.Name) 2083Assert.Equal("ModuleAssemblyName", c.Assembly.Name) 2851Assert.Equal("corlibWithValueTupleRef", comp.GetTypeByMetadataName("System.ValueTuple`2").ContainingAssembly.Name) 2857Assert.Equal(expectedAssemblyName, comp.GetTypeByMetadataName("System.ValueTuple`2").ContainingAssembly.Name)
Compilation\GetImportScopesTests.vb (3)
44Return TryCast(symbol, INamespaceSymbol)?.Name = name 48Return symbol.Name = aliasName AndAlso symbol.Target.Name = targetName AndAlso TypeOf symbol.Target Is INamespaceSymbol AndAlso DirectCast(symbol.Target, INamespaceSymbol).ContainingNamespace.IsGlobalNamespace = inGlobalNamespace
Compilation\SemanticModelAPITests.vb (30)
617Assert.Equal("bInstance", symbol.Name) 776Assert.Equal("z", local.Name) 788Assert.Equal("z", argSymbolInfo.Symbol.Name) 795Assert.Equal("y", argSymbolInfo.Symbol.Name) 833Assert.Equal("z", local.Name) 848Assert.Equal("y", local.Name) 907Assert.Equal("x", local.Name) 947Assert.Equal("Label", label.Name) 1017Assert.Equal("y", local.Name) 1055Assert.Equal("NewMethod", symbolInfo.Symbol.Name) 1095Assert.Equal("NewMethod", symbolInfo.Symbol.Name) 1272Assert.Equal("O", aliasSymbol.Name) 1274Assert.Equal("ObsoleteAttribute", aliasSymbol.Target.Name) 1320Assert.Equal("O", aliasSymbol.Name) 1322Assert.Equal("ObsoleteAttribute", aliasSymbol.Target.Name) 1356Assert.Equal("O", aliasSymbol.Name) 1358Assert.Equal("ObsoleteAttribute", aliasSymbol.Target.Name) 1400Assert.Equal("Goo", symbolInfo.Symbol.Name) 1448Assert.Equal("z", local.Name) 1460Assert.Equal("z", argSymbolInfo.Symbol.Name) 1597Assert.Equal("z", local.Name) 1613Assert.Equal("y", local.Name) 1629Assert.Equal("y", local.Name) 1673Assert.Equal("Label", label.Name) 4659Assert.Equal("Value", symbol.Name) 4702Assert.Equal("Value", symbol.Name) 4745Assert.Equal("Value", symbol.Name) 4794Assert.Equal("Value", symbol.Name) 4837Assert.Equal("Value", symbol.Name) 4880Assert.Equal("Value", symbol.Name)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (28)
1254Assert.Equal("x", paramSymbol1.Name) 1262Assert.Equal("yopt", paramSymbol2.Name) 1270Assert.Equal("a", paramSymbol3.Name) 1278Assert.Equal("a", paramSymbol4.Name) 1286Assert.Equal("d", paramSymbol5.Name) 1320Assert.Equal("Percent", paramSymbol1.Name) 1367Assert.Equal("ndx", paramSymbol1.Name) 1372Assert.Equal("p1", paramSymbol2.Name) 1377Assert.Equal("p2", paramSymbol3.Name) 1382Assert.Equal("px", paramSymbol4.Name) 1387Assert.Equal("py", paramSymbol5.Name) 1391Assert.Equal("pz", paramSymbol6.Name) 1395Assert.Equal("pw", paramSymbol7.Name) 1846Assert.Equal("TTT", tpSymbol1.Name) 1855Assert.Equal("UUU", tpSymbol2.Name) 1864Assert.Equal("TTT", tpSymbol3.Name) 1873Assert.Equal("UUU", tpSymbol4.Name) 1882Assert.Equal("VVV", tpSymbol5.Name) 1931Assert.Equal("Label1", label1.Name) 1935Assert.Equal("Label2", label2.Name) 2018Assert.Equal("aa", varSymbol1.Name) 2028Assert.Equal("aa", varSymbol2.Name) 2038Assert.Equal("b", varSymbol3.Name) 2048Assert.Equal("b", varSymbol4.Name) 2058Assert.Equal("aa", varSymbol5.Name) 2068Assert.Equal("yyy", varSymbol6.Name) 2078Assert.Equal("ccc", varSymbol7.Name) 2089Assert.Equal("ccc", varSymbol8.Name)
Compilation\SuppressAccessibilityChecksTests.vb (4)
90Assert.Equal("A", creationExpression.Type.Name) 123Assert.Equal("_p", symbolInfo.Symbol.Name) 269Assert.Equal("_p", symbolSpeculation.Symbol.Name) 270Assert.Equal("Int32", typeSpeculation.Type.Name)
Diagnostics\DiagnosticAnalyzerTests.vb (1)
961If nodeContext.ContainingSymbol.Name.StartsWith("Funky") AndAlso nodeContext.Compilation.Language = "Visual Basic" Then
Diagnostics\GetDiagnosticsTests.vb (1)
674reportDiagnostic(CodeAnalysis.Diagnostic.Create(Descriptor, location, containingSymbol.Name))
FlowAnalysis\FlowTestBase.vb (14)
106Return If(Not symbols.IsEmpty(), String.Join(", ", symbols.Select(Function(symbol) symbol.Name)), Nothing) 228AssertEx.Equal(If(alwaysAssigned, {}), analysis.AlwaysAssigned.Select(Function(s) s.Name).ToArray()) 229AssertEx.Equal(If(captured, {}), analysis.Captured.Select(Function(s) s.Name).ToArray()) 230AssertEx.Equal(If(dataFlowsIn, {}), analysis.DataFlowsIn.Select(Function(s) s.Name).ToArray()) 231AssertEx.Equal(If(dataFlowsOut, {}), analysis.DataFlowsOut.Select(Function(s) s.Name).ToArray()) 232AssertEx.Equal(If(definitelyAssignedOnEntry, {}), analysis.DefinitelyAssignedOnEntry.Select(Function(s) s.Name).ToArray()) 233AssertEx.Equal(If(definitelyAssignedOnExit, {}), analysis.DefinitelyAssignedOnExit.Select(Function(s) s.Name).ToArray()) 234AssertEx.Equal(If(readInside, {}), analysis.ReadInside.Select(Function(s) s.Name).ToArray()) 235AssertEx.Equal(If(readOutside, {}), analysis.ReadOutside.Select(Function(s) s.Name).ToArray()) 236AssertEx.Equal(If(variablesDeclared, {}), analysis.VariablesDeclared.Select(Function(s) s.Name).ToArray()) 237AssertEx.Equal(If(writtenInside, {}), analysis.WrittenInside.Select(Function(s) s.Name).ToArray()) 238AssertEx.Equal(If(writtenOutside, {}), analysis.WrittenOutside.Select(Function(s) s.Name).ToArray()) 239AssertEx.Equal(If(capturedInside, {}), analysis.CapturedInside.Select(Function(s) s.Name).ToArray()) 240AssertEx.Equal(If(capturedOutside, {}), analysis.CapturedOutside.Select(Function(s) s.Name).ToArray())
FlowAnalysis\IterationJumpYieldStatementTests.vb (2)
1348Assert.Equal(True, flow.VariablesDeclared.Any(Function(s) s.Name = "b")) 1349Assert.Equal(True, flow.VariablesDeclared.Any(Function(s) s.Name = "s"))
Semantics\MultiDimensionalTest.vb (1)
326Assert.Equal(expectedSymbolName, symbol.Name)
Semantics\QueryExpressions_FlowAnalysis.vb (3)
365Dim ss = dataFlowAnalysisResults.WrittenOutside.Where(Function(s) s.Name.Equals("s1", StringComparison.OrdinalIgnoreCase)) 366Assert.Equal(ss(0).Name, ss(1).Name)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (1)
SymbolsTests\Source\OverridesTests.vb (1)
6727If namedType.Name.StartsWith("Derived", StringComparison.OrdinalIgnoreCase) Then
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (2)
CompilationTestUtils.vb (2)
1066Dim name1 = loc1.MetadataModule.ContainingAssembly.Name 1067Dim name2 = loc2.MetadataModule.ContainingAssembly.Name
Microsoft.CodeAnalysis.VisualBasic.Workspaces (74)
CaseCorrection\VisualBasicCaseCorrectionService.Rewriter.vb (9)
81Dim name = preprocessingSymbolInfo.Symbol.Name 191If namesMustBeEqualIgnoringCase AndAlso Not String.Equals(symbol.Name, token.ValueText, StringComparison.OrdinalIgnoreCase) Then 217If String.Equals(token.ValueText & s_attributeSuffix, symbol.Name, StringComparison.OrdinalIgnoreCase) Then 218Return symbol.Name.Substring(0, symbol.Name.Length - s_attributeSuffix.Length) 222Return symbol.Name 235If String.IsNullOrEmpty(symbol.Name) Then 239If symbol.Name = token.ValueText Then 244If symbol.Name = token.ValueText & s_attributeSuffix Then
CodeGeneration\VisualBasicSyntaxGenerator.vb (2)
2570SyntaxFactory.Identifier(symbol.Name), 2645SyntaxFactory.IdentifierName(method.Name))
Rename\VisualBasicRenameRewriterLanguageService.vb (17)
328fieldSymbol.Name = "_" + fieldSymbol.AssociatedSymbol.Name Then 528If oldIdentifier <> Me._renamedSymbol.Name Then 741CaseInsensitiveComparison.Equals(renamedSymbol.ContainingSymbol.Name, renamedSymbol.Name) Then 775renamedSymbol.Name, 792If renamedSymbol.ContainingType IsNot Nothing AndAlso renamedSymbol.ContainingType.GetMembers(renamedSymbol.Name).Contains(renamedSymbol) Then 794.Where(Function(t) CaseInsensitiveComparison.Equals(t.Name, renamedSymbol.Name)) _ 813CaseInsensitiveComparison.Equals(renameSymbol.Name, "Current") 816(CaseInsensitiveComparison.Equals(renameSymbol.Name, "MoveNext") OrElse 817CaseInsensitiveComparison.Equals(renameSymbol.Name, "GetEnumerator"))) 822If Not CaseInsensitiveComparison.Equals(renamedSymbol.Name, renameSymbol.Name) Then 915If CaseInsensitiveComparison.Equals(renamedSymbol.Name, "MoveNext") OrElse 916CaseInsensitiveComparison.Equals(renamedSymbol.Name, "GetEnumerator") OrElse 917CaseInsensitiveComparison.Equals(renamedSymbol.Name, "Current") Then 941renamedSymbol.Name) _
Simplification\Simplifiers\AbstractVisualBasicSimplifier.vb (1)
151Dim aliasName = aliasReplacement.Name
Simplification\Simplifiers\ExpressionSimplifier.vb (1)
113aliasReplacement.Name,
Simplification\Simplifiers\NameSimplifier.vb (2)
78aliasReplacement.Name, 365String.Compare(aliasSymbol.Name, identifierToken.ValueText, StringComparison.OrdinalIgnoreCase) = 0 Then
Simplification\VisualBasicSimplificationService.Expander.vb (4)
428Dim moduleIdentifierToken = SyntaxFactory.Identifier(symbolForQualifiedName.ContainingType.Name) 458Dim moduleIdentifierToken = SyntaxFactory.Identifier(symbolForMemberAccess.ContainingType.Name) 530Dim aliasAnnotationInfo = AliasAnnotation.Create(aliasInfo.Name) 551Dim aliasAnnotationInfo = AliasAnnotation.Create(aliasInfo.Name)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (1)
247Return parameter.Name
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EnumMemberGenerator.vb (2)
36If enumMember.Name = WellKnownMemberNames.EnumBackingFieldName Then 46Dim member = SyntaxFactory.EnumMemberDeclaration(enumMember.Name.ToIdentifierToken()) _
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EventGenerator.vb (4)
115[event].Name, 148identifier:=[event].Name.ToIdentifierToken, 157identifier:=[event].Name.ToIdentifierToken, 194Return CodeGenerationSymbolFactory.CreateParameterSymbol(parameter.GetAttributes(), parameter.RefKind, isParams:=False, type:=parameter.Type, name:=parameter.Name, hasDefaultValue:=False)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\FieldGenerator.vb (1)
87SyntaxFactory.SingletonSeparatedList(field.Name.ToModifiedIdentifier),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\MethodGenerator.vb (1)
78SyntaxFactory.MethodStatement(kind, subOrFunctionKeyword:=SyntaxFactory.Token(keyword), identifier:=method.Name.ToIdentifierToken).
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (3)
124identifier:=namedType.Name.ToIdentifierToken(), 140identifier:=namedType.Name.ToIdentifierToken(), 156namedType.Name.ToIdentifierToken,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamespaceGenerator.vb (1)
113SyntaxFactory.SimpleImportsClause(SyntaxFactory.ImportAliasClause([alias].Name.ToIdentifierToken), name)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\OperatorGenerator.vb (1)
42Throw New ArgumentException(String.Format(WorkspaceExtensionsResources.Cannot_generate_code_for_unsupported_operator_0, method.Name), NameOf(method))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ParameterGenerator.vb (2)
56parameter.Name.ToModifiedIdentifier.WithArrayBounds(argumentList), 68parameter.Name.ToModifiedIdentifier(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\PropertyGenerator.vb (1)
69Dim begin = SyntaxFactory.PropertyStatement(identifier:=[property].Name.ToIdentifierToken).
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\TypeParameterGenerator.vb (1)
19identifier:=symbol.Name.ToIdentifierToken,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationHelpers.vb (1)
75DirectCast(type, NameSyntax), explicitInterfaceOpt.Name.ToIdentifierName())))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Editing\VisualBasicImportAdder.vb (5)
101_importedTypesAndNamespaces.Add((typeOrNamespace.Name, typeOrNamespace.GetArity()), ns) 108_importedExtensionMethods.Add(method.Name, ns) 118_importedTypesAndNamespaces.Add((moduleType.Name, moduleType.GetArity()), ns) 120_importedMembers.Add(member.Name, ns) 244For Each conflictingSymbol In _importedExtensionMethods.Item(method.Name)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxGeneratorVisitor.vb (1)
61Dim result = AddInformationTo(symbol.Name.ToIdentifierName, symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SymbolExtensions.vb (4)
12If symbol.Kind <> SymbolKind.Namespace OrElse symbol.Name <> "My" Then 24If symbol.Kind <> SymbolKind.Property OrElse symbol.Name <> "Forms" Then 30type.Name <> "MyForms" Then 38containingType.Name <> "MyProject" Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (6)
38Return AddInformationTo(symbol.Name.ToIdentifierName, symbol) 77If symbol.Name = String.Empty OrElse symbol.IsAnonymousType Then 86Return symbol.Name.ToIdentifierName 90symbol.Name.ToIdentifierToken, 180Dim result = AddInformationTo(symbol.Name.ToIdentifierName, symbol) 203Return AddInformationTo(symbol.Name.ToIdentifierName, symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (1)
23otherSideType.Name = String.Empty
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\SymbolExtensions.vb (1)
18propertySymbol.ContainingType.Name = "MyForms" AndAlso
Utilities\IntrinsicOperators\PredefinedCastExpressionDocumentation.vb (1)
62Return _resultingType.ContainingNamespace.Name + "." + _resultingType.MetadataName
Microsoft.CodeAnalysis.Workspaces (344)
Editing\SymbolEditor.cs (3)
137if (!_assemblyNameToProjectIdMap.TryGetValue(assembly.Name, out var projectIds)) 277throw new ArgumentException(string.Format(WorkspacesResources.The_symbol_0_cannot_be_located_within_the_current_solution, argSymbol.Name)); 415throw new ArgumentException(string.Format(WorkspacesResources.The_member_0_is_not_declared_within_the_declaration_of_the_symbol, member.Name));
Editing\SyntaxGenerator.cs (17)
145field.Name, 187=> MethodDeclaration(method, method.Name, statements); 215decl = WithDefaultConstraint(decl, typeParameter.Name); 221decl = WithTypeConstraint(decl, typeParameter.Name, SpecialTypeConstraintKind.ReferenceType); 284method.Name, 285isImplicitConversion: method.Name is WellKnownMemberNames.ImplicitConversionName, 324symbol.Name, 391property.Name, 493symbol.Name, 531symbol.Name, 560constructorMethod.ContainingType != null ? constructorMethod.ContainingType.Name : "New", 762type.Name, 771type.Name, 778type.Name, 784type.Name, 792type.Name, 870declaration = this.WithTypeConstraint(declaration, tp.Name,
FindSymbols\FindReferences\BaseTypeFinder.cs (1)
41foreach (var member in type.GetMembers(symbol.Name))
FindSymbols\FindReferences\DependentProjectsFinder.cs (6)
250return attrType?.Name == nameof(InternalsVisibleToAttribute) && 251attrType.ContainingNamespace?.Name == nameof(System.Runtime.CompilerServices) && 252attrType.ContainingNamespace.ContainingNamespace?.Name == nameof(System.Runtime) && 253attrType.ContainingNamespace.ContainingNamespace.ContainingNamespace?.Name == nameof(System) && 321project, symbolOrigination.assembly.Name, cancellationToken).ConfigureAwait(false); 372var name = compilation.GetAssemblyOrModuleSymbol(peReference) is IAssemblySymbol { Name: string metadataAssemblyName }
FindSymbols\FindReferences\DependentTypeFinder.cs (2)
235await AddSourceTypesThatDeriveFromNameAsync(tempBuffer, type.Name).ConfigureAwait(false); 355var baseTypeName = metadataType.Name;
FindSymbols\FindReferences\Finders\AbstractMemberScopedReferenceFinder.cs (2)
67var tokens = FindMatchingIdentifierTokens(state, symbol.Name, cancellationToken); 119if (TokensMatch(state, token, symbol.Name))
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (10)
233!syntaxFacts.StringComparer.Equals(aliasSymbol.Name, aliasSymbol.Target.Name)) 294symbol, localAliasSymbol.Name, state, processResult, processResultData, cancellationToken); 298if (TryGetNameWithoutAttributeSuffix(localAliasSymbol.Name, state.SyntaxFacts, out var simpleName)) 316aliasSymbol, aliasSymbol.Name, state, processResult, processResultData, cancellationToken); 320if (TryGetNameWithoutAttributeSuffix(aliasSymbol.Name, state.SyntaxFacts, out var simpleName)) 774additionalProperties.Add((key, symbol.Name)); 785additionalProperties.Add((ContainingTypeInfoPropertyName, containingType.Name)); 791additionalProperties.Add((ContainingMemberInfoPropertyName, containingSymbol.Name)); 867symbol, symbol.Name, state, processResult, processResultData, cancellationToken);
FindSymbols\FindReferences\Finders\AbstractTypeParameterSymbolReferenceFinder.cs (1)
31var tokens = FindMatchingIdentifierTokens(state, symbol.Name, cancellationToken);
FindSymbols\FindReferences\Finders\ConstructorInitializerSymbolReferenceFinder.cs (3)
51}, symbol.ContainingType.Name, processResult, processResultData, cancellationToken); 86return containingType != null && containingType.BaseType != null && containingType.BaseType.Name == typeName; 91return containingType != null && containingType.Name == typeName;
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (4)
30return GetAllMatchingGlobalAliasNamesAsync(project, containingType.Name, containingType.Arity, cancellationToken); 44var typeName = symbol.ContainingType.Name; 102var containingTypeName = containingType.Name; 275foreach (var token in state.Cache.FindMatchingIdentifierTokens(symbol.ContainingType.Name, cancellationToken))
FindSymbols\FindReferences\Finders\EventSymbolReferenceFinder.cs (1)
48await FindDocumentsAsync(project, documents, processResult, processResultData, cancellationToken, symbol.Name).ConfigureAwait(false);
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.cs (2)
20=> symbol is { MethodKind: MethodKind.Conversion, Name: WellKnownMemberNames.ExplicitConversionName or WellKnownMemberNames.ImplicitConversionName } && 50await FindDocumentsAsync(project, documents, StandardCallbacks<Document>.AddToHashSet, result, cancellationToken, underlyingNamedType.Name).ConfigureAwait(false);
FindSymbols\FindReferences\Finders\FieldSymbolReferenceFinder.cs (1)
39await FindDocumentsAsync(project, documents, processResult, processResultData, cancellationToken, symbol.Name).ConfigureAwait(false);
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (3)
61return FindDocumentsAsync(project, documents, processResult, processResultData, cancellationToken, symbol.Name, 62GetMemberNameWithoutInterfaceName(symbol.DeclaringMethod.Name), 63symbol.DeclaringMethod.ContainingType.Name);
FindSymbols\FindReferences\Finders\NamedTypeSymbolReferenceFinder.cs (5)
24return GetAllMatchingGlobalAliasNamesAsync(project, symbol.Name, symbol.Arity, cancellationToken); 62await AddDocumentsToSearchAsync(symbol.Name, project, documents, processResult, processResultData, cancellationToken).ConfigureAwait(false); 148namedType, namedType.Name, state, processResult, processResultData, cancellationToken); 153foreach (var localAlias in state.Cache.SyntaxTreeIndex.GetAliases(namedType.Name, namedType.Arity)) 163if (state.SyntaxFacts.StringComparer.Equals(namedType.Name, alias))
FindSymbols\FindReferences\Finders\NamespaceSymbolReferenceFinder.cs (4)
23return GetAllMatchingGlobalAliasNamesAsync(project, symbol.Name, arity: 0, cancellationToken); 37await FindDocumentsAsync(project, documents, processResult, processResultData, cancellationToken, symbol.Name).ConfigureAwait(false); 70var namespaceName = symbol.Name; 77foreach (var localAlias in state.Cache.SyntaxTreeIndex.GetAliases(symbol.Name, arity: 0))
FindSymbols\FindReferences\Finders\OrdinaryMethodReferenceFinder.cs (6)
72await FindDocumentsAsync(project, documents, processResult, processResultData, cancellationToken, methodSymbol.Name).ConfigureAwait(false); 103=> methodSymbol.Name is WellKnownMemberNames.GetEnumeratorMethodName or 107=> methodSymbol.Name == WellKnownMemberNames.DeconstructMethodName; 110=> methodSymbol.Name == WellKnownMemberNames.GetAwaiter; 113=> methodSymbol.Name == WellKnownMemberNames.CollectionInitializerAddMethodName; 116=> methodSymbol.Name == nameof(IDisposable.Dispose);
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (6)
39return FindDocumentsAsync(project, documents, processResult, processResultData, cancellationToken, symbol.Name); 50FindReferencesInDocumentUsingIdentifier(symbol, symbol.Name, state, processResult, processResultData, cancellationToken); 140if (IdentifiersMatch(syntaxFacts, parameter.Name, token)) 162if (!syntaxFacts.TextMatch(methodSymbol1.Parameters[i].Name, methodSymbol2.Parameters[i].Name)) 222containingMethod.Name == WellKnownMemberNames.DelegateBeginInvokeName)
FindSymbols\FindReferences\Finders\PreprocessingSymbolReferenceFinder.cs (2)
33index => index.ContainsDirective && index.ProbablyContainsIdentifier(symbol.Name), 47var tokens = FindMatchingIdentifierTokens(state, symbol.Name, cancellationToken);
FindSymbols\FindReferences\Finders\PropertyAccessorSymbolReferenceFinder.cs (1)
45await FindDocumentsAsync(project, documents, processResult, processResultData, cancellationToken, symbol.Name).ConfigureAwait(false);
FindSymbols\FindReferences\Finders\PropertySymbolReferenceFinder.cs (4)
95if (property.Name.Equals(parameter.Name) && 117await FindDocumentsAsync(project, documents, processResult, processResultData, cancellationToken, symbol.Name).ConfigureAwait(false); 132=> symbol.Name == WellKnownMemberNames.CurrentPropertyName;
FindSymbols\FindReferences\Finders\TypeParameterSymbolReferenceFinder.cs (2)
35return FindDocumentsAsync(project, documents, processResult, processResultData, cancellationToken, symbol.Name, symbol.ContainingType.Name);
FindSymbols\FindReferences\FindReferencesSearchEngine.cs (1)
298cache.FindMatchingIdentifierTokens(symbol.Name, cancellationToken);
FindSymbols\FindReferences\FindReferencesSearchEngine_FindReferencesInDocuments.cs (1)
180var tokens = AbstractReferenceFinder.FindMatchingIdentifierTokens(state, symbol.Name, cancellationToken);
FindSymbols\ReferencedSymbol.cs (1)
52return string.Format("{0}, {1} {2}", this.Definition.Name, count, count == 1 ? "ref" : "refs");
FindSymbols\SymbolFinder.cs (3)
184/// In order to be returned the other symbols must have the same <see cref="ISymbol.Name"/> and <see 242if (linkedSymbol.Name == symbol.Name)
FindSymbols\SymbolFinder_Helpers.cs (2)
179var candidateAssemblyName = candidate.ContainingAssembly.Name; 182if (assembly.Name == candidateAssemblyName)
FindSymbols\SymbolFinder_Hierarchy.cs (4)
64foreach (var m in type.GetMembers(symbol.Name)) 159? ((IMethodSymbol)symbol).AssociatedSymbol?.Name 160: symbol.Name; 167foreach (var interfaceMember in interfaceType.GetMembers(symbol.Name))
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (3)
132var globalNamespaceName = assembly.GlobalNamespace.Name; 207symbolMap.Add(childNamespaceOrType.Name, childNamespaceOrType); 214symbolMap.Add(childType.Name, childType);
ReassignedVariable\AbstractReassignedVariableService.cs (2)
254else if (parameter.ContainingSymbol.Name == WellKnownMemberNames.TopLevelStatementsEntryPointMethodName) 322if (!syntaxFacts.StringComparer.Equals(idToken.ValueText, localOrParameter.Name))
Recommendations\AbstractRecommendationServiceRunner.cs (1)
242parameterType = method.Parameters.FirstOrDefault(p => _stringComparerForLanguage.Equals(p.Name, argumentName))?.Type;
Rename\ConflictEngine\ConflictResolver.cs (4)
105return new ConflictResolution(string.Format(WorkspacesResources.Symbol_0_is_not_from_source, renameLocations.Symbol.Name)); 242var otherThingsNamedTheSame = renamedSymbol.ContainingType.GetMembers(renamedSymbol.Name) 267var otherThingsNamedTheSame = ((INamespaceSymbol)renamedSymbol.ContainingSymbol).GetMembers(renamedSymbol.Name) 277var otherThingsNamedTheSame = ((INamespaceOrTypeSymbol)renamedSymbol.ContainingSymbol).GetMembers(renamedSymbol.Name)
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
59_originalText = renameLocationSet.Symbol.Name;
Rename\ConflictEngine\DeclarationConflictHelpers.cs (2)
18renamedMethod.ContainingType.GetMembers(renamedMethod.Name) 29renamedProperty.ContainingType.GetMembers(renamedProperty.Name)
Rename\IRenameRewriterLanguageService.cs (1)
144param => string.Compare(param.Name, newPropertyName, StringComparison.OrdinalIgnoreCase) == 0);
Rename\Renamer.RenameSymbolDocumentAction.cs (2)
109if (symbol is null || WorkspacePathUtilities.TypeNameMatchesDocumentName(documentWithNewName, symbol.Name)) 118symbol.Name);
Rename\RenameUtilities.cs (1)
34if (originalAliasName == aliasSymbol.Name)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (6)
67string.Compare(TrimNameToAfterLastDot(referencedSymbol.Name), TrimNameToAfterLastDot(originalSymbol.Name), StringComparison.OrdinalIgnoreCase) == 0 && 219token.ValueText == referencedSymbol.Name) 285if (location.Alias.Name == referencedSymbol.Name) 330var renameText = originalSymbol.Name;
Shared\Extensions\IFindReferencesResultExtensions.cs (2)
134!comparer.Equals(reference.Definition.Name, symbol.Name))
Shared\Extensions\IMethodSymbolExtensions.cs (2)
72!method1.Parameters.Select(p => p.Name).SequenceEqual(method2.Parameters.Select(p => p.Name)))
Shared\Extensions\INamespaceSymbolExtensions.cs (1)
37result.Add(namespaceSymbol.Name);
Shared\Extensions\ISymbolExtensions.cs (1)
431var index = symbol.OriginalDefinition.GetAllTypeParameters().IndexOf(p => p.Name == typeParamName.Value);
Shared\Extensions\ISymbolExtensions_2.cs (1)
22return symbol.Name is "value" or "Value";
Shared\Extensions\ITypeSymbolExtensions.cs (2)
97constructedInterface.GetMembers(interfaceMember.Name).FirstOrDefault( 167from member in baseType.GetMembers(constructedInterfaceMember.Name).OfType<TSymbol>()
Shared\Extensions\SemanticModelExtensions.cs (1)
61var mapped = containingType.GetMembers(methodSymbol.Name)
Shared\Extensions\SyntaxGeneratorExtensions.cs (10)
82var getName = overriddenProperty.GetMethod?.Name; 83var setName = overriddenProperty.SetMethod?.Name; 110codeFactory.IdentifierName(overriddenProperty.Name)), codeFactory.CreateArguments(overriddenProperty.Parameters)))); 117codeFactory.IdentifierName(overriddenProperty.Name)), codeFactory.CreateArguments(overriddenProperty.Parameters)), 129codeFactory.IdentifierName(overriddenProperty.Name)))); 135codeFactory.IdentifierName(overriddenProperty.Name)), 166name: overriddenProperty.Name, 189name: overriddenEvent.Name); 258? codeFactory.IdentifierName(overriddenMethod.Name) 259: codeFactory.GenericName(overriddenMethod.Name, typeParams)),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IMethodSymbolExtensions.cs (2)
73=> symbol.Name switch 103=> methodSymbol.Name is WellKnownMemberNames.EntryPointMethodName or WellKnownMemberNames.TopLevelStatementsEntryPointMethodName &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (9)
71return type.GetBaseTypesAndThis().SelectMany(t => t.GetMembers(symbol.Name)) 466if (namedParameter != null && seenNames.Add(namedParameter.Name)) 600comparer.Equals(member.Name, kvp.Key.Name) && 660Name: nameof(Equals), 673Name: "CollectionBuilderAttribute", 676Name: nameof(System.Runtime.CompilerServices), 679Name: nameof(System.Runtime), 682Name: nameof(System),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamespaceOrTypeSymbolExtensions.cs (1)
82result.Add(namespaceOrTypeSymbol.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IParameterSymbolExtensions.cs (1)
42foreach (var member in containingType.GetMembers(parameter.Name))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (16)
109foreach (var member in baseType.GetMembers(symbol.Name)) 671=> symbol.Name == WellKnownMemberNames.GetAwaiter && 683if (!returnType.GetMembers().OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.IsCompleted && p.Type.SpecialType == SpecialType.System_Boolean && p.GetMethod != null)) 697if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }])) 701return methods.Any(m => m.Name == WellKnownMemberNames.GetResult && !m.Parameters.Any()); 705=> symbol.Name == WellKnownMemberNames.GetEnumeratorMethodName && 722if (!members.OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.CurrentPropertyName && p.GetMethod != null)) 732Name: WellKnownMemberNames.MoveNextMethodName, 745=> symbol.Name == WellKnownMemberNames.GetAsyncEnumeratorMethodName && 762if (!members.OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.CurrentPropertyName && p.GetMethod != null)) 771if (!members.OfType<IMethodSymbol>().Any(x => x.Name == WellKnownMemberNames.MoveNextAsyncMethodName)) 797=> symbol.Name.StartsWith("_") && 798(symbol.Name.Length == 1 || uint.TryParse(symbol.Name[1..], out _) || symbol.Name.All(n => n.Equals('_'))); 809ContainingNamespace.Name: nameof(System),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (8)
236b.ContainingNamespace.Name == "System" && 251&& symbol.ContainingNamespace?.Name == "System" 713if (attributeData.AttributeClass?.Name == nameof(ReferenceAssemblyAttribute) 749Name: nameof(Span<int>), 751ContainingNamespace: { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true } 757Name: nameof(ReadOnlySpan<int>), 759ContainingNamespace: { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true } 772return type?.RemoveUnavailableTypeParameters(compilation, availableTypeParameters.Select(t => t.Name).ToSet());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
83symbol = updatedContainingType.GetTypeMembers(symbol.Name, symbol.Arity).First(m => m.TypeKind == symbol.TypeKind);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
64if (availableTypeParameterNames.Contains(symbol.Name))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
41if (symbol.IsErrorType() && symbol.Name == string.Empty)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (1)
23var baseName = RemovePrefixesAndSuffixes(symbol, rules, symbol.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (1)
94var implementedInterfaceMembersWithSameName = implementedInterface.GetMembers(symbol.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (2)
20visitor.WriteString(symbol.Name); 71if (aliasSymbol.Name == name &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousTypeSymbolKey.cs (1)
24var propertyNames = properties.SelectAsArray(p => p.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (4)
56var localName = symbol.Name; 244if (!SymbolKey.Equals(reader.Compilation, name, symbol.Name)) 246reason = $"location {index} did not match name: {symbol.Name} != {name}"; 267SymbolKey.Equals(semanticModel.Compilation, symbol.Name, localName))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BuiltinOperatorSymbolKey.cs (1)
19visitor.WriteString(symbol.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
70/// the "same" <see cref="ISymbol.Name"/>.</item> 77/// cref="SyntaxTree"/> is enumerated to list all the symbols with the same <see cref="ISymbol.Name"/> and <see
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ErrorTypeSymbolKey.cs (3)
19visitor.WriteString(symbol.Name); 56while (namespaceSymbol != null && namespaceSymbol.Name != "") 58builder.Add(namespaceSymbol.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (2)
20visitor.WriteString(symbol.Name); 118if (errorType.Name != name || errorType.Arity != arity)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.PreprocessingSymbolKey.cs (1)
14=> visitor.WriteString(symbol.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
31friendlyNames.Add(element.IsImplicitlyDeclared ? null : element.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
457symbol.Name == newSymbol.Name && 462return symbol.Name == newSymbol.Name; 465return symbol.Name == newSymbol.Name; 472return symbol.Name == newSymbol.Name && 480return symbol.Name == newSymbol.Name && 1124var parameter1 = signature1Parameters.FirstOrDefault(p => p.Name == name); 1127var parameter2 = signature2Parameters.FirstOrDefault(p => p.Name == name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
47AttributeClass.Name: "InterceptsLocationAttribute",
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (6)
49=> IdentifiersMatch(event1.Name, event2.Name, caseSensitive); 53if (!IdentifiersMatch(property1.Name, property2.Name, caseSensitive) || 85if (!IdentifiersMatch(method1.Name, method2.Name, caseSensitive))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.AssemblyComparers.cs (3)
16=> AssemblyIdentityComparer.SimpleNameComparer.Equals(x?.Name, y?.Name); 19=> obj is null ? 0 : AssemblyIdentityComparer.SimpleNameComparer.GetHashCode(obj.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (27)
154x.Name == y.Name && 162x.Name == y.Name && 209x.Name != y.Name) 278=> AssembliesAreEquivalent(x.ContainingAssembly, y.ContainingAssembly) && x.Name == y.Name; 359x.Name != y.Name || 376if (xNamespace.Name != yNamespace.Name) 381if (xNamespace.Name == "") 399!AssemblyIdentityComparer.SimpleNameComparer.Equals(x.ContainingAssembly.Name, y.ContainingAssembly.Name) && 435if (xElement.Name != yElement.Name) 535if (p1.Name != p2.Name || 550x.Name != y.Name) 568x.Name == y.Name && 611x.Name == y.Name && 659=> x.Name == y.Name;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (11)
92Hash.Combine(x.Name, 99Hash.Combine(x.Name, 124Hash.Combine(x.Name, currentHash))))))); 141=> CombineHashCodes(x.ContainingAssembly, Hash.Combine(x.Name, currentHash)); 174Hash.Combine(x.Name, 202return Hash.Combine(p.Name, 214return Hash.Combine(x.Name, currentHash); 219Hash.Combine(x.Name, 227Hash.Combine(x.Name, 243Hash.Combine(x.Name, 255Hash.Combine(x.Name,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.ParameterSymbolEqualityComparer.cs (4)
39x.Name == y.Name 40: string.Equals(x.Name, y.Name, StringComparison.OrdinalIgnoreCase);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (6)
47if (!ctor.Parameters.Any() && type.Name == "FlagsAttribute") 51containingSymbol.Name == "System" && 143if (IsValidName(enumType, field.Name)) 147generator.IdentifierName(field.Name)); 220: -x.field.Name.CompareTo(y.field.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (10)
52if (info.Context.GenerateMembers && info.Context.MergeNestedNamespaces && @namespace.Name != string.Empty) 56@namespace.Name 66names.Add(childNamespace.Name); 78name = @namespace.Name; 168: f1.Name.CompareTo(f2.Name); 401Name: "NullableAttribute" or "NullableContextAttribute" or "NativeIntegerAttribute" or "DynamicAttribute", 404Name: nameof(System.Runtime.CompilerServices), 407Name: nameof(System.Runtime), 410Name: nameof(System),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (6)
307name.HasValue ? name.Value : parameter.Name, 375accessor.Name, 536name ?? method.Name, 565name ?? property.Name, 589name ?? @event.Name, 606name ?? field.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\INamedTypeSymbolExtensions.cs (1)
26namedType.Name,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructorInfo.cs (1)
84=> info == null ? constructor.ContainingType.Name : info._typeName;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationDestructorInfo.cs (1)
52=> info == null ? constructor.ContainingType.Name : info._typeName;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
92return this.GetMembers().Select(m => m.Name).ToList();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceOrTypeSymbol.cs (2)
34=> GetMembers().WhereAsArray(s => s.Name == name); 40=> GetTypeMembers().WhereAsArray(s => s.Name == name);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (11)
26method.Parameters.SelectAsArray(p => p.Name), isCaseSensitive: syntaxFacts.IsCaseSensitive); 30.Select(tp => tp.Name) 31.Concat(method.Name) 32.Concat(containingType.Name); 38method.TypeParameters.SelectAsArray(tp => tp.Name), 47if (method.TypeParameters.Select(t => t.Name).SequenceEqual(newNames)) 70method.Name, 73CodeGenerationSymbolFactory.CreateParameterSymbol(p.GetAttributes(), p.RefKind, p.IsParams, p.Type.SubstituteTypes(mapping, typeGenerator), p.Name, p.IsOptional, 81if (parameterList.Select(p => p.Name).SequenceEqual(parameterNames)) 96method.Name, 170p.RefKind, p.IsParams, p.Type, p.Name, p.IsOptional,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IParameterSymbolExtensions.cs (2)
24return parameter.Name == parameterName 46parameter.Name,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IPropertySymbolExtensions.cs (4)
18if (parameterList.Select(p => p.Name).SequenceEqual(parameterNames)) 33property.Name, 59property.Name, 63p.RefKind, p.IsParams, p.Type, p.Name, p.IsOptional,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\KnownTypes.cs (1)
35return returnType.Name is "Task" or "ValueTask";
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (20)
70return factory.Argument(parameter.RefKind, factory.IdentifierName(parameter.Name)); 108? generator.GenericName(method.Name, method.TypeArguments) 109: generator.IdentifierName(method.Name)); 120var name = generator.IdentifierName(throughMember.Name); 172generator.IdentifierName(explicitlyImplementedProperty.Name)); 186? factory.GenericName(classOrStructType.Name, classOrStructType.TypeArguments) 187: factory.IdentifierName(classOrStructType.Name); 205throughExpression, generator.IdentifierName(property.Name)); 224return [generator.ReturnStatement(generator.MemberAccessExpression(generator.ThisExpression(), property.Name))]; 244throughExpression, generator.IdentifierName(property.Name)); 265return [generator.ExpressionStatement(generator.AssignmentStatement(generator.MemberAccessExpression(generator.ThisExpression(), property.Name), generator.IdentifierName(parameter.Name)))]; 284value = symbol.Name; 299TryGetValue(parameterToNewFieldMap, parameter.Name, out var fieldName)) 321TryGetValue(parameterToNewPropertyMap, parameter.Name, out var propertyName)) 360var parameterName = parameter.Name; 430factory.IdentifierName(parameter.Name)))); 440factory.IdentifierName(parameter.Name), 453factory.IdentifierName(parameter.Name))).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation); 462var condition = factory.CreateNullCheckExpression(generatorInternal, semanticModel, parameter.Name);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
231var symbolNameExpression = factory.IdentifierName(member.Name); 370var name = containingType.Name;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (3)
101initHash = initHash * hashFactor + Hash.GetFNVHashCode(baseHashCode.Name); 106initHash = initHash * hashFactor + Hash.GetFNVHashCode(symbol.Name); 226factory.IdentifierName(member.Name)).WithAdditionalAnnotations(Simplification.Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
446if (property.Name is nameof(Array.Length) or nameof(Array.LongLength))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (2)
153generator.IdentifierName(fieldOrProperty.Name)), 154generator.IdentifierName(parameter.Name)));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (1)
222if (syntaxFacts.StringComparer.Equals(name, localSymbol.Name))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (2)
83return GenerateUniqueName(baseName, filteredCandidates.Select(s => s.Name).Concat(usedNames)); 165return (disposableType, disposableType?.GetMembers().OfType<IMethodSymbol>().FirstOrDefault(m => m.Parameters.Length == 0 && m.Name == methodName));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
124symbol.Name == nameof(Enum.HasFlag) &&
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (2)
90$"We should always be able to map a body symbol back to a document:\r\n{symbol.Kind}\r\n{symbol.Name}\r\n{syntaxTree.FilePath}\r\n{projectId}"); 101$"Syntax tree for a body symbol should map to the same project as the body symbol's assembly:\r\n{symbol.Kind}\r\n{symbol.Name}\r\n{syntaxTree.FilePath}\r\n{projectId}\r\n{documentId.ProjectId}");
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (4)
VisualStudioMSBuildWorkspaceTests.cs (4)
1907Assert.Contains(attrs, ad => ad.AttributeClass.Name == "MyAttribute"); 1930Assert.DoesNotContain(attrs, ad => ad.AttributeClass.Name == "MyAttribute"); 1954Assert.Contains(attrs, ad => ad.AttributeClass.Name == "MyAttr"); 1977Assert.DoesNotContain(attrs, ad => ad.AttributeClass.Name == "MyAttr");
Microsoft.CodeAnalysis.Workspaces.UnitTests (53)
FindReferencesTests.cs (2)
496var refsFromVirtualSorted = refsFromVirtual.Select(r => r.Definition).OrderBy(r => r.ContainingType.Name).ToArray(); 497var refsFromOverrideSorted = refsFromOverride.Select(r => r.Definition).OrderBy(r => r.ContainingType.Name).ToArray();
SymbolKeyTests.cs (22)
422Assert.Equal("x", resolved?.Name); 446Assert.Equal("b", resolved?.Name); 760var outer = GetDeclaredSymbols(compilation).OfType<INamedTypeSymbol>().First(s => s.Name == "A"); 783var a = GetDeclaredSymbols(compilation).OfType<INamedTypeSymbol>().Single(s => s.Name == "A"); 785var a_b_m = a_b.GetMembers().Single(s => s.Name == "M"); 793var a_string_b_m = a_string_b.GetMembers().Single(s => s.Name == "M"); 799var a_string_b_int_m = a_string_b_int.GetMembers().Single(s => s.Name == "M"); 807var a_b_int_m = a_b_int.GetMembers().Single(s => s.Name == "M"); 1034Assert.Equal(symbol.Name, found.Name); 1071Assert.Equal(symbol.Name, found.Name); 1107Assert.Equal(propType.Name, found.Name); 1142Assert.Equal(propType.Name, found.Name); 1179Assert.Equal("Collections", propType.ContainingNamespace.Name); 1180Assert.Equal("System", propType.ContainingNamespace.ContainingNamespace.Name); 1191Assert.Equal(propType.Name, found.Name); 1193Assert.Equal(propType.ContainingNamespace.Name, found.ContainingNamespace.Name); 1226Assert.Equal("Collections", propType.ContainingNamespace.Name); 1227Assert.Equal("System", propType.ContainingNamespace.ContainingNamespace.Name); 1238Assert.Equal(propType.Name, found.Name); 1240Assert.Equal(propType.ContainingNamespace.Name, found.ContainingNamespace.Name); 1290Assert.Equal(symbol.Name, found.Name); 1302Assert.Equal(symbol.Name, found.Name);
UtilityTest\DocumentationCommentIdTests.cs (29)
127CheckDeclarationId<IFieldSymbol>("F:Acme.ValueType.total", compilation, s => s.Name == "total"); 128CheckDeclarationId<IFieldSymbol>("F:Acme.Widget.NestedClass.value", compilation, s => s.Name == "value"); 129CheckDeclarationId<IFieldSymbol>("F:Acme.Widget.message", compilation, s => s.Name == "message"); 130CheckDeclarationId<IFieldSymbol>("F:Acme.Widget.defaultColor", compilation, s => s.Name == "defaultColor"); 131CheckDeclarationId<IFieldSymbol>("F:Acme.Widget.PI", compilation, s => s.Name == "PI"); 132CheckDeclarationId<IFieldSymbol>("F:Acme.Widget.monthlyAverage", compilation, s => s.Name == "monthlyAverage"); 133CheckDeclarationId<IFieldSymbol>("F:Acme.Widget.array1", compilation, s => s.Name == "array1"); 134CheckDeclarationId<IFieldSymbol>("F:Acme.Widget.array2", compilation, s => s.Name == "array2"); 135CheckDeclarationId<IFieldSymbol>("F:Acme.Widget.pCount", compilation, s => s.Name == "pCount"); 136CheckDeclarationId<IFieldSymbol>("F:Acme.Widget.ppValues", compilation, s => s.Name == "ppValues"); 216CheckDeclarationId<IMethodSymbol>("M:Acme.ValueType.M(System.Int32)", compilation, s => s.Name == "M" && s.Parameters is [{ Type.Name: "Int32" }]); 217CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.NestedClass.M(System.Int32)", compilation, s => s.Name == "M" && s.Parameters is [{ Type.Name: "Int32" }]); 218CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.M0", compilation, s => s.Name == "M0" && s.Parameters.Length == 0); 219CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.M1(System.Char,System.Single@,Acme.ValueType@)", compilation, s => s.Name == "M1"); 220CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.M2(System.Int16[],System.Int32[0:,0:],System.Int64[][])", compilation, s => s.Name == "M2"); 221CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.M3(System.Int64[][],Acme.Widget[0:,0:,0:][])", compilation, s => s.Name == "M3"); 222CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.M4(System.Char*,Color**)", compilation, s => s.Name == "M4"); 223CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.M5(System.Void*,System.Double*[0:,0:][])", compilation, s => s.Name == "M5"); 224CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.M6(System.Int32,System.Object[])", compilation, s => s.Name == "M6"); 225CheckDeclarationId<IMethodSymbol>("M:Acme.MyList`1.Test(`0)", compilation, s => s.Name == "Test"); 226CheckDeclarationId<IMethodSymbol>("M:Acme.UseList.Process(Acme.MyList{System.Int32})", compilation, s => s.Name == "Process"); 227CheckDeclarationId<IMethodSymbol>("M:Acme.UseList.GetValues``1(``0)", compilation, s => s.Name == "GetValues"); 228CheckDeclarationId<IMethodSymbol>("M:Acme.UseList.Process2``1(Acme.MyList{``0})", compilation, s => s.Name == "Process2"); 247CheckDeclarationIdExact<IPropertySymbol>("P:Acme.Widget.Width", compilation, p => p.Name == "Width"); 265CheckDeclarationId<IEventSymbol>("E:Acme.Widget.AnEvent", compilation, e => e.Name == "AnEvent"); 314CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.op_Explicit(Acme.Widget)~System.Int32", compilation, m => m.MethodKind == MethodKind.Conversion && m.Parameters.Length == 1 && m.ReturnType.Name == "Int32"); 315CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.op_Implicit(Acme.Widget)~System.Int64", compilation, m => m.MethodKind == MethodKind.Conversion && m.Parameters.Length == 1 && m.ReturnType.Name == "Int64");
Microsoft.DotNet.CodeAnalysis (8)
Analyzers\AppContextDefaultsAnalyzer.cs (4)
133if (!StringComparer.Ordinal.Equals(methodSym.ContainingType.Name, "LocalAppContext") && 134!StringComparer.Ordinal.Equals(methodSym.ContainingType.Name, "AppContext")) 137if (!StringComparer.Ordinal.Equals(methodSym.ContainingNamespace.Name, "System")) 140if (!StringComparer.Ordinal.Equals(methodSym.Name, "DefineSwitchDefault"))
Analyzers\PinvokeAnalyzer.cs (3)
155isPresent = CheckIfMemberPresent(methodSymbol.Name, data.ModuleName, ref altMsg) 156|| CheckIfMemberPresent(methodSymbol.Name + 'W', data.ModuleName, ref altMsg); 163context.ReportDiagnostic(Diagnostic.Create(InvalidPinvokeCall, synref.GetSyntax().GetLocation(), data.ModuleName + "!" + (data.EntryPointName ?? methodSymbol.Name), altMsg));
Analyzers\ResourceUsageAnalyzer.cs (1)
46if (memberSymbol.Name.Equals("Format") &&
Microsoft.Extensions.Logging.Generators (7)
LoggerMessageGenerator.Parser.cs (7)
236eventId = GetNonRandomizedHashCode(string.IsNullOrWhiteSpace(eventName) ? logMethodSymbol.Name : eventName); 241Name = logMethodSymbol.Name, 338string paramName = paramSymbol.Name; 663loggerField = fs.Name; 672shadowedNames.Add(fs.Name); 696if (shadowedNames.Contains(parameter.Name)) 708loggerField = parameter.Name;
Microsoft.Extensions.Options.SourceGeneration (43)
Emitter.cs (5)
627if (attributeData.Key == _symbolHolder.MaxLengthAttributeSymbol.Name) 632else if (attributeData.Key == _symbolHolder.MinLengthAttributeSymbol.Name) 637else if (_symbolHolder.LengthAttributeSymbol is not null && attributeData.Key == _symbolHolder.LengthAttributeSymbol.Name) 642else if (attributeData.Key == _symbolHolder.CompareAttributeSymbol.Name && attributeData.Value is not null) 647else if (attributeData.Key == _symbolHolder.RangeAttributeSymbol.Name)
OptionsSourceGenContext.cs (1)
20Suffix = IsLangVersion11AndAbove ? "" : $"_{GetNonRandomizedHashCode(compilation.SourceModule.Name):X8}";
Parser.cs (37)
74Diag(DiagDescriptors.DoesntImplementIValidateOptions, syntax.GetLocation(), validatorType.Name); 96Diag(DiagDescriptors.AlreadyImplementsValidateMethod, syntax.GetLocation(), validatorType.Name); 116modelType.Name, 220genericType = ta.Name; 228genericType = type.Name; 277var addedMembers = new HashSet<string>(members.Select(m => m.Name)); 286var baseMembers = baseType.GetMembers().Where(m => !addedMembers.Contains(m.Name)); 288addedMembers.UnionWith(baseMembers.Select(m => m.Name)); 305Diag(DiagDescriptors.MemberIsInaccessible, member.Locations.First(), member.Name); 379Diag(DiagDescriptors.ValidatorsNeedSimpleConstructor, attrLoc, transValidatorType.Name); 384Diag(DiagDescriptors.DoesntImplementIValidateOptions, attrLoc, transValidatorType.Name, memberType.Name); 442Diag(DiagDescriptors.ValidatorsNeedSimpleConstructor, attrLoc, enumerationValidatorType.Name); 447Diag(DiagDescriptors.DoesntImplementIValidateOptions, attrLoc, enumerationValidatorType.Name, enumeratedType.Name); 475Diag(DiagDescriptors.InaccessibleValidationAttribute, location, attributeType.Name, member.OriginalDefinition.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat), validatorType.Name); 524bool isParams = lastParameterDeclaredWithParamsKeyword && namedArgument.Key == parameters[parameters.Length - 1].Name; 542Diag(DiagDescriptors.CantValidateStaticOrConstMember, location, member.Name); 557Diag(DiagDescriptors.PotentiallyMissingTransitiveValidation, location, memberType.Name, member.Name); 573Diag(DiagDescriptors.PotentiallyMissingEnumerableValidation, location, enumeratedType.Name, member.Name); 582member.Name, 602_optionsSourceGenContext.EnsureTrackingAttribute(attributeType.Name, createValue: false, out _); 606_optionsSourceGenContext.EnsureTrackingAttribute(attributeType.Name, createValue: true, out HashSet<object>? trackedTypeList); 611Diag(DiagDescriptors.IncompatibleWithTypeForValidationAttribute, location, attributeType.Name, memberType.Name); 615attributeFullQualifiedName = $"{Emitter.StaticGeneratedValidationAttributesClassesNamespace}.{Emitter.StaticAttributeClassNamePrefix}{_optionsSourceGenContext.Suffix}_{attributeType.Name}"; 622if (constructorParameters.Length == 1 && constructorParameters[0].Name == "otherProperty" && constructorParameters[0].Type.SpecialType == SpecialType.System_String) 624_optionsSourceGenContext.EnsureTrackingAttribute(attribute.AttributeClass!.Name, createValue: true, out HashSet<object>? trackedTypeList); 626attributeFullQualifiedName = $"{Emitter.StaticGeneratedValidationAttributesClassesNamespace}.{Emitter.StaticAttributeClassNamePrefix}{_optionsSourceGenContext.Suffix}_{attribute.AttributeClass!.Name}"; 654if (constructorParameters[i].Name == "type") 679_optionsSourceGenContext.EnsureTrackingAttribute(attribute.AttributeClass!.Name, createValue: hasTimeSpanType, out _); 680attributeFullQualifiedName = $"{Emitter.StaticGeneratedValidationAttributesClassesNamespace}.{Emitter.StaticAttributeClassNamePrefix}{_optionsSourceGenContext.Suffix}_{attribute.AttributeClass!.Name}"; 709mt.Name, 713var validatorTypeName = "__" + mt.Name + "Validator__";
Microsoft.Gen.ComplianceReports (6)
Parser.cs (6)
127ci.Name = ps.Name; 162_ = classifiedMembers.TryGetValue(member.Name, out ci); 188ci.Name = member.Name; 213MethodName = method.Name, 224Name = p.Name, 257string name = attribute.AttributeClass!.Name;
Microsoft.Gen.ContextualOptions (2)
Model\OptionsContextType.cs (1)
19public string Name => Symbol.Name;
Parser.cs (1)
87.Select(prop => prop.Name)
Microsoft.Gen.ContextualOptions.Unit.Tests (5)
EmitterTests.cs (4)
32Mock.Of<INamedTypeSymbol>(sym => sym.Name == "Struct1" && sym.ContainingNamespace.ToString() == "Microsoft.GenContextualOptions.TestClasses"), 56Mock.Of<INamedTypeSymbol>(sym => sym.Name == "Class2" && sym.ContainingNamespace.ToString() == "Microsoft.GenContextualOptions.TestClasses"), 84Mock.Of<INamedTypeSymbol>(sym => sym.Name == "Record1" && sym.ContainingNamespace.ToString() == "Microsoft.GenContextualOptions.TestClasses"), 112Mock.Of<INamedTypeSymbol>(sym => sym.Name == "NamespacelessRecord" && sym.ContainingNamespace.IsGlobalNamespace),
SyntaxContextReceiverTests.cs (1)
36Assert.Equal(declaration.Key.Name, declaration.Value.Single().Identifier.Text);
Microsoft.Gen.Logging (33)
Parsing\Parser.cs (13)
154Diag(DiagDescriptors.DefaultToString, paramSymbol.GetLocation(), paramSymbol.Type, paramSymbol.Name); 258Diag(DiagDescriptors.EmptyLoggingMethod, method.Identifier.GetLocation(), methodSymbol.Name); 326lt.AllMembers.AddRange(methodSymbol.ContainingType.GetMembers().Select(x => x.Name)); 374Name = methodSymbol.Name, 425Diag(DiagDescriptors.ShouldntReuseEventIds, attrLoc, lm.EventId.Value, methodSymbol.ContainingType.Name); 434Diag(DiagDescriptors.ShouldntReuseEventNames, attrLoc, lm.EventName, methodSymbol.ContainingType.Name); 448Diag(DiagDescriptors.RedundantQualifierInMessage, attrLoc, methodSymbol.Name); 518var paramName = paramSymbol.Name; 551Diag(DiagDescriptors.LoggingMethodParameterRefKind, paramSymbol.GetLocation(), paramSymbol.ContainingSymbol.Name, paramName); 676loggerMember = ms.Name; 694_ = shadowedNames.Add(ms.Name); 718if (shadowedNames.Contains(parameter.Name)) 730loggerMember = parameter.Name;
Parsing\Parser.LogProperties.cs (11)
30var paramName = paramSymbol.Name; 67Diag(DiagDescriptors.LogPropertiesParameterSkipped, paramSymbol.GetLocation(), paramTypeSymbol.Name, paramName); 80_ => property.Name 117sensitivePropsFromCtor[parameter.Name] = maybeDataClasses; 156if (!seenProps.Add(property.Name)) 173if (sensitivePropsFromCtor.TryGetValue(property.Name, out var dataClassesFromCtor)) 193: property.Name; 197PropertyName = property.Name, 244Diag(DiagDescriptors.LogPropertiesHiddenPropertyDetected, paramSymbol.GetLocation(), paramName, lm.Name, property.Name); 268var propName = property.Name; 321Diag(DiagDescriptors.DefaultToString, property.GetLocation(), property.Type, property.Name);
Parsing\Parser.Records.cs (4)
66IPropertySymbol property => new(property.Name, property.Type, property), 67IFieldSymbol field => new(field.Name, field.Type, Property: null), 107overriddenMembers.Contains(property.Name)) 115_ = overriddenMembers.Add(property.Name);
Parsing\Parser.TagProvider.cs (5)
19var paramName = paramSymbol.Name; 39lp.TagProvider = new(providerMethod.Name, providerType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)); 52var propName = propSymbol.Name; 67lp.TagProvider = new(providerMethod.Name, providerType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)); 120$"static void {providerMethodName}(ITagCollector, {complexObjType.Name})");
Microsoft.Gen.Logging.Unit.Tests (6)
TypeSymbolExtensionsTests.cs (6)
54var parameterSymbol = Assert.Single(methodSymbol.Parameters, p => p.Name == "property"); 98var parameterSymbol = Assert.Single(methodSymbol.Parameters, p => p.Name == "property"); 142var parameterSymbol = Assert.Single(methodSymbol.Parameters, p => p.Name == "property"); 190var parameterSymbol = Assert.Single(methodSymbol.Parameters, p => p.Name == "property"); 233var parameterSymbol = Assert.Single(methodSymbol.Parameters, p => p.Name == "property"); 277var parameterSymbol = Assert.Single(methodSymbol.Parameters, p => p.Name == "property");
Microsoft.Gen.Metrics (20)
Parser.cs (20)
441string metricNameFromMethod = methodSymbol.ReturnType.Name; 445Name = methodSymbol.Name, 523var paramName = paramSymbol.Name; 577Diag(DiagDescriptors.ErrorInvalidMethodReturnType, methodSymbol.ReturnType.GetLocation(), methodSymbol.Name); 583Diag(DiagDescriptors.ErrorInvalidMethodReturnTypeArity, methodSymbol.GetLocation(), methodSymbol.Name, returnType.Name); 587if (!string.Equals(returnType.Name, returnType.ToString(), StringComparison.Ordinal)) 589Diag(DiagDescriptors.ErrorInvalidMethodReturnTypeLocation, methodSymbol.GetLocation(), methodSymbol.Name, returnType.Name); 730: member.Name; 734Diag(DiagDescriptors.ErrorDuplicateTagName, member.Locations[0], member.Name); 740Name = member.Name, 749tagDescriptionDictionary.Add(string.IsNullOrEmpty(tagName) ? member.Name : tagName, xmlDefinition); 762: member.Name; 766Diag(DiagDescriptors.ErrorDuplicateTagName, member.Locations[0], member.Name); 772Name = member.Name, 781tagDescriptionDictionary.Add(string.IsNullOrEmpty(tagName) ? member.Name : tagName, xmlDefinition); 795Name = member.Name, 825Name = member.Name, 869_ = stringBuilder.Append(parentSymbol.Name);
Microsoft.Gen.MetricsReports (20)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (20)
441string metricNameFromMethod = methodSymbol.ReturnType.Name; 445Name = methodSymbol.Name, 523var paramName = paramSymbol.Name; 577Diag(DiagDescriptors.ErrorInvalidMethodReturnType, methodSymbol.ReturnType.GetLocation(), methodSymbol.Name); 583Diag(DiagDescriptors.ErrorInvalidMethodReturnTypeArity, methodSymbol.GetLocation(), methodSymbol.Name, returnType.Name); 587if (!string.Equals(returnType.Name, returnType.ToString(), StringComparison.Ordinal)) 589Diag(DiagDescriptors.ErrorInvalidMethodReturnTypeLocation, methodSymbol.GetLocation(), methodSymbol.Name, returnType.Name); 730: member.Name; 734Diag(DiagDescriptors.ErrorDuplicateTagName, member.Locations[0], member.Name); 740Name = member.Name, 749tagDescriptionDictionary.Add(string.IsNullOrEmpty(tagName) ? member.Name : tagName, xmlDefinition); 762: member.Name; 766Diag(DiagDescriptors.ErrorDuplicateTagName, member.Locations[0], member.Name); 772Name = member.Name, 781tagDescriptionDictionary.Add(string.IsNullOrEmpty(tagName) ? member.Name : tagName, xmlDefinition); 795Name = member.Name, 825Name = member.Name, 869_ = stringBuilder.Append(parentSymbol.Name);
Microsoft.Interop.ComInterfaceGenerator (23)
Analyzers\AddGeneratedComClassAnalyzer.cs (2)
51context.ReportDiagnostic(type.CreateDiagnostic(AddGeneratedComClassAttribute, type.Name)); 59context.ReportDiagnostic(type.CreateDiagnostic(AddGeneratedComClassAttribute, type.Name));
Analyzers\ComHostingDoesNotSupportGeneratedComInterfaceAnalyzer.cs (2)
55context.ReportDiagnostic(context.ContainingSymbol.CreateDiagnostic(ComHostingDoesNotSupportGeneratedComInterface, context.ContainingSymbol.Name)); 63context.ReportDiagnostic(context.ContainingSymbol.CreateDiagnostic(ComHostingDoesNotSupportGeneratedComInterface, context.ContainingSymbol.Name));
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
141context.ReportDiagnostic(type.CreateDiagnostic(ConvertToGeneratedComInterface, properties.ToImmutable(), type.Name));
ComInterfaceInfo.cs (2)
67symbol.Name)); 184symbol.Name,
ComMethodInfo.cs (5)
53methods.Add(DiagnosticOr<(ComMethodInfo, IMethodSymbol)>.From(member.CreateDiagnosticInfo(GeneratorDiagnostics.InstancePropertyDeclaredInInterface, member.Name, data.ifaceSymbol.ToDisplayString()))); 56methods.Add(DiagnosticOr<(ComMethodInfo, IMethodSymbol)>.From(member.CreateDiagnosticInfo(GeneratorDiagnostics.InstanceEventDeclaredInInterface, member.Name, data.ifaceSymbol.ToDisplayString()))); 74return DiagnosticInfo.Create(GeneratorDiagnostics.InvalidAttributedMethodSignature, comMethodDeclaringSyntax.Identifier.GetLocation(), method.Name); 97new ComMethodInfo(null!, method.Name, method.GetAttributes().Select(AttributeInfo.From).ToImmutableArray().ToSequenceEqual(), false), 152var comMethodInfo = new ComMethodInfo(comMethodDeclaringSyntax, method.Name, attributeInfos.MoveToImmutable().ToSequenceEqual(), shadowsBaseMethod);
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
286string typeName = type.Name;
VirtualMethodPointerStubGenerator.cs (2)
306if (callConvSymbol.Name.StartsWith("CallConv", StringComparison.Ordinal)) 308callingConventions.Add(FunctionPointerUnmanagedCallingConvention(Identifier(callConvSymbol.Name.Substring("CallConv".Length))));
VtableIndexStubGenerator.cs (8)
254virtualMethodIndexAttr, symbol.Name, SR.InvalidStringMarshallingConfigurationMissingCustomType); 261virtualMethodIndexAttr, symbol.Name, SR.InvalidStringMarshallingConfigurationNotCustom); 332virtualMethodIndexAttr, symbol.Name, SR.InvalidExceptionMarshallingConfigurationMissingCustomType); 340virtualMethodIndexAttr, symbol.Name, SR.InvalidExceptionMarshallingConfigurationNotCustom); 361virtualMethodIndexAttr, symbol.Name, SR.InvalidExceptionMarshallingValue); 400return Diagnostic.Create(GeneratorDiagnostics.InvalidAttributedMethodSignature, methodSyntax.Identifier.GetLocation(), method.Name); 408return Diagnostic.Create(GeneratorDiagnostics.InvalidAttributedMethodContainingTypeMissingModifiers, methodSyntax.Identifier.GetLocation(), method.Name, typeDecl.Identifier); 421return Diagnostic.Create(GeneratorDiagnostics.InvalidAttributedMethodContainingTypeMissingUnmanagedObjectUnwrapperAttribute, methodSyntax.Identifier.GetLocation(), method.Name);
Microsoft.Interop.JavaScript.JSImportGenerator (7)
JSExportGenerator.cs (2)
344return Diagnostic.Create(GeneratorDiagnostics.InvalidExportAttributedMethodSignature, methodSyntax.Identifier.GetLocation(), method.Name); 352return Diagnostic.Create(GeneratorDiagnostics.InvalidExportAttributedMethodContainingTypeMissingModifiers, methodSyntax.Identifier.GetLocation(), method.Name, typeDecl.Identifier);
JSImportGenerator.cs (2)
223return Diagnostic.Create(GeneratorDiagnostics.InvalidImportAttributedMethodSignature, methodSyntax.Identifier.GetLocation(), method.Name); 231return Diagnostic.Create(GeneratorDiagnostics.InvalidImportAttributedMethodContainingTypeMissingModifiers, methodSyntax.Identifier.GetLocation(), method.Name, typeDecl.Identifier);
JSSignatureContext.cs (3)
64var fullName = $"{method.ContainingType.ToDisplayString()}.{method.Name}"; 74BindingName = "__signature_" + method.Name + "_" + typesHash, 87return $"[{env.Compilation.AssemblyName}]{typeName}:{method.Name}";
Microsoft.Interop.LibraryImportGenerator (7)
Analyzers\ConvertToLibraryImportAnalyzer.cs (1)
89context.ReportDiagnostic(method.CreateDiagnosticInfo(ConvertToLibraryImport, properties.ToImmutable(), method.Name).ToDiagnostic());
Analyzers\ConvertToLibraryImportFixer.cs (1)
423string methodName = methodSymbol.Name;
LibraryImportGenerator.cs (4)
283generatedDllImportAttr, symbol.Name, SR.InvalidStringMarshallingConfigurationMissingCustomType); 290generatedDllImportAttr, symbol.Name, SR.InvalidStringMarshallingConfigurationNotCustom); 550return DiagnosticInfo.Create(GeneratorDiagnostics.InvalidAttributedMethodSignature, methodSyntax.Identifier.GetLocation(), method.Name); 556return DiagnosticInfo.Create(GeneratorDiagnostics.InvalidAttributedMethodContainingTypeMissingModifiers, methodSyntax.Identifier.GetLocation(), method.Name, nonPartialIdentifier);
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
286string typeName = type.Name;
Microsoft.Interop.LibraryImportGenerator.Downlevel (2)
DownlevelLibraryImportGenerator.cs (2)
420return DiagnosticInfo.Create(GeneratorDiagnostics.InvalidAttributedMethodSignature, methodSyntax.Identifier.GetLocation(), method.Name); 426return DiagnosticInfo.Create(GeneratorDiagnostics.InvalidAttributedMethodContainingTypeMissingModifiers, methodSyntax.Identifier.GetLocation(), method.Name, nonPartialIdentifier);
Microsoft.Interop.SourceGeneration (8)
MarshalAsParser.cs (2)
179_diagnostics.ReportConfigurationNotSupported(attributeData, $"{attributeData.AttributeClass!.Name}{Type.Delimiter}{namedArg.Key}"); 184_diagnostics.ReportConfigurationNotSupported(attributeData, $"{attributeData.AttributeClass!.Name}{Type.Delimiter}{namedArg.Key}");
MethodSignatureElementInfoProvider.cs (2)
27public string FindNameForParamIndex(int paramIndex) => paramIndex >= _method.Parameters.Length ? string.Empty : _method.Parameters[paramIndex].Name; 45if (param.Name == elementName)
TypePositionInfo.cs (3)
94InstanceIdentifier = ParseToken(paramSymbol.Name).IsReservedKeyword() ? $"@{paramSymbol.Name}" : paramSymbol.Name,
TypeSymbolExtensions.cs (1)
250currentType = currentType.GetTypeMembers(originalNestedType.Name, originalNestedType.Arity).First();
Microsoft.Maui.Controls.BindingSourceGen (8)
InvocationParser.cs (7)
36 if ((symbol?.ContainingType?.Name != "Binding" && symbol?.ContainingType?.Name != "BindingBase") 51 if (type != null && type.Name == "Func") 71 || methodSymbol.Name != "SetBinding" 75 || methodSymbol.ContainingType?.Name != "BindableObjectExtensions" 101 { Name: "Func", ContainingNamespace.Name: "System" } => Result<InterceptedMethodType>.Failure(DiagnosticsFactory.GetterIsNotLambda(secondArgument.GetLocation())),
ISymbolExtensions.cs (1)
53 return symbol.GetAttributes().FirstOrDefault(attr => attr.AttributeClass?.Name == attributeName);
Microsoft.Maui.Controls.SourceGen (1)
CodeBehindGenerator.cs (1)
224 xmlnsDef.AssemblyName = symbol.Name;
Microsoft.ML.CodeAnalyzer.Tests (1)
Code\RelaxTestNamingTest.cs (1)
122if (method.Name.EndsWith("Async"))
Microsoft.ML.InternalCodeAnalyzer (12)
BestFriendAnalyzer.cs (1)
110var diagnostic = Diagnostic.Create(Rule, node.GetLocation(), symbol.Name);
BestFriendOnPublicDeclarationsAnalyzer.cs (1)
66var diagnostic = Diagnostic.Create(Rule, attribute.ApplicationSyntaxReference.GetSyntax().GetLocation(), context.Symbol.Name);
ContractsCheckAnalyzer.cs (3)
120if (parameters[p].Name == nameColonText) 225switch (parameter.Name) 232NameofDiagnostic.Rule, arg.GetLocation(), name, parameter.Name, arg.Expression));
ContractsCheckNameofFixProvider.cs (4)
143AttributeData attr = s.GetAttributes().FirstOrDefault(a => a.AttributeClass.Name == "ArgumentAttribute"); 146if (s.Name == nameArgValue) 149c => StringReplaceAsync(context.Document, argName + "." + s.Name, nameArg, c), Id), diagnostic); 159c => StringReplaceAsync(context.Document, argName + "." + s.Name, nameArg, c), Id), diagnostic);
InstanceInitializerAnalyzer.cs (3)
49if (symbol.GetAttributes().Any(i => i.AttributeClass.Name == "ArgumentAttribute")) 59var diagnostic = Diagnostic.Create(Rule, symbol.Locations[0], symbol.Name, "field"); 75var diagnostic = Diagnostic.Create(Rule, symbol.Locations[0], symbol.Name, "property");
Microsoft.VisualStudio.LanguageServices (47)
CallHierarchy\Finders\AbstractCallFinder.cs (1)
41this.SymbolName = symbol.Name;
ChangeSignature\ChangeSignatureDialogViewModel.ParameterViewModels.cs (1)
220public override string ParameterName => ParameterSymbol.Name;
ExtractClass\VisualStudioExtractClassOptionsService.cs (1)
68var candidateName = selectedType.Name + "Base";
Library\ObjectBrowser\AbstractListItemFactory.cs (1)
656builder.Add(new ReferenceListItem(parentListItem.ProjectId, assemblySymbol.Name, reference));
MoveStaticMembers\VisualStudioMoveStaticMembersOptionsService.cs (2)
111var candidateName = selectedType.Name + "Helpers"; 174.Where(l => l.IsInSource && (currentType.Name != t.Name || GetFile(l) != currentDocument.FilePath))
Progression\GraphBuilder.cs (9)
369commonLabel.Append(typeSymbol.Name); 371commonLabel.Append(string.Join(", ", typeSymbol.TypeParameters.Select(t => t.Name))); 379node.Label = symbol.Name; 388node.Label = CodeQualifiedIdentifierBuilder.SpecialNames.GetConstructorLabel(methodSymbol.ContainingSymbol.Name); 392node.Label = CodeQualifiedIdentifierBuilder.SpecialNames.GetStaticConstructorLabel(methodSymbol.ContainingSymbol.Name); 396node.Label = CodeQualifiedIdentifierBuilder.SpecialNames.GetFinalizerLabel(methodSymbol.ContainingSymbol.Name); 400node.Label = methodSymbol.Name; 412node.Label = symbol.Name.Replace("[]", string.Empty); 423node.Label = symbol.Name;
Progression\GraphNodeIdCreation.cs (8)
158return GraphNodeId.GetPartial(nodeName, namedType.Name); 173GraphNodeId.GetPartial(CodeQualifiedName.Name, namedType.Name) 224GraphNodeId.GetPartial(CodeQualifiedName.Name, pointerType.PointedAtType.Name), 248partials.Add(GraphNodeId.GetPartial(CodeQualifiedName.Name, underlyingType.Name)); 481return memberId + GraphNodeId.GetPartial(CodeGraphNodeIdName.Parameter, symbol.Name); 500builder.LocalVariable = symbol.Name; 544if (current is { Kind: SymbolKind.Local or SymbolKind.RangeVariable } && current.Name == symbol.Name)
Progression\SymbolContainment.cs (2)
42!string.IsNullOrEmpty(symbol.Name) && 84if (!string.IsNullOrEmpty(member.Name))
ProjectSystem\AbstractEntryPointFinder.cs (1)
35MatchesMainMethodName(symbol.Name) &&
Snippets\SnippetExpansionClient.cs (13)
656template.Append('$').Append(parameter.Name).Append('$'); 659new XElement(snippetNamespace + "ID", new XText(parameter.Name)), 660new XElement(snippetNamespace + "Default", new XText(parameterValues.GetValueOrDefault(parameter.Name, ""))))); 799if (_state._methodNameForInsertFullMethodCall != method.Name) 841var firstField = _state._method?.Parameters.FirstOrDefault()?.Name ?? PlaceholderSnippetField; 851var lastField = _state._method?.Parameters.LastOrDefault()?.Name ?? PlaceholderSnippetField; 878newArguments = newArguments.SetItem(method.Parameters[0].Name, placeholderValue); 891if (ExpansionSession.GetFieldValue(previousParameter.Name, out var previousValue) == VSConstants.S_OK) 893newArguments = newArguments.SetItem(previousParameter.Name, previousValue); 904newArguments.TryGetValue(parameter.Name, out var value); 921newArguments = newArguments.SetItem(parameter.Name, value); 924var snippet = CreateMethodCallSnippet(method.Name, includeMethod: false, method.Parameters, newArguments); 931_state._methodNameForInsertFullMethodCall = method.Name;
Utilities\MemberSymbolViewModel.cs (1)
20public string MakeAbstractCheckBoxAutomationText => string.Format(ServicesVSResources.Make_0_abstract, Symbol.Name);
Venus\ContainedLanguageCodeSupport.cs (6)
70var reservedNames = semanticModel.LookupSymbols(point.Value.Position, type).Select(m => m.Name); 304return members.Select(m => Tuple.Create(m.Name, ConstructMemberId(m))); 333var undoTitle = string.Format(WorkspacesResources.Rename_0_to_1, symbol.Name, newName); 433ns = ns.GetNamespaceMembers().SingleOrDefault(n => n.Name == parts[i]); 450return string.Format("{0}({1})", member.Name, string.Join(",", ((IMethodSymbol)member).Parameters.Select(p => p.Type.ToDisplayString()))); 454return member.Name + "(EVENT)";
Workspace\VisualStudioSymbolRenamedCodeActionOperationFactoryWorkspaceService.cs (1)
84public override string Title => string.Format(WorkspacesResources.Rename_0_to_1, _symbol.Name, _newName);
Microsoft.VisualStudio.LanguageServices.CSharp (13)
CodeModel\CSharpCodeModelService.cs (1)
684if (SyntaxFactsService.IsValidIdentifier(typeSymbol.Name))
CodeModel\CSharpCodeModelService_Prototype.cs (6)
92AppendDelegatePrototype(builder, symbol, flags, symbol.Name); 134AppendEventPrototype(builder, symbol, flags, symbol.Name); 155AppendFunctionPrototype(builder, symbol, flags, symbol.Name); 197AppendPropertyPrototype(builder, symbol, flags, symbol.Name); 239AppendVariablePrototype(builder, symbol, flags, symbol.Name); 552builder.Append(parameter.Name);
ObjectBrowser\DescriptionBuilder.cs (6)
201switch (methodSymbol.Name) 344AddName(typeParameterSymbol.Name); 443AddParam(current.Name); 476AddName(fieldSymbol.Name); 496AddName(propertySymbol.Name); 534AddName(eventSymbol.Name);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
ProjectSystemShim\EntryPointFinderTests.cs (1)
28Assert.Equal("C", entryPoints.Single().Name);
Microsoft.VisualStudio.LanguageServices.VisualBasic (15)
CodeModel\MethodXML\MethodXmlBuilder.vb (4)
343Return symbol.ContainingSymbol.ToDisplayString(s_fullNameFormat) & "." & symbol.Name 357Dim name = If(symbolOpt IsNot Nothing, symbolOpt.Name, memberAccess.Name.Identifier.ValueText) 409Dim name = If(symbolOpt IsNot Nothing, symbolOpt.Name, identifierName.Identifier.ValueText) 674Using NewDelegateTag(delegateSymbol.Name)
CodeModel\VisualBasicCodeModelService.vb (1)
2539If symbol.IsOverride AndAlso symbol.Name = "Finalize" Then
CodeModel\VisualBasicCodeModelService_Prototype.vb (2)
166builder.Append(symbol.Name) 181builder.Append(parameter.Name)
Help\VisualBasicHelpContextService.Visitor.vb (2)
452If symbol.Name.Equals("My", StringComparison.CurrentCultureIgnoreCase) Then 455result = "vb." + symbol.Name
ObjectBrowser\DescriptionBuilder.vb (6)
139Select Case methodSymbol.Name 246AddText(fieldSymbol.Name) 278AddName(propertySymbol.Name) 298AddName(eventSymbol.Name) 426AddParam(current.Name) 456AddName(current.Name)
Roslyn.Compilers.VisualBasic.IOperation.UnitTests (7)
IOperation\IOperationTests.vb (7)
102Assert.Equal(add2.OperatorMethod.Name, "op_Addition") 192Assert.Equal(target1.Local.Name, "x") 195Assert.Equal(value1.Local.Name, "y") 220Assert.Equal(target2.Local.Name, "a") 223Assert.Equal(value2.Local.Name, "b") 226Assert.Equal(assignment2.OperatorMethod.Name, "op_Addition") 872Assert.Equal("b", fieldOperation.Field.Name)
System.Private.CoreLib.Generators (5)
EventSourceGenerator.Parser.cs (1)
37if (attribute.AttributeClass?.Name != "EventSourceAttribute" ||
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (4)
68if (innerNamespace.Name == namespaceName) 156if (member.Name == "IsSupported") 281if (symbolInfo.Symbol.Name == "IsSupported") 511if (propertySymbol.Name == "IsSupported")
System.Text.Json.SourceGeneration (25)
Helpers\RoslynExtensions.cs (7)
87type = namedType = containingType.GetTypeMembers().First(t => t.Name == namedType.Name && t.Arity == namedType.Arity); 223return member.Name == otherMember.Name && member.ContainingType.IsAssignableFrom(otherMember.ContainingType); 227=> SyntaxFacts.GetKeywordKind(symbol.Name) != SyntaxKind.None || SyntaxFacts.GetContextualKeywordKind(symbol.Name) != SyntaxKind.None; 380attr.AttributeClass?.Name == attributeName &&
JsonSourceGenerator.Parser.cs (17)
129ReportDiagnostic(DiagnosticDescriptors.ContextClassesMustBePartial, _contextClassLocation, contextTypeSymbol.Name); 293Debug.Assert(attributeData.ConstructorArguments.Length == 1 & attributeData.ConstructorArguments[0].Type?.Name is nameof(JsonSerializerDefaults)); 643if (!_generatedContextAndTypeNames.Add((contextType.Name, typeInfoPropertyName))) 1020ignoredMembers?.TryGetValue(property.Name, out ISymbol? ignoredMember) == true && 1153ReportDiagnostic(DiagnosticDescriptors.InaccessibleJsonIncludePropertiesNotSupported, memberInfo.GetLocation(), declaringType.Name, memberInfo.Name); 1165ReportDiagnostic(DiagnosticDescriptors.DataExtensionPropertyInvalid, memberInfo.GetLocation(), declaringType.Name, memberInfo.Name); 1185ReportDiagnostic(DiagnosticDescriptors.TypeContainsRefLikeMember, memberInfo.GetLocation(), declaringType.Name, memberInfo.Name); 1191string effectiveJsonPropertyName = DetermineEffectiveJsonPropertyName(memberInfo.Name, jsonPropertyName, options); 1201NameSpecifiedInSourceCode = memberInfo.MemberNameNeedsAtSign() ? "@" + memberInfo.Name : memberInfo.Name, 1202MemberName = memberInfo.Name, 1267else if (attributeType.ContainingAssembly.Name == SystemTextJsonNamespace) 1472ReportDiagnostic(DiagnosticDescriptors.TypeContainsRefLikeMember, parameterInfo.GetLocation(), type.Name, parameterInfo.Name); 1482Name = parameterInfo.Name, 1695return type.Name; 1700string name = namedType.Name;
src\libraries\Common\src\SourceGenerators\TypeRef.cs (1)
18Name = type.Name;
System.Text.RegularExpressions.Generator (9)
RegexGenerator.Parser.cs (1)
218regexMemberSymbol.Name,
UpgradeToGeneratedRegexAnalyzer.cs (2)
75methodNames.Contains(method.Name)) 165string? argumentName = argument.Parameter?.Name;
UpgradeToGeneratedRegexCodeFixer.cs (6)
117while (members.Any(m => m.Name == methodName)) 166.Where(arg => arg.Parameter?.Name is not (UpgradeToGeneratedRegexAnalyzer.OptionsArgumentName or UpgradeToGeneratedRegexAnalyzer.PatternArgumentName)) 169replacement = generator.InvocationExpression(generator.MemberAccessExpression(replacement, invocationOperation.TargetMethod.Name), arguments); 257IArgumentOperation? patternArgument = arguments.SingleOrDefault(arg => arg.Parameter?.Name == UpgradeToGeneratedRegexAnalyzer.PatternArgumentName); 268IArgumentOperation? optionsArgument = arguments.SingleOrDefault(arg => arg.Parameter?.Name == UpgradeToGeneratedRegexAnalyzer.OptionsArgumentName); 278IArgumentOperation? argument = arguments.SingleOrDefault(arg => arg.Parameter?.Name == parameterName);
System.Windows.Forms.Analyzers.CSharp (7)
System\Windows\Forms\CSharp\Analyzers\AvoidPassingTaskWithoutCancellationToken\AvoidPassingTaskWithoutCancellationTokenAnalyzer.cs (2)
36|| methodSymbol.Name != InvokeAsyncString || methodSymbol.Parameters.Length != 2) 67&& returnType.Name is TaskString or ValueTaskString)
System\Windows\Forms\CSharp\Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationAnalyzer.cs (5)
35.Any(i => i.Name == nameof(IComponent))) 49.Any(a => a?.AttributeClass?.Name is (nameof(DesignerSerializationVisibilityAttribute)) 64.FirstOrDefault(m => m.Name == $"ShouldSerialize{propertySymbol.Name}"); 75messageArgs: propertySymbol.Name);
System.Windows.Forms.Analyzers.VisualBasic (5)
Analyzers\AvoidPassingTaskWithoutCancellationToken\AvoidPassingTaskWithoutCancellationTokenAnalyzer.vb (3)
42If methodSymbol Is Nothing OrElse methodSymbol.Name <> InvokeAsyncString OrElse methodSymbol.Parameters.Length <> 2 Then 81If returnType IsNot Nothing AndAlso (returnType.Name = TaskString OrElse returnType.Name = ValueTaskString) Then
Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationDiagnosticAnalyzer.vb (2)
66FirstOrDefault(Function(m) m.Name = $"ShouldSerialize{propertySymbol.Name}") 77propertySymbol.Name)