6 implementations of Name
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
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)
1246Private ReadOnly Property ISymbol_Name As String Implements ISymbol.Name, ISymbolInternal.Name
Microsoft.CodeAnalysis.Workspaces (1)
CodeGenerationSymbol.cs (1)
31public string Name { get; }
2785 references to Name
Microsoft.CodeAnalysis (26)
Compilation\Compilation.cs (4)
3180pePdbFilePath = pePdbFilePath ?? FileNameUtilities.ChangeExtension(SourceModule.Name, "pdb"); 3385pdbFilePath ?? FileNameUtilities.ChangeExtension(SourceModule.Name, "pdb"), 3579return 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)
2788declaredSymbol.Name == otherSymbol.Name &&
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
552if (methodContext.TypeParameters[i].Name == typeParameterName) 564if (containingType.TypeParameters[i].Name == typeParameterName)
DiagnosticAnalyzer\SymbolDeclaredCompilationEvent.cs (1)
35var name = Symbol.Name;
DocumentationCommentId.cs (7)
388_builder.Append(EncodeName(symbol.Name)); 399_builder.Append(EncodeName(symbol.Name)); 410var name = EncodePropertyName(symbol.Name); 423_builder.Append(EncodeName(symbol.Name)); 480_builder.Append(EncodeName(symbol.Name)); 491_builder.Append(EncodeName(symbol.Name)); 527_builder.Append(EncodeName(symbol.Name));
Operations\ControlFlowGraphBuilder.cs (1)
3321foreach (ISymbol candidate in valueType.GetMembers(method.Name))
SymbolDisplay\AbstractSymbolDisplayVisitor.cs (3)
150if (!ctor.Parameters.Any() && type.Name == "FlagsAttribute") 154containingSymbol.Name == "System" && 275var enumField = new EnumField(field.Name, EnumUtilities.ConvertEnumUnderlyingTypeToUInt64(field.ConstantValue, underlyingSpecialType), field);
SymbolDisplay\AbstractSymbolDisplayVisitor_Minimal.cs (3)
25? semanticModelOpt.LookupNamespacesAndTypes(positionOpt, name: symbol.Name) 26: semanticModelOpt.LookupSymbols(positionOpt, name: symbol.Name); 43ImmutableArray<ISymbol> typeOnlySymbols = semanticModelOpt.LookupNamespacesAndTypes(positionOpt, name: symbol.Name);
Symbols\ISymbolExtensions.cs (1)
88return field.IsTupleElement() && !field.IsImplicitlyDeclared ? field.Name : null;
Microsoft.CodeAnalysis.CodeStyle (130)
AbstractConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
68var parentProperty = operationParent.Property.Name;
AbstractForEachCastDiagnosticAnalyzer.cs (1)
97if (conversion.IsUserDefined && conversion.MethodSymbol is { Name: WellKnownMemberNames.ImplicitConversionName })
AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
827attribute.AttributeConstructor?.Parameters is [_, { Name: "checkId", Type.SpecialType: SpecialType.System_String }, ..] && 835if (attribute.AttributeConstructor.Parameters[0].Name == "category" &&
AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (3)
450if (debuggerDisplayAttributeArguments.Any(arg => arg.Contains(member.Name))) 734if (methodSymbol.Name.StartsWith(prefix)) 736var suffix = methodSymbol.Name[prefix.Length..];
AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
541symbol.Name);
AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (2)
149parameter.Name, 213parameter.Name == DiscardVariableName ||
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;
AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
101if (s_nonEnumerableReturningLinqMethodNames.Contains(method.Name) &&
AbstractSpeculationAnalyzer.cs (12)
411symbol.Name == newSymbol.Name && 416return symbol.Name == newSymbol.Name; 419return symbol.Name == newSymbol.Name; 426return symbol.Name == newSymbol.Name && 436return symbol.Name == newSymbol.Name && 1092var parameter1 = signature1Parameters.FirstOrDefault(p => p.Name == name); 1095var parameter2 = signature2Parameters.FirstOrDefault(p => p.Name == name);
AbstractUseAutoPropertyAnalyzer.cs (1)
113fieldNames.Add(field.Name);
AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
178syntaxFacts.GetIdentifierOfIdentifierName(identifier).ValueText == localSymbol.Name)
AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
248if (p.Name == searchArgumentName)
HashCodeAnalyzer.cs (1)
64if (owningSymbol is not IMethodSymbol { Name: nameof(GetHashCode) } method)
HashCodeAnalyzer.OperationDeconstructor.cs (1)
87if (targetMethod.Name == nameof(GetHashCode) &&
IMethodSymbolExtensions.cs (2)
72=> symbol.Name switch 102=> methodSymbol.Name is WellKnownMemberNames.EntryPointMethodName or WellKnownMemberNames.TopLevelStatementsEntryPointMethodName &&
INamedTypeSymbolExtensions.cs (3)
70return type.GetBaseTypesAndThis().SelectMany(t => t.GetMembers(symbol.Name)) 444if (namedParameter != null && seenNames.Add(namedParameter.Name)) 613Name: nameof(Equals),
INamespaceOrTypeSymbolExtensions.cs (1)
81result.Add(namespaceOrTypeSymbol.Name);
IParameterSymbolExtensions.cs (1)
42foreach (var member in containingType.GetMembers(parameter.Name))
ISymbolExtensions.cs (14)
607=> symbol.Name == WellKnownMemberNames.GetAwaiter && 619if (!returnType.GetMembers().OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.IsCompleted && p.Type.SpecialType == SpecialType.System_Boolean && p.GetMethod != null)) 633if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }])) 637return methods.Any(m => m.Name == WellKnownMemberNames.GetResult && !m.Parameters.Any()); 641=> symbol.Name == WellKnownMemberNames.GetEnumeratorMethodName && 658if (!members.OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.CurrentPropertyName && p.GetMethod != null)) 668Name: WellKnownMemberNames.MoveNextMethodName, 681=> symbol.Name == WellKnownMemberNames.GetAsyncEnumeratorMethodName && 698if (!members.OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.CurrentPropertyName && p.GetMethod != null)) 707if (!members.OfType<IMethodSymbol>().Any(x => x.Name == WellKnownMemberNames.MoveNextAsyncMethodName)) 733=> symbol.Name.StartsWith("_") && 734(symbol.Name.Length == 1 || uint.TryParse(symbol.Name[1..], out _)); 745ContainingNamespace.Name: nameof(System),
ITypeSymbolExtensions.cs (3)
234b.ContainingNamespace.Name == "System" && 249&& symbol.ContainingNamespace?.Name == "System" 703if (attributeData.AttributeClass?.Name == nameof(ReferenceAssemblyAttribute)
NamingStyleDiagnosticAnalyzerBase.cs (4)
111if (string.IsNullOrEmpty(symbol.Name)) 148if (!cache.TryGetValue(symbol.Name, out var failureReason)) 150if (applicableRule.NamingStyle.IsNameCompliant(symbol.Name, out failureReason)) 155cache.TryAdd(symbol.Name, failureReason);
NamingStyleRules.cs (1)
100var implementedInterfaceMembersWithSameName = implementedInterface.GetMembers(symbol.Name);
SuppressMessageAttributeState.cs (1)
71builder.Add((propertyReference.Property.Name, simpleAssignment.Value));
SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
552if (methodContext.TypeParameters[i].Name == typeParameterName) 564if (containingType.TypeParameters[i].Name == typeParameterName)
SymbolEquivalenceComparer.AssemblyComparers.cs (3)
16=> AssemblyIdentityComparer.SimpleNameComparer.Equals(x?.Name, y?.Name); 23return AssemblyIdentityComparer.SimpleNameComparer.GetHashCode(obj.Name);
SymbolEquivalenceComparer.EquivalenceVisitor.cs (27)
156x.Name == y.Name && 164x.Name == y.Name && 211x.Name != y.Name) 280=> AssembliesAreEquivalent(x.ContainingAssembly, y.ContainingAssembly) && x.Name == y.Name; 346x.Name != y.Name || 363if (xNamespace.Name != yNamespace.Name) 368if (xNamespace.Name == "") 386!AssemblyIdentityComparer.SimpleNameComparer.Equals(x.ContainingAssembly.Name, y.ContainingAssembly.Name) && 422if (xElement.Name != yElement.Name) 522if (p1.Name != p2.Name || 537x.Name != y.Name) 555x.Name == y.Name && 596x.Name == y.Name && 644=> x.Name == y.Name;
SymbolEquivalenceComparer.GetHashCodeVisitor.cs (11)
95Hash.Combine(x.Name, 102Hash.Combine(x.Name, 127Hash.Combine(x.Name, currentHash))))))); 144=> CombineHashCodes(x.ContainingAssembly, Hash.Combine(x.Name, currentHash)); 177Hash.Combine(x.Name, 205return Hash.Combine(p.Name, 217return Hash.Combine(x.Name, currentHash); 222Hash.Combine(x.Name, 230Hash.Combine(x.Name, 246Hash.Combine(x.Name, 256Hash.Combine(x.Name,
SymbolEquivalenceComparer.ParameterSymbolEqualityComparer.cs (4)
48x.Name == y.Name 49: string.Equals(x.Name, y.Name, StringComparison.OrdinalIgnoreCase);
SymbolKey.AliasSymbolKey.cs (2)
19visitor.WriteString(symbol.Name); 67if (aliasSymbol.Name == name &&
SymbolKey.AnonymousTypeSymbolKey.cs (1)
24var propertyNames = properties.SelectAsArray(p => p.Name);
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))
SymbolKey.BuiltinOperatorSymbolKey.cs (1)
19visitor.WriteString(symbol.Name);
SymbolKey.cs (1)
75/// cref="SyntaxTree"/> is enumerated to list all the symbols with the same <see cref="ISymbol.Name"/> and <see
SymbolKey.ErrorTypeSymbolKey.cs (3)
19visitor.WriteString(symbol.Name); 56while (namespaceSymbol != null && namespaceSymbol.Name != "") 58builder.Add(namespaceSymbol.Name);
SymbolKey.NamedTypeSymbolKey.cs (2)
21visitor.WriteString(symbol.Name); 110if (errorType.Name != name || errorType.Arity != arity)
SymbolKey.TupleTypeSymbolKey.cs (1)
31friendlyNames.Add(element.IsImplicitlyDeclared ? null : element.Name);
UseExplicitTupleNameDiagnosticAnalyzer.cs (3)
63nameof(ElementName), namedField.Name); 87!fieldSymbol.Name.Equals(unnamedField.Name))
UseNamedMemberInitializerAnalyzer.cs (1)
181statement, leftMemberAccess, rightExpression, typeMember?.Name ?? identifier.ValueText));
Microsoft.CodeAnalysis.CodeStyle.Fixes (57)
AbstractAddExplicitCastCodeFixProvider.cs (1)
183if (argumentName.Equals(parameters[j].Name))
AbstractAddParameterCodeFixProvider.cs (1)
437methodParameterNames.AddRange(method.Parameters.Select(p => p.Name));
AbstractAliasAmbiguousTypeCodeFixProvider.cs (3)
56var typeName = symbol.Name; 116if (string.IsNullOrEmpty(current.Name)) 119result.Add(current.Name);
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);
AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
86symbol.Name,
AbstractMakeMethodAsynchronousCodeFixProvider.cs (5)
63var isEntryPoint = methodSymbol.IsStatic && IsLikelyEntryPointName(methodSymbol.Name, document); 132if (methodSymbol.Name.EndsWith(AsyncSuffix)) 162var name = methodSymbol.Name; 225return returnType.Name.Equals("Task") || 226returnType.Name.Equals("ValueTask");
AbstractMakeMethodSynchronousCodeFixProvider.cs (3)
62methodSymbol.Name.Length > AsyncSuffix.Length && 63methodSymbol.Name.EndsWith(AsyncSuffix)) 75var name = methodSymbol.Name;
AbstractMoveDeclarationNearReferenceService.cs (1)
221if (syntaxFacts.StringComparer.Equals(name, localSymbol.Name))
AbstractPopulateSwitchCodeFixProvider.cs (1)
181let caseLabel = (TMemberAccessExpression)generator.MemberAccessExpression(generator.TypeExpression(enumType), e.Name).WithAdditionalAnnotations(Simplifier.Annotation)
AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
574var declarationStatement = CreateLocalDeclarationStatement(declaredLocal.Type, declaredLocal.Name);
AbstractSemanticFactsService.cs (2)
82return GenerateUniqueName(baseName, filteredCandidates.Select(s => s.Name).Concat(usedNames)); 119return disposableType?.GetMembers().OfType<IMethodSymbol>().FirstOrDefault(m => m.Parameters.Length == 0 && m.Name == methodName);
AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
126symbol.Name == nameof(Enum.HasFlag) &&
AbstractUnsealClassCodeFixProvider.cs (1)
46var title = string.Format(TitleFormat, type.Name);
AddParameterService.cs (1)
166var uniqueName = NameGenerator.EnsureUniqueness(argumentNameSuggestion, method.Parameters.Select(p => p.Name));
CodeGenerationConstructorInfo.cs (1)
84=> info == null ? constructor.ContainingType.Name : info._typeName;
CodeGenerationDestructorInfo.cs (1)
53=> info == null ? constructor.ContainingType.Name : info._typeName;
CodeGenerationHelpers.cs (10)
55if (info.Context.GenerateMembers && info.Context.MergeNestedNamespaces && @namespace.Name != string.Empty) 58names.Add(@namespace.Name); 67names.Add(childNamespace.Name); 79name = @namespace.Name; 169: f1.Name.CompareTo(f2.Name); 402Name: "NullableAttribute" or "NullableContextAttribute" or "NativeIntegerAttribute" or "DynamicAttribute", 405Name: nameof(System.Runtime.CompilerServices), 408Name: nameof(System.Runtime), 411Name: nameof(System),
CodeGenerationNamedTypeSymbol.cs (1)
92return this.GetMembers().Select(m => m.Name).ToList();
CodeGenerationNamespaceOrTypeSymbol.cs (2)
34=> GetMembers().WhereAsArray(s => s.Name == name); 40=> GetTypeMembers().WhereAsArray(s => s.Name == name);
CodeGenerationNamespaceSymbol.cs (1)
46=> GetMembers().Where(m => m.Name == name);
CodeGenerationSymbolFactory.cs (6)
306name.HasValue ? name.Value : parameter.Name, 372accessor.Name, 533name ?? method.Name, 561name ?? property.Name, 584name ?? @event.Name, 601name ?? field.Name);
INamedTypeSymbolExtensions.cs (1)
26namedType.Name,
NamingStyleCodeFixProvider.cs (1)
89var fixedNames = style.MakeCompliant(symbol.Name);
SyntaxGeneratorExtensions.cs (1)
55return factory.Argument(parameter.RefKind, factory.IdentifierName(parameter.Name));
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);
SyntaxGeneratorExtensions_Negate.cs (1)
418if (property.Name is nameof(Array.Length) or nameof(Array.LongLength))
Microsoft.CodeAnalysis.CSharp (49)
Compilation\CSharpCompilation.cs (1)
1356return 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 (8)
111builder.Add(CreatePart(SymbolDisplayPartKind.ModuleName, symbol, symbol.Name)); 149builder.Add(CreatePart(SymbolDisplayPartKind.NamespaceName, symbol, symbol.Name)); 224builder.Add(CreatePart(SymbolDisplayPartKind.ConstantName, symbol, symbol.Name)); 228builder.Add(CreatePart(SymbolDisplayPartKind.LocalName, symbol, symbol.Name)); 273builder.Add(CreatePart(SymbolDisplayPartKind.RangeVariableName, symbol, symbol.Name)); 278builder.Add(CreatePart(SymbolDisplayPartKind.LabelName, symbol, symbol.Name)); 283builder.Add(CreatePart(SymbolDisplayPartKind.AliasName, symbol, symbol.Name)); 410&& symbol.Name != WellKnownMemberNames.EnumBackingFieldName;
SymbolDisplay\SymbolDisplayVisitor.Members.cs (23)
65builder.Add(CreatePart(SymbolDisplayPartKind.EnumMemberName, symbol, symbol.Name)); 69builder.Add(CreatePart(SymbolDisplayPartKind.ConstantName, symbol, symbol.Name)); 73builder.Add(CreatePart(SymbolDisplayPartKind.FieldName, symbol, symbol.Name)); 194bool getMemberNameWithoutInterfaceName = symbol.Name.LastIndexOf('.') > 0; 208ExplicitInterfaceHelpers.GetMemberNameWithoutInterfaceName(symbol.Name))); 212this.builder.Add(CreatePart(SymbolDisplayPartKind.PropertyName, symbol, symbol.Name)); 258if (symbol.Name.LastIndexOf('.') > 0) 263ExplicitInterfaceHelpers.GetMemberNameWithoutInterfaceName(symbol.Name))); 267this.builder.Add(CreatePart(SymbolDisplayPartKind.EventName, symbol, symbol.Name)); 286builder.Add(CreatePart(SymbolDisplayPartKind.NumericLiteral, symbol, symbol.Name)); 430builder.Add(CreatePart(SymbolDisplayPartKind.MethodName, symbol, symbol.Name)); 437builder.Add(CreatePart(SymbolDisplayPartKind.ExtensionMethodName, symbol, symbol.Name)); 476? symbol.Name 477: symbol.ContainingType.Name; 491builder.Add(CreatePart(partKind, symbol, symbol.Name)); 496builder.Add(CreatePart(partKind, symbol, symbol.ContainingType.Name)); 527ExplicitInterfaceHelpers.GetMemberNameWithoutInterfaceName(symbol.Name))); 543builder.Add(CreatePart(SymbolDisplayPartKind.MethodName, symbol, symbol.Name)); 564builder.Add(CreatePart(SymbolDisplayPartKind.MethodName, symbol, symbol.Name)); 627Debug.Assert(conventionType.Name.StartsWith("CallConv")); 629builder.Add(CreatePart(SymbolDisplayPartKind.ClassName, conventionType, conventionType.Name[CallConvLength..])); 800var includeName = symbol.Name.Length != 0 && (format.ParameterOptions.IncludesOption(SymbolDisplayParameterOptions.IncludeName) || 858builder.Add(CreatePart(kind, symbol, symbol.Name));
SymbolDisplay\SymbolDisplayVisitor.Types.cs (5)
168builder.Add(CreatePart(SymbolDisplayPartKind.TypeParameterName, symbol, symbol.Name)); 175builder.Add(CreatePart(SymbolDisplayPartKind.Keyword, symbol, symbol.Name)); 366symbolName ??= symbol.Name; 558builder.Add(CreatePart(SymbolDisplayPartKind.FieldName, element, element.Name)); 576return property.Type.ToDisplayString(format) + " " + property.Name;
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (5)
31var aliasName = alias.Name; 75? semanticModelOpt.LookupNamespacesAndTypes(positionOpt, name: symbol.Name) 76: semanticModelOpt.LookupSymbols(positionOpt, name: symbol.Name); 110builder.Add(CreatePart(SymbolDisplayPartKind.NamespaceName, symbol, symbol.Name)); 235var identifierName = SyntaxFactory.IdentifierName(symbol.Name);
Symbols\ModuleSymbol.cs (1)
370return cns.GetNestedNamespace(namespaceSymbol.Name);
Symbols\PublicModel\AssemblySymbol.cs (1)
73var 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 (40)
ArgumentSyntaxExtensions.cs (1)
67var parameter = parameters.FirstOrDefault(p => p.Name == name);
AttributeArgumentSyntaxExtensions.cs (1)
51var parameter = parameters.FirstOrDefault(p => p.Name == name);
CastSimplifier.cs (2)
1289if (originalParameter.Name != rewrittenParameter.Name &&
ConversionExtensions.cs (1)
20conversion.MethodSymbol.Name == "op_Implicit";
CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
313var variableName = _localSymbol.Name;
CSharpAsAndNullCheckDiagnosticAnalyzer.cs (4)
181if (identifierName.Identifier.ValueText == asOperand?.Name && 189if (identifierName.Identifier.ValueText == localSymbol.Name) 218identifierName.Identifier.ValueText == localSymbol.Name && 238identifierName.Identifier.ValueText == localSymbol.Name &&
CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
331var variableName = outSymbol.Name;
CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
214if (symbol?.Name == nameof(ReferenceEquals) &&
CSharpUseDeconstructionDiagnosticAnalyzer.cs (4)
206.Select(s => s.Name) 207.Concat(existingSymbols.Select(s => s.Name)) 212if (reservedNames.Contains(element.Name)) 248var localName = local.Name;
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (3)
222if (identifierName.Identifier.ValueText == local.Name && 365var delegateTypeParamNames = delegateType.GetAllTypeParameters().Select(p => p.Name).ToImmutableHashSet(); 377if (typeParams.Any(static (p, delegateTypeParamNames) => delegateTypeParamNames.Contains(p.Name), delegateTypeParamNames))
CSharpUseRangeOperatorDiagnosticAnalyzer.cs (1)
267result.SliceLikeMethod.Name);
CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (1)
102.GetMembers(method.Name)
Helpers.cs (5)
116(parameter.Name == "start" || parameter.Name == "startIndex"); 120(parameter.Name == "count" || parameter.Name == "length"); 145: method.ContainingType.GetMembers(method.Name)
ILocalSymbolExtensions.cs (2)
21HasTypeParameterWithName(localFunctionOrMethodDeclaration, localSymbol.Type.Name) && 22HasTypeParameterWithName(localFunctionStatement, localSymbol.Type.Name))
ParenthesizedExpressionSyntaxExtensions.cs (2)
78Name: nameof(Span<int>) or nameof(ReadOnlySpan<int>), 79ContainingNamespace: { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true }
SemanticModelExtensions.cs (2)
442if (SyntaxFacts.GetContextualKeywordKind(parameter.Name) is not SyntaxKind.UnderscoreToken) 444return parameter.Name;
TypeStyleHelper.cs (5)
163? returnType.GetTypeArguments().First().Name 164: returnType.Name; 166return methodSymbol.Name.Equals("To" + returnTypeName, StringComparison.Ordinal); 184return UnwrapTupleType(containingType).Name.Equals(returnType.Name);
TypeSyntaxExtensions.cs (1)
44if (type.Name == "var")
UseSimpleUsingStatementDiagnosticAnalyzer.cs (2)
133var symbolNameToExistingSymbol = semanticModel.GetExistingSymbols(parentBlock, cancellationToken).ToLookup(s => s.Name); 152=> locals.Any(static (local, symbolNameToExistingSymbol) => symbolNameToExistingSymbol[local.Name].Any(otherLocal => !local.Equals(otherLocal)), symbolNameToExistingSymbol);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (67)
AbstractAssignOutParametersCodeFixProvider.cs (1)
162generator.IdentifierName(parameter.Name),
AttributeGenerator.cs (2)
28attributes.OrderBy(a => a.AttributeClass?.Name) 40attributes.OrderBy(a => a.AttributeClass?.Name)
ConvertToRecordEngine.cs (6)
102.OrderBy(type => type.Name) 104.OrderBy(type => type.Name), 247if (methodSymbol.Name == "Clone") 278? SyntaxFactory.Identifier(result.Symbol.Name) 339SyntaxFactory.Argument(SyntaxFactory.IdentifierName(prop.Name))); 747yield return SyntaxFactory.XmlParamElement(result.Symbol.Name, SyntaxFactory.XmlEmptyElement(
ConvertToRecordHelpers.cs (5)
28if (methodSymbol.Name == nameof(Equals) && 45TargetMethod: IMethodSymbol { Name: nameof(Equals) }, 80if (methodSymbol.Name == nameof(GetHashCode) && 629TargetMethod.Name: nameof(Equals), 766TargetMethod.Name: nameof(Equals),
CSharpDeclareAsNullableCodeFixProvider.cs (1)
243var parameter = method.Parameters.Where(p => p.Name == identifier.Text).FirstOrDefault();
CSharpDisambiguateSameVariableCodeFixProvider.cs (7)
98var localOrParamName = leftSymbol.Name; 117where m.Name == localOrParamName || 118m.Name == pascalName || 119m.Name == camelName || 120m.Name == underscoreName 129title = string.Format(titleFormat, $"{memberContainer}.{matchingMember.Name}"); 153var newNameNode = matchingMember.Name.ToIdentifierName();
CSharpTypeInferenceService.TypeInferrer.cs (6)
38(otherSideType.Name == string.Empty || otherSideType.Name == "var"); 776.Where(p => p.Name == name) 1680.Where(p => p.Name == memberDeclarator.NameEquals.Name.Identifier.ValueText) 2257return types.Where(t => t.InferredType.Name == "var"); 2273if (descendant.Identifier.ValueText != symbol.Name)
CSharpUseDeconstructionCodeFixProvider.cs (1)
166e => SyntaxFactory.SingleVariableDesignation(SyntaxFactory.Identifier(e.Name.EscapeIdentifier()))))));
CSharpUseLocalFunctionCodeFixProvider.cs (2)
256PromoteParameter(generator, SyntaxFactory.Parameter(parameter.Name.ToIdentifierToken()), parameter)))); 320return method.Parameters.IndexOf(p => p.Name == name);
EnumMemberGenerator.cs (1)
64var member = SyntaxFactory.EnumMemberDeclaration(enumMember.Name.ToIdentifierToken())
EventGenerator.cs (2)
121SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(@event.Name.ToIdentifierToken())))))); 134identifier: @event.Name.ToIdentifierToken(),
FieldGenerator.cs (1)
103AddAnnotationsTo(field, SyntaxFactory.VariableDeclarator(field.Name.ToIdentifierToken(), null, initializer)))));
ITypeParameterSymbolExtensions.cs (1)
81typeParameter.Name.ToIdentifierName(),
ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (1)
84var syntax = AddInformationTo(symbol.Name.ToIdentifierName(), symbol);
ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (9)
48=> AddInformationTo(symbol.Name.ToIdentifierName(), symbol); 144? null : symbol.Signature.UnmanagedCallingConventionTypes.Select(type => GetConventionForString(type.Name["CallConv".Length..])), 183if (symbol.Name == string.Empty || symbol.IsAnonymousType) 190if (symbol.TypeKind == TypeKind.Error && symbol.Name == "var") 195return symbol.Name.ToIdentifierName(); 203symbol.Name.ToIdentifierToken(), 251var name = element.IsImplicitlyDeclared ? default : SyntaxFactory.Identifier(element.Name); 315var syntax = AddInformationTo(symbol.Name.ToIdentifierName(), symbol); 357TypeSyntax typeSyntax = AddInformationTo(symbol.Name.ToIdentifierName(), symbol);
MakeLocalFunctionStaticCodeFixHelper.cs (6)
107seenNamedArgument || seenDefaultArgumentValue ? symbolAndCapture.symbol.Name : null, 109symbolAndCapture.capture.Name.ToIdentifierName())); 124if (parameter.Name == capture.Name) 143(node, generator) => IdentifierName(parameter.Name.ToIdentifierToken()).WithTriviaFrom(node)); 226name: capture.Name.ToCamelCase()), capture);
MethodGenerator.cs (3)
125identifier: method.Name.ToIdentifierToken(), 144identifier: method.Name.ToIdentifierToken(), 239typeParameter.Name.ToIdentifierName(),
NamedTypeGenerator.cs (6)
119members = members.WhereAsArray(m => m is not IPropertySymbol and not IFieldSymbol || !primaryConstructor.Parameters.Any(static (p, m) => p.Name == m.Name, m)); 200SyntaxFactory.Token(SyntaxKind.RecordKeyword), classOrStructKeyword, namedType.Name.ToIdentifierToken(), 209typeDeclaration = SyntaxFactory.TypeDeclaration(kind, namedType.Name.ToIdentifierToken()); 234namedType.Name.ToIdentifierToken(), 252namedType.Name.ToIdentifierToken(),
NamespaceGenerator.cs (1)
157SyntaxFactory.NameEquals(alias.Name.ToIdentifierName()),
OperatorGenerator.cs (1)
81throw new ArgumentException(string.Format(WorkspaceExtensionsResources.Cannot_generate_code_for_unsupported_operator_0, method.Name), nameof(method));
ParameterGenerator.cs (1)
67return SyntaxFactory.Parameter(parameter.Name.ToIdentifierToken())
PropertyGenerator.cs (1)
124identifier: property.Name.ToIdentifierToken(),
TypeParameterGenerator.cs (1)
34symbol.Name.ToIdentifierToken());
UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
93return returnType.Name != nameof(Task);
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (3)
NamingStylesTests.cs (3)
1245Assert.Equal("c", symbolRenamedOperation._symbol.Name); 1270Assert.Equal("test", symbolRenamedOperation._symbol.Name); 1298Assert.Equal("arg", symbolRenamedOperation._symbol.Name);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (3)
EventHookup\EventHookupSessionManager_EventHookupSession.cs (3)
241string.Format("{0}_{1}", objectPart, eventSymbol.Name))); 243var reservedNames = semanticModel.LookupSymbols(plusEqualsToken.SpanStart).Select(m => m.Name); 290: eventSymbol.ContainingType.Name;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (37)
EditAndContinue\TopLevelEditingTests.cs (10)
6377SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("this[]").Cast<IPropertySymbol>().Single(m => m.GetParameters().Single().Type.Name == "Int32").GetMethod, preserveLocalVariables: false), 6378SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("this[]").Cast<IPropertySymbol>().Single(m => m.GetParameters().Single().Type.Name == "Int32").SetMethod, preserveLocalVariables: false), 6379SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("this[]").Cast<IPropertySymbol>().Single(m => m.GetParameters().Single().Type.Name == "Byte").GetMethod, preserveLocalVariables: false), 6380SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("this[]").Cast<IPropertySymbol>().Single(m => m.GetParameters().Single().Type.Name == "Byte").SetMethod, preserveLocalVariables: false), 10834SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(c => c.Parameters.Single().Type.Name == "Int32"), partialType: "C", syntaxMap: syntaxMapB), 10835SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(c => c.Parameters.Single().Type.Name == "Boolean"), partialType: "C", syntaxMap: syntaxMapB), 10836SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(c => c.Parameters.Single().Type.Name == "UInt32"), partialType: "C", syntaxMap: syntaxMapB), 10837SemanticEdit(SemanticEditKind.Insert, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(c => c.Parameters.Single().Type.Name == "Byte"), syntaxMap: null), 16267SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("S").GetMembers("this[]").Cast<IPropertySymbol>().Single(m => m.Parameters.Single().Type.Name == "UInt32").GetMethod, preserveLocalVariables: false), 16268SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("S").GetMembers("this[]").Cast<IPropertySymbol>().Single(m => m.Parameters.Single().Type.Name == "Byte").SetMethod, preserveLocalVariables: false)
ExtractClass\ExtractClassTests.cs (1)
3109selections = _dialogSelection.Select(selection => (member: availableMembers.Single(symbol => symbol.Name == selection.name), selection.makeAbstract));
NamingStylesTests.cs (3)
1245Assert.Equal("c", symbolRenamedOperation._symbol.Name); 1270Assert.Equal("test", symbolRenamedOperation._symbol.Name); 1298Assert.Equal("arg", symbolRenamedOperation._symbol.Name);
SymbolKey\SymbolKeyCompilationsTests.cs (14)
75var originalSymbols = GetSourceSymbols(comp1, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name); 76var newSymbols = GetSourceSymbols(comp2, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name); 105var originalSymbols = GetSourceSymbols(comp1, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name); 106var newSymbols = GetSourceSymbols(comp2, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name); 253var originalSymbols = GetSourceSymbols(originalComp, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name).ToArray(); 254var newSymbols = GetSourceSymbols(newComp, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name).ToArray(); 273var originalSymbols = GetSourceSymbols(originalComp, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name).ToArray(); 274var newSymbols = GetSourceSymbols(newComp, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name).ToArray(); 297var originalSymbols = GetSourceSymbols(originalComp, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name).ToArray(); 298var newSymbols = GetSourceSymbols(newComp, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name).ToArray(); 325var originalSymbols = GetSourceSymbols(originalComp, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name).ToArray(); 326var newSymbols = GetSourceSymbols(newComp, SymbolCategory.DeclaredType | SymbolCategory.DeclaredNamespace).OrderBy(s => s.Name).ToArray(); 471.Where(s => !s.IsAccessor()).OrderBy(s => s.Name); 474.Where(s => !s.IsAccessor()).OrderBy(s => s.Name);
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (7)
65var originalSymbols = GetSourceSymbols(comp1, SymbolCategory.DeclaredType).OrderBy(s => s.Name).ToList(); 150originalSymbols = originalSymbols.Where(s => !s.IsAccessor() && s.Kind != SymbolKind.Parameter).OrderBy(s => s.Name).Select(s => s).ToList(); 261if (local.Name == "fi") 265else if (local.Name == "ary") 269else if (local.Name == "dt") 333var originalSymbols = originals.Where(s => !s.IsAccessor() && s.Kind != SymbolKind.Parameter).OrderBy(s => s.Name).ToList(); 415var originalSymbols = originals.Where(s => !s.IsAccessor() && s.Kind != SymbolKind.Parameter).OrderBy(s => s.Name).ToList();
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 (30)
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)
3688Assert.Equal("a", yType.TupleElements[0].Name); 3692Assert.Equal("Item2", yType.TupleElements[1].Name); 3696Assert.Equal("b", yType.TupleElements[2].Name); 6063Assert.All(tuple8WithoutNames.GetMembers().OfType<IFieldSymbol>().Where(f => f.Name != "Rest").Select(f => f.Locations.FirstOrDefault()), 17381Assert.Equal("Alice", sym.Symbol.Name); 22891AssertEx.SetEqual(xSymbol.GetMembers().OfType<IFieldSymbol>().Select(f => f.Name),
CodeGen\GotoTest.cs (2)
1041Assert.Equal("L0", symbol.Name); 1054Assert.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);
Emit\InAttributeModifierTests.cs (12)
4166Assert.Equal("testRef", parentModifier.ContainingAssembly.Name); 4190Assert.Equal("testRef", childModifier.ContainingAssembly.Name); 4213Assert.Equal("testRef", parentModifier.ContainingAssembly.Name); 4237Assert.Equal("testRef", childModifier.ContainingAssembly.Name); 4260Assert.Equal("testRef", parentModifier.ContainingAssembly.Name); 4286Assert.Equal("testRef", explicitModifier.ContainingAssembly.Name); 4309Assert.Equal("testRef", parentModifier.ContainingAssembly.Name); 4335Assert.Equal(module.ContainingAssembly.Name, implicitModifier.ContainingAssembly.Name); 4338Assert.Equal("testRef", explicitModifier.ContainingAssembly.Name); 4361Assert.Equal("testRef", parentModifier.ContainingAssembly.Name); 4388Assert.Equal(module.ContainingAssembly.Name, implicitModifier.ContainingAssembly.Name); 4391Assert.Equal("testRef", explicitModifier.ContainingAssembly.Name);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (38)
Attributes\AttributeTests.cs (3)
4605Assert.Equal("Bar", ca.Type.Name); 5504Assert.Equal("Type", args[0].Type.Name); 5508Assert.Equal("String", args[1].Type.Name);
Diagnostics\DiagnosticAnalyzerTests.cs (5)
1652if (nodeContext.ContainingSymbol.Name.StartsWith("Funky") && nodeContext.Compilation.Language == "C#") 2328sortedCallbackEntityNames.Add($"Operation: {operationContext.ContainingSymbol.Name}"); 2329ReportOperationDiagnostics(operationContext.Operation, operationContext.ContainingSymbol.Name, operationContext.ReportDiagnostic); 3266var sortedSymbolNames = analyzer1.SymbolsStarted.Select(s => s.Name).ToImmutableSortedSet(); 4056Assert.Equal("C1", symbol.Name);
Diagnostics\GetDiagnosticsTests.cs (8)
181Assert.True(declaredSymbolNames.Contains(compilation.GlobalNamespace.Name)); 230Assert.True(declaredSymbolNames.Contains(compilation.GlobalNamespace.Name)); 285var added = declaredSymbolNames.Add(symbol.Name); 979reportDiagnostic(CodeAnalysis.Diagnostic.Create(Descriptor, location, containingSymbol.Name)); 1244AssertEx.SetEqual(expectedSymbolCallbacks, analyzer.AnalyzedSymbols.Select(s => s.Name).ToHashSet()); 1274AssertEx.SetEqual(expectedBlockSymbolCallbacks, actualBlockSymbolCallbacks.Select(s => s.Name).ToHashSet()); 1279AssertEx.SetEqual(expectedSymbolStartSymbolCallbacks, analyzer.AnalyzedSymbolStartSymbols.Select(s => s.Name).ToHashSet()); 1281AssertEx.SetEqual(expectedSymbolStartSymbolCallbacks, analyzer.AnalyzedSymbolEndSymbols.Select(s => s.Name).ToHashSet());
FlowAnalysis\FlowTestBase.cs (2)
210symbols = symbols.OrderBy(n => n.Name); 213return 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);
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)
3333Assert.Equal(name, local.Name); 3340Assert.Equal(name, local.Name); 4099Assert.Equal(name, local.Name); 4186Assert.Equal(name, local.Name); 4263Assert.Equal(name, local.Name); 4378Assert.Equal(name, local.Name); 4570Assert.Equal(name, local.Name);
Microsoft.CodeAnalysis.CSharp.Features (179)
AbstractAssignOutParametersCodeFixProvider.cs (1)
162generator.IdentifierName(parameter.Name),
ChangeSignature\CSharpChangeSignatureService.cs (1)
810if (identifier == null || identifier.ToString() != declaredParameters.ElementAt(i).Name)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (9)
104name: capture.Name)).ToList(); 147var needsRename = methodName != declaredSymbol.Name; 154? additionalTypeParameters.Select(p => (TypeSyntax)p.Name.ToIdentifierName()).ToArray() 202(ArgumentSyntax)GenerateArgument(p, p.Name, shouldUseNamedArguments)).ToArray(); 245var additionalArguments = capturesAsParameters.Select(p => GenerateArgument(p, p.Name)); 270=> parameters.Select(p => NameGenerator.EnsureUniqueness(p.Name, reservedNames)).ToList(); 273=> semanticModel.GetAllDeclaredSymbols(node.GetAncestor<MemberDeclarationSyntax>(), cancellationToken).Select(s => s.Name).ToList(); 325baseName: declaredSymbol.Name, 326reservedNames: declaredSymbol.ContainingType.GetMembers().Select(m => m.Name));
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
425if (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)
169return symbol.Name; 172return symbol.Name.EscapeIdentifier(isQueryContext: context.IsInQuery);
Completion\CompletionProviders\CrefCompletionProvider.cs (1)
246foreach (var group in symbols.GroupBy(s => s.Name))
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (2)
67if (info.Type is IErrorTypeSymbol { Name.Length: > 0 } && 68!char.IsUpper(info.Type.Name[0]))
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (6)
59names = names.Insert(0, ImmutableArray.Create(nameInfo.Symbol.Name)); 91if (type.IsErrorType() && (type.Name == "var" || type.Name == string.Empty)) 127LooksLikeWellKnownCollectionType(compilation, type.Name)) 309if (!currentParameterNames.Contains(overloadParameter.Name) && 312result.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 (6)
165? alias.Name 170var sortText = symbol.Name; 199var memberDisplayName = $"{displayText}.{field.Name}"; 200var additionalFilterTexts = ImmutableArray.Create(field.Name); 252var memberDisplayName = $"{displayText}.{staticSymbol.Name}"; 253var additionalFilterTexts = ImmutableArray.Create(staticSymbol.Name);
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.CompletionSymbolDisplay.cs (5)
27=> symbol.Name; 39builder.Append(symbol.Name); 58builder.Append(symbol.Name); 105builder.Append($" {parameter.Name.EscapeIdentifier()}"); 114builder.AppendJoinedValues(", ", symbol.TypeArguments, static (symbol, builder) => builder.Append(symbol.Name.EscapeIdentifier()));
Completion\CompletionProviders\FunctionPointerUnmanagedCallingConventionCompletionProvider.cs (2)
111if (type.DeclaredAccessibility == Accessibility.Public && type.Name.StartsWith(CallConvPrefix)) 113var displayName = type.Name[CallConvPrefix.Length..];
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (6)
93.Where(p => !existingNamedParameters.Contains(p.Name)) 116var escapedName = parameter.Name.ToIdentifierToken().ToString(); 140return existingNamedParameters.Except(parameterList.Select(p => p.Name)).IsEmpty(); 278=> x == y || x != null && y != null && x.Name.Equals(y.Name); 281=> obj.Name.GetHashCode();
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (1)
211=> symbol.Name.EscapeIdentifier();
Completion\CompletionProviders\ObjectCreationCompletionProvider.cs (2)
84return (symbol.Name, "", symbol.Name);
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider.cs (1)
130var operatorGroups = unnamedSymbols.WhereAsArray(s => s.IsUserDefinedOperator()).GroupBy(op => op.Name);
Completion\CompletionProviders\PartialTypeCompletionProvider.cs (1)
79=> ImmutableDictionary<string, string>.Empty.Add(InsertionTextOnLessThan, symbol.Name.EscapeIdentifier());
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (3)
81members = members.WhereAsArray(m => !alreadyTestedMembers.Contains(m.Name)); 87displayText: member.Name.EscapeIdentifier(), 122var matches = members.WhereAsArray(m => m.Name == name);
Completion\CompletionProviders\TupleNameCompletionProvider.cs (2)
107displayText: field.Name, 112filterText: field.Name));
Completion\Providers\OutVariableArgumentProvider.cs (2)
40var name = context.Parameter.Name; 56valueText: context.Parameter.Name,
ConvertAutoPropertyToFullProperty\CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (2)
44var fieldName = rule.NamingStyle.MakeCompliant(property.Name).First(); 45return NameGenerator.GenerateUniqueName(fieldName, n => !(property.ContainingType.Name == n || property.ContainingType.GetMembers(n).Any()));
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (3)
250methodSymbol.Name == nameof(IList.Add) && 343if (!namespaces.Any(namespaceSymbol => namespaceSymbol.Name == nameof(System.Linq) && 344namespaceSymbol.ContainingNamespace.Name == nameof(System)) &&
ConvertLinq\ConvertForEachToLinqQuery\DefaultConverter.cs (1)
32.SelectMany(statement => ForEachInfo.SemanticModel.AnalyzeDataFlow(statement).ReadInside).Select(symbol => symbol.Name));
ConvertToRecordEngine.cs (6)
102.OrderBy(type => type.Name) 104.OrderBy(type => type.Name), 247if (methodSymbol.Name == "Clone") 278? SyntaxFactory.Identifier(result.Symbol.Name) 339SyntaxFactory.Argument(SyntaxFactory.IdentifierName(prop.Name))); 747yield return SyntaxFactory.XmlParamElement(result.Symbol.Name, SyntaxFactory.XmlEmptyElement(
ConvertToRecordHelpers.cs (5)
28if (methodSymbol.Name == nameof(Equals) && 45TargetMethod: IMethodSymbol { Name: nameof(Equals) }, 80if (methodSymbol.Name == nameof(GetHashCode) && 629TargetMethod.Name: nameof(Equals), 766TargetMethod.Name: nameof(Equals),
CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
313var variableName = _localSymbol.Name;
CSharpAsAndNullCheckDiagnosticAnalyzer.cs (4)
181if (identifierName.Identifier.ValueText == asOperand?.Name && 189if (identifierName.Identifier.ValueText == localSymbol.Name) 218identifierName.Identifier.ValueText == localSymbol.Name && 238identifierName.Identifier.ValueText == localSymbol.Name &&
CSharpDeclareAsNullableCodeFixProvider.cs (1)
243var parameter = method.Parameters.Where(p => p.Name == identifier.Text).FirstOrDefault();
CSharpDisambiguateSameVariableCodeFixProvider.cs (7)
98var localOrParamName = leftSymbol.Name; 117where m.Name == localOrParamName || 118m.Name == pascalName || 119m.Name == camelName || 120m.Name == underscoreName 129title = string.Format(titleFormat, $"{memberContainer}.{matchingMember.Name}"); 153var newNameNode = matchingMember.Name.ToIdentifierName();
CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
331var variableName = outSymbol.Name;
CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
214if (symbol?.Name == nameof(ReferenceEquals) &&
CSharpUseDeconstructionCodeFixProvider.cs (1)
166e => SyntaxFactory.SingleVariableDesignation(SyntaxFactory.Identifier(e.Name.EscapeIdentifier()))))));
CSharpUseDeconstructionDiagnosticAnalyzer.cs (4)
206.Select(s => s.Name) 207.Concat(existingSymbols.Select(s => s.Name)) 212if (reservedNames.Contains(element.Name)) 248var localName = local.Name;
CSharpUseLocalFunctionCodeFixProvider.cs (2)
256PromoteParameter(generator, SyntaxFactory.Parameter(parameter.Name.ToIdentifierToken()), parameter)))); 320return method.Parameters.IndexOf(p => p.Name == name);
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (3)
222if (identifierName.Identifier.ValueText == local.Name && 365var delegateTypeParamNames = delegateType.GetAllTypeParameters().Select(p => p.Name).ToImmutableHashSet(); 377if (typeParams.Any(static (p, delegateTypeParamNames) => delegateTypeParamNames.Contains(p.Name), delegateTypeParamNames))
CSharpUseRangeOperatorDiagnosticAnalyzer.cs (1)
267result.SliceLikeMethod.Name);
CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (1)
102.GetMembers(method.Name)
Debugging\BreakpointResolver.cs (3)
30.Where(m => m.Name == name || 32.Where(i => i.Name == name) 35return (type.Name == name) ? members.Concat(type.Constructors) : members;
Diagnostics\Analyzers\TypeSyntaxSimplifierWalker.cs (1)
102var name = alias.Target.Name;
DocumentHighlighting\CSharpDocumentHighlightsService.cs (1)
50if (symbol is INamedTypeSymbol && symbol.Name != "var")
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (3)
209where (string?)nameSyntax.Identifier.Value == localOrParameter.Name && 718!oldSymbol.GetParameters().Select(p => p.Name).SequenceEqual(newSymbol.GetParameters().Select(p => p.Name)) &&
EncapsulateField\CSharpEncapsulateFieldService.cs (9)
104field.Name, 153.Where(f => f.Name.Length != 0) 166return (field.Name, MakeUnique(GeneratePropertyName(field.Name), field.ContainingType)); 171var newPropertyName = GeneratePropertyName(field.Name); 173if (newPropertyName == field.Name) 176return (MakeUnique(GenerateFieldName(field.Name), field.ContainingType), newPropertyName); 184if (newFieldName == field.Name) 202var containingTypeMemberNames = containingType.GetAccessibleMembersInThisAndBaseTypes<ISymbol>(containingType).Select(m => m.Name);
ExtractMethod\CSharpMethodExtractor.Analyzer.cs (1)
95var info = model.GetSpeculativeTypeInfo(SelectionResult.FinalSpan.Start, SyntaxFactory.ParseName(symbol.Name), SpeculativeBindingOption.BindAsExpression);
ExtractMethod\CSharpMethodExtractor.cs (1)
193var typeName = SyntaxFactory.ParseTypeName(typeParameter.Name);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (2)
201typeVariables.Add(SyntaxFactory.ParseTypeName(methodTypeParameter.Name)); 635Name: nameof(Task.ConfigureAwait),
GenerateMember\GenerateParameterizedMember\CSharpGenerateConversionService.cs (2)
224=> string.Format(CSharpFeaturesResources.Generate_implicit_conversion_operator_in_0, state.TypeToGenerateIn.Name); 227=> string.Format(CSharpFeaturesResources.Generate_explicit_conversion_operator_in_0, state.TypeToGenerateIn.Name);
GenerateMember\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (1)
69attributes: default, RefKind.Out, isParams: false, element.Type, element.Name));
GenerateMember\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (3)
86s => !State.TypeToGenerateIn.GetAllTypeParameters().Any(static (t, s) => t.Name == s, s), 100s => !usedIdentifiers.Contains(s) && !State.TypeToGenerateIn.GetAllTypeParameters().Any(static (t, s) => t.Name == s, s), 103usedIdentifiers.Add(typeParameter.Name);
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (1)
75var firstImplName = member.ExplicitOrImplicitInterfaceImplementations().First().Name;
ImplementInterface\CSharpImplementInterfaceService.cs (1)
99var methodDecl = SyntaxFactory.DestructorDeclaration(classType.Name).AddBodyStatements(disposeStatement);
InitializeParameter\CSharpInitializeMemberFromParameterCodeRefactoringProvider.cs (2)
131var left = (ArgumentSyntax)generator.Argument(generator.MemberAccessExpression(generator.ThisExpression(), generator.IdentifierName(fieldOrProperty.Name))); 132var right = (ArgumentSyntax)generator.Argument(generator.IdentifierName(parameter.Name));
InlineHints\CSharpInlineTypeHintsService.cs (1)
141return type is not null or IErrorTypeSymbol && type.Name != "var";
IntroduceVariable\CSharpIntroduceLocalForExpressionCodeRefactoringProvider.cs (3)
106var name = field.Name.ToCamelCase(); 107if (field.Name == tupleUnderlyingType.TupleElements[index].Name)
J\s\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs\Helpers.cs (5)
116(parameter.Name == "start" || parameter.Name == "startIndex"); 120(parameter.Name == "count" || parameter.Name == "length"); 145: method.ContainingType.GetMembers(method.Name)
LanguageServices\CSharpStructuralTypeDisplayService.cs (1)
54members.Add(new SymbolDisplayPart(SymbolDisplayPartKind.PropertyName, property, property.Name));
MakeLocalFunctionStaticCodeFixHelper.cs (6)
107seenNamedArgument || seenDefaultArgumentValue ? symbolAndCapture.symbol.Name : null, 109symbolAndCapture.capture.Name.ToIdentifierName())); 124if (parameter.Name == capture.Name) 143(node, generator) => IdentifierName(parameter.Name.ToIdentifierToken()).WithTriviaFrom(node)); 226name: capture.Name.ToCamelCase()), capture);
NavigationBar\CSharpNavigationBarItemService.cs (2)
102type.Name, 194member.Name,
SignatureHelp\AbstractCSharpSignatureHelpProvider.cs (1)
66parameter.Name,
SignatureHelp\AbstractCSharpSignatureHelpProvider.LightweightOverloadResolution.cs (1)
216var namedParameterIndex = parameters.IndexOf(p => p.Name == name);
SignatureHelp\AttributeSignatureHelpProvider.cs (3)
138.OrderBy(s => s.Name) 182namedParameter, namedParameter.Name.ToIdentifierToken().ToString())); 189namedParameter.Name,
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (2)
267if (indexer.Name != WellKnownMemberNames.Indexer) 270result.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)
89parameter.Name,
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (2)
61semanticModel.LookupSymbols(throughExpression.SpanStart, name: throughSymbol?.Name).Any(static s => s is not INamedTypeSymbol) || 66semanticModel.LookupNamespacesAndTypes(throughExpression.SpanStart, name: throughSymbol?.Name).Any(static (t, throughType) => Equals(t.GetSymbolType(), throughType), throughType));
SignatureHelp\TupleConstructionSignatureHelpProvider.cs (1)
187var elementName = element.IsImplicitlyDeclared ? string.Empty : element.Name;
Snippets\CSharpForEachLoopSnippetProvider.cs (1)
48: SyntaxFactory.IdentifierName(enumerationSymbol.Name);
UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
93return returnType.Name != nameof(Task);
UseNamedArguments\CSharpUseNamedArgumentsCodeRefactoringProvider.cs (3)
44if (argType?.ContainingNamespace is { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true } && 45(argType.Name == "Range" || argType.Name == "Index"))
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
147.Select(s => s.Name)
UseSimpleUsingStatementDiagnosticAnalyzer.cs (2)
133var symbolNameToExistingSymbol = semanticModel.GetExistingSymbols(parentBlock, cancellationToken).ToLookup(s => s.Name); 152=> locals.Any(static (local, symbolNameToExistingSymbol) => symbolNameToExistingSymbol[local.Name].Any(otherLocal => !local.Equals(otherLocal)), symbolNameToExistingSymbol);
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)
154var missingB = m.ReferencedAssemblySymbols.Single(a => a.Name == "libA").Modules.Single().ReferencedAssemblySymbols.Single(a => a.Name == "libB");
InteractiveSessionTests.cs (1)
1191Assert.True(import.NamespaceOrType is INamespaceSymbol { Name: "System", ContainingNamespace.IsGlobalNamespace: true });
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (212)
Semantics\ArglistTests.cs (1)
965Assert.Equal("TypedReference", info.Symbol.Name);
Semantics\BindingTests.cs (6)
3366Assert.False(symbols.Where(s => s.Name == "MathMin").Any()); 3367Assert.True(symbols.Where(s => s.Name == "MathMax").Any()); 3368Assert.True(symbols.Where(s => s.Name == "F1").Any()); 3369Assert.False(symbols.Where(s => s.Name == "F2").Any()); 3370Assert.False(symbols.Where(s => s.Name == "MathMax2").Any()); 3371Assert.False(symbols.Where(s => s.Name == "MathMax3").Any());
Semantics\ColorColorTests.cs (1)
1257Assert.Equal(WellKnownMemberNames.DelegateInvokeName, parentInfo.Symbol.Name); // Succeeded even though the receiver has an error.
Semantics\DeconstructionTests.cs (2)
4177Assert.Equal("x1", x1.Name); 4182Assert.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 (3)
3156Assert.Equal("_p", symbolSpeculation.Symbol.Name); 3161Assert.Equal("Int32", typeSpeculation.Type.Name); 4759Assert.Equal(expectedAssemblyName, modifier.Modifier.ContainingAssembly.Name);
Semantics\InteractiveSemanticModelTests.cs (1)
266Assert.Equal("c", semanticInfo.Symbol.Name);
Semantics\LambdaDiscardParametersTests.cs (1)
115Assert.Equal("_", symbol1.Name);
Semantics\LambdaTests.cs (15)
2120Assert.Equal("MyArgumentType", typeInfo.Type.Name); 2167Assert.Equal("String", typeInfo.Type.Name); 2213Assert.Equal("String", typeInfo.Type.Name); 2259Assert.Equal("String", typeInfo.Type.Name); 2305Assert.Equal("String", typeInfo.Type.Name); 2335Assert.Equal("Char", typeInfo.Type.Name); 2362Assert.Equal("String", typeInfo.Type.Name); 2417Assert.Equal("String", typeInfo.Type.Name); 2463Assert.Equal("String", typeInfo.Type.Name); 2509Assert.Equal("String", typeInfo.Type.Name); 2542Assert.Equal("String", typeInfo.Type.Name); 2575Assert.Equal("String", typeInfo.Type.Name); 2612Assert.Equal("String", typeInfo.Type.Name); 7607Assert.Equal("a", a.Name); 7609Assert.Equal("b", b.Name);
Semantics\LocalFunctionTests.cs (1)
1064Assert.Equal("A", attrConstructor.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)
1121Assert.Equal("Book", bookType.Name); 1162Assert.Equal("Author", authorType.Name); 1202Assert.Equal("Book", bookResultType.Name); 1206Assert.Equal("Author", authorResultType.Name);
Semantics\NamedAndOptionalTests.cs (1)
820Assert.Equal("ss", symInfo.Symbol.Name);
Semantics\NameOfTests.cs (1)
693Assert.Equal("Goo", symbolInfo.CandidateSymbols[0].Name);
Semantics\NativeIntegerTests.cs (7)
242Assert.Equal(signed ? "IntPtr" : "UIntPtr", type.Name); 256Assert.Same(underlyingType.Name, nativeIntegerType.Name); 305AssertEx.Equal(nativeIntegerMembers.SelectAsArray(m => m.Name), nativeIntegerMemberNames); 328return !IsSkippedMethodName(method.Name); 337return property.Parameters.Length == 0 && !IsSkippedPropertyName(property.Name); 516Assert.Contains(member.Name, memberNames);
Semantics\NonTrailingNamedArgumentsTests.cs (2)
54Assert.Equal("a", firstASymbol.Symbol.Name); 66Assert.Equal("a", secondASymbol.Symbol.Name);
Semantics\NullableReferenceTypesTests.cs (10)
3328Assert.Equal("String", typeInfo.Type.Name); 153657var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 153826var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 153866var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 153907var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item"); 153942var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item"); 154076var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Get"); 154118var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 154162var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item"); 154199var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item");
Semantics\OperatorTests.cs (4)
7621symbol1.Name, symbol1.ReturnType, symbol1.Parameters[0].Type); 7654Assert.Equal(symbol1.Name, symbol1.MetadataName); 8397symbol1.Name, symbol1.ReturnType, symbol1.Parameters[0].Type, symbol1.Parameters[1].Type); 8428Assert.Equal(symbol1.Name, symbol1.MetadataName);
Semantics\OutVarTests.cs (3)
967Assert.Equal(decl.Identifier().ValueText, symbol.Name); 1141Assert.Equal(decl.Identifier().ValueText, symbol.Name); 32674Assert.Equal(decl.Identifier().ValueText, symbol.Name);
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\RecordTests.cs (1)
7661Assert.Equal("<Clone>$", clone.Name);
Semantics\ScriptSemanticsTests.cs (1)
606Assert.False(symbols.Any(s => s.Name == "Roslyn"));
Semantics\StackAllocInitializerTests.cs (7)
1039Assert.Equal("Test", obj1Value.ConvertedType.Name); 1054Assert.Equal("Span", obj3Value.Type.Name); 1055Assert.Equal("Span", obj3Value.ConvertedType.Name); 1141Assert.Equal("Span", obj1Value.Type.Name); 1142Assert.Equal("Span", obj1Value.ConvertedType.Name); 1157Assert.Equal("Span", obj3Value.Type.Name); 1158Assert.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 (41)
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); 1677Assert.Contains(getHashCode.Name, names); 1680Assert.Same(getHashCode, model1.LookupSymbols(localDecl.SpanStart, name: getHashCode.Name).Single()); 1709Assert.DoesNotContain(getHashCode.Name, names); 1714Assert.Empty(model.LookupSymbols(nameRef.SpanStart, name: getHashCode.Name)); 1723Assert.DoesNotContain(getHashCode.Name, model.LookupNames(nameRef.SpanStart)); 1739Assert.DoesNotContain(getHashCode.Name, model.LookupNames(nameRef.SpanStart)); 1850Assert.Contains(getHashCode.Name, names); 1853Assert.Same(getHashCode, model1.LookupSymbols(localDecl.SpanStart, name: getHashCode.Name).Single()); 1877Assert.DoesNotContain(getHashCode.Name, names); 1882Assert.Empty(model2.LookupSymbols(nameRef.SpanStart, name: getHashCode.Name)); 1891Assert.DoesNotContain(getHashCode.Name, model2.LookupNames(nameRef.SpanStart)); 1907Assert.DoesNotContain(getHashCode.Name, model2.LookupNames(nameRef.SpanStart)); 6029Assert.Contains(declSymbol.Name, model1.LookupNames(localRef.SpanStart)); 6031Assert.Same(declSymbol, model1.LookupSymbols(localRef.SpanStart, name: declSymbol.Name).Single()); 6224Assert.Equal("A", semanticModel.GetTypeInfo(invocation).Type.Name); 6226Assert.Equal("M", semanticModel.GetSymbolInfo(invocation).CandidateSymbols.Single().Name); 6232Assert.Equal("A", semanticModel.GetTypeInfo(invocation).Type.Name); 6233Assert.Equal("M", semanticModel.GetSymbolInfo(invocation).Symbol.Name);
Semantics\TryCatchTests.cs (1)
46Assert.Equal("e", localSymbol.Name);
Semantics\UnsafeTests.cs (10)
4439Assert.Equal("p", declaredSymbol.Name); 5023Assert.Equal("p", receiverSymbol.Name); 5090Assert.Equal("s", receiverSymbol.Name); 5334Assert.Equal("p", receiverSymbol.Name); 5346Assert.Equal("i", indexSymbol.Name); 5401Assert.Equal("f", receiverSymbol.Name); 5459Assert.Equal("f", receiverSymbol.Name); 6038summaryMethod.Name, summaryMethod.ReturnType, summaryMethod.Parameters[0].Type, summaryMethod.Parameters[1].Type); 6500summaryMethod.Name, summaryMethod.ReturnType, summaryMethod.Parameters[0].Type, summaryMethod.Parameters[1].Type); 8488Assert.Equal("count", countSymbol.Name);
Semantics\UsingStatementTests.cs (3)
66Assert.Equal("i", declaredLocal.Name); 75var lookupSymbol = model.LookupSymbols(memberAccessExpression.SpanStart, name: declaredLocal.Name).Single(); 1895var actualSymbol = model.LookupSymbols(usingStatements[index - 1].SpanStart, name: symbol.Name).Single();
Semantics\Utf8StringsLiteralsTests.cs (1)
4071method.Name, method.ReturnType, method.Parameters[0].Type, method.Parameters[1].Type);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (376)
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 (55)
156Assert.Equal("Slice", symbolInfo.Symbol.Name); 409Assert.Equal(string.Empty, symbol.Name); 430Assert.Equal(string.Empty, symbol.Name); 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);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (104)
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); 341Assert.Equal(WellKnownMemberNames.Indexer, propertySymbol.Name); 348Assert.Equal("x", paramSymbol.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); 5181Assert.Contains(symbols, s => s.Name == "Local"); 5210Assert.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 (3)
40Assert.Equal("C", semanticInfo.Type.Name); 64Assert.Equal("C", semanticInfo.Type.Name); 85Assert.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 (6)
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); 6342var accessorName = SyntaxFactory.ParseName(accessor.Name); 6357var inheritedTypeName = SyntaxFactory.ParseName(inheritedType.Name);
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (4)
1026Assert.Equal("Disposable", classDisposable.Name); 1029Assert.Equal("d", localD.Name); 1030Assert.Equal("Disposable", localD.Type.Name); 1034Assert.Equal("Dispose", methodDispose.Name);
Symbols\AnonymousTypesSemanticsTests.cs (3)
1075Assert.Equal(name, type.Name); 1935Assert.Equal(fieldName, property.Name); 1941Assert.Equal("get_" + fieldName, getter.Name);
Symbols\DestructorTests.cs (1)
402Assert.Equal(WellKnownMemberNames.DestructorName, destructor.Name);
Symbols\ExtensionMethodTests.cs (5)
3161Assert.Equal("InstanceMethod", firstInvocationSymbol.Name); 3167Assert.Equal("ExtensionMethod", secondInvocationSymbol.Name); 3790var symbols = model.LookupSymbols(member.Expression.EndPosition, type, includeReducedExtensionMethods: true).Select(s => s.Name).ToArray(); 3925Assert.Empty(model.LookupSymbols(instance.Position, baseClass, includeReducedExtensionMethods: true).Where(s => s.Name == "SetMembers")); 4020Assert.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)
2846Assert.Equal(WellKnownMemberNames.Indexer, idxSymbol2.Symbol.Name);
Symbols\Source\DeclaringSyntaxNodeTests.cs (2)
144Assert.Equal(name, sym.Name); 360var members = symbol.GetMembers(member.Name);
Symbols\Source\ExternAliasTests.cs (2)
489Assert.Equal("A", externAliasSymbol.Name); 495Assert.Equal("C", usingAliasSymbol.Name);
Symbols\Source\NullablePublicAPITests.cs (13)
286return c.GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("M")).ToArray(); 478var members = c.GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("M")).ToArray(); 486members = e.GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("M")).Select(m => m.ReduceExtensionMethod(m.Parameters[0].Type)).ToArray(); 691comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("I")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 755comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("I")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 820comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("I")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 887comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("IB")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 1177context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_descriptor2, declarator.GetLocation(), declaredSymbol.Name, declaredSymbol.NullableAnnotation)); 2637Assert.Equal("s", symbol.Name); 4125var o2Result = lookupResults.OfType<ILocalSymbol>().First(l => l.Name == "o2"); 4126var o8Result = lookupResults.OfType<ILocalSymbol>().First(l => l.Name == "o8"); 4130var o1Result = lookupResults.OfType<IParameterSymbol>().First(p => p.Name == "o1"); 4131var oResult = lookupResults.OfType<IParameterSymbol>().First(p => p.Name == "o");
Symbols\Source\UsingAliasTests.cs (1)
524Assert.Equal("for", alias.Name);
Symbols\TypeTests.cs (1)
1678var 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 (1)
CompilationTestUtils.cs (1)
350return symbols.Select(s => s.Name).Distinct().ToList();
Microsoft.CodeAnalysis.CSharp.Workspaces (97)
ArgumentSyntaxExtensions.cs (1)
67var parameter = parameters.FirstOrDefault(p => p.Name == name);
AttributeArgumentSyntaxExtensions.cs (1)
51var parameter = parameters.FirstOrDefault(p => p.Name == name);
AttributeGenerator.cs (2)
28attributes.OrderBy(a => a.AttributeClass?.Name) 40attributes.OrderBy(a => a.AttributeClass?.Name)
CastSimplifier.cs (2)
1289if (originalParameter.Name != rewrittenParameter.Name &&
Classification\SyntaxClassification\NameSyntaxClassifier.cs (5)
166if (alias == null || alias.Name != "var") 180symbol is IParameterSymbol { ContainingSymbol: IMethodSymbol { Name: WellKnownMemberNames.TopLevelStatementsEntryPointMethodName } }) 199if (alias == null || alias.Name != nameToCheck) 244if (parameterSymbol.IsImplicitlyDeclared && parameterSymbol.Name == "value") 383if (symbol is null || symbol.Name != name)
CodeGeneration\CSharpSyntaxGenerator.cs (2)
349=> SyntaxFactory.DestructorDeclaration(destructorMethod.ContainingType.Name).WithBody(SyntaxFactory.Block()); 1755SyntaxFactory.Identifier(typeParameter.Name));
ConversionExtensions.cs (1)
20conversion.MethodSymbol.Name == "op_Implicit";
CSharpTypeInferenceService.TypeInferrer.cs (6)
38(otherSideType.Name == string.Empty || otherSideType.Name == "var"); 776.Where(p => p.Name == name) 1680.Where(p => p.Name == memberDeclarator.NameEquals.Name.Identifier.ValueText) 2257return types.Where(t => t.InferredType.Name == "var"); 2273if (descendant.Identifier.ValueText != symbol.Name)
Editing\CSharpImportAdder.cs (4)
133_importedTypes.Add((type.Name, type.Arity), ns); 140_importedExtensionMethods.Add(method.Name, ns); 204_conflictNamespaces.AddRange(_importedTypes[(symbol.Name, node.Arity)]); 231_conflictNamespaces.AddRange(_importedExtensionMethods[method.Name]);
EnumMemberGenerator.cs (1)
64var member = SyntaxFactory.EnumMemberDeclaration(enumMember.Name.ToIdentifierToken())
EventGenerator.cs (2)
121SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(@event.Name.ToIdentifierToken())))))); 134identifier: @event.Name.ToIdentifierToken(),
FieldGenerator.cs (1)
103AddAnnotationsTo(field, SyntaxFactory.VariableDeclarator(field.Name.ToIdentifierToken(), null, initializer)))));
ILocalSymbolExtensions.cs (2)
21HasTypeParameterWithName(localFunctionOrMethodDeclaration, localSymbol.Type.Name) && 22HasTypeParameterWithName(localFunctionStatement, localSymbol.Type.Name))
ITypeParameterSymbolExtensions.cs (1)
81typeParameter.Name.ToIdentifierName(),
ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (1)
84var syntax = AddInformationTo(symbol.Name.ToIdentifierName(), symbol);
ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (9)
48=> AddInformationTo(symbol.Name.ToIdentifierName(), symbol); 144? null : symbol.Signature.UnmanagedCallingConventionTypes.Select(type => GetConventionForString(type.Name["CallConv".Length..])), 183if (symbol.Name == string.Empty || symbol.IsAnonymousType) 190if (symbol.TypeKind == TypeKind.Error && symbol.Name == "var") 195return symbol.Name.ToIdentifierName(); 203symbol.Name.ToIdentifierToken(), 251var name = element.IsImplicitlyDeclared ? default : SyntaxFactory.Identifier(element.Name); 315var syntax = AddInformationTo(symbol.Name.ToIdentifierName(), symbol); 357TypeSyntax typeSyntax = AddInformationTo(symbol.Name.ToIdentifierName(), symbol);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\TypeSyntaxExtensions.cs\TypeSyntaxExtensions.cs (1)
44if (type.Name == "var")
MethodGenerator.cs (3)
125identifier: method.Name.ToIdentifierToken(), 144identifier: method.Name.ToIdentifierToken(), 239typeParameter.Name.ToIdentifierName(),
NamedTypeGenerator.cs (6)
119members = members.WhereAsArray(m => m is not IPropertySymbol and not IFieldSymbol || !primaryConstructor.Parameters.Any(static (p, m) => p.Name == m.Name, m)); 200SyntaxFactory.Token(SyntaxKind.RecordKeyword), classOrStructKeyword, namedType.Name.ToIdentifierToken(), 209typeDeclaration = SyntaxFactory.TypeDeclaration(kind, namedType.Name.ToIdentifierToken()); 234namedType.Name.ToIdentifierToken(), 252namedType.Name.ToIdentifierToken(),
NamespaceGenerator.cs (1)
157SyntaxFactory.NameEquals(alias.Name.ToIdentifierName()),
OperatorGenerator.cs (1)
81throw new ArgumentException(string.Format(WorkspaceExtensionsResources.Cannot_generate_code_for_unsupported_operator_0, method.Name), nameof(method));
ParameterGenerator.cs (1)
67return SyntaxFactory.Parameter(parameter.Name.ToIdentifierToken())
ParenthesizedExpressionSyntaxExtensions.cs (2)
78Name: nameof(Span<int>) or nameof(ReadOnlySpan<int>), 79ContainingNamespace: { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true }
PropertyGenerator.cs (1)
124identifier: property.Name.ToIdentifierToken(),
Recommendations\CSharpRecommendationServiceRunner.cs (1)
291symbols = symbols.WhereAsArray(s => s.ContainingSymbol.Name != WellKnownMemberNames.TopLevelStatementsEntryPointMethodName);
Recommendations\CSharpRecommendationServiceRunner_Operators.cs (2)
38if (method.Name is WellKnownMemberNames.TrueOperatorName or WellKnownMemberNames.FalseOperatorName) 64switch (symbol.Name)
Rename\CSharpRenameRewriterLanguageService.cs (22)
581if (oldIdentifier != _renamedSymbol.Name) 769.Where(s => s.MatchesKind(SymbolKind.Local, SymbolKind.Parameter) && s.Name == token.ValueText); 806AddSymbolSourceSpans(conflicts, namedType.GetMembers(renamedSymbol.Name), reverseMappedLocations); 811containingNamedType.Name == renamedSymbol.Name) 917if (renamedSymbol.ContainingType != null && renamedSymbol.ContainingType.GetMembers(renamedSymbol.Name).Contains(renamedSymbol)) 920.Where(t => t.Name == renamedSymbol.Name) 991string.Compare(renameSymbol.Name, "Current", StringComparison.OrdinalIgnoreCase) == 0; 996(string.Compare(renameSymbol.Name, WellKnownMemberNames.MoveNextMethodName, StringComparison.OrdinalIgnoreCase) == 0 || 997string.Compare(renameSymbol.Name, WellKnownMemberNames.GetEnumeratorMethodName, StringComparison.OrdinalIgnoreCase) == 0 || 998string.Compare(renameSymbol.Name, WellKnownMemberNames.GetAwaiter, StringComparison.OrdinalIgnoreCase) == 0 || 999string.Compare(renameSymbol.Name, WellKnownMemberNames.DeconstructMethodName, StringComparison.OrdinalIgnoreCase) == 0)); 1005if (renamedSymbol.Name != renameSymbol.Name) 1040if ((renamedSymbol.Name == "MoveNext" || renamedSymbol.Name == "GetEnumerator" || renamedSymbol.Name == "Current") && renamedSymbol.GetAllTypeArguments().Length == 0) 1050renamedSymbol.Name) 1064if (symbol.Name == "MoveNext") 1071else if (symbol.Name == "GetEnumerator") 1082else if (symbol.Kind == SymbolKind.Property && symbol.Name == "Current")
SemanticModelExtensions.cs (2)
442if (SyntaxFacts.GetContextualKeywordKind(parameter.Name) is not SyntaxKind.UnderscoreToken) 444return parameter.Name;
Simplification\CSharpSimplificationService.Expander.cs (2)
540var aliasAnnotationInfo = AliasAnnotation.Create(aliasInfo.Name); 590var name = symbol.Name;
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (1)
265var aliasName = aliasReplacement.Name;
Simplification\Simplifiers\ExpressionSimplifier.cs (2)
146var text = aliasReplacement.Name; 160aliasReplacement.Name,
Simplification\Simplifiers\NameSimplifier.cs (2)
119var text = aliasReplacement.Name; 132aliasReplacement.Name,
TypeParameterGenerator.cs (1)
34symbol.Name.ToIdentifierToken());
TypeStyleHelper.cs (5)
163? returnType.GetTypeArguments().First().Name 164: returnType.Name; 166return methodSymbol.Name.Equals("To" + returnTypeName, StringComparison.Ordinal); 184return UnwrapTupleType(containingType).Name.Equals(returnType.Name);
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)
977m.Name == WellKnownMemberNames.ExplicitConversionName && m.Parameters[0].Type.Equals(gcHandleType)); 985m.Name == WellKnownMemberNames.ImplicitConversionName && m.Parameters[0].Type.Equals(_emptyCompilation.GetSpecialType(SpecialType.System_Byte)));
Microsoft.CodeAnalysis.EditorFeatures (4)
InlineRename\AbstractEditorInlineRenameService.SymbolRenameInfo.cs (4)
91var searchName = this.RenameSymbol.Name; 96searchName = _info.GetWithoutAttributeSuffix(this.RenameSymbol.Name); 131public string DisplayName => RenameSymbol.Name; 173if (symbolSourceDocument != null && WorkspacePathUtilities.TypeNameMatchesDocumentName(symbolSourceDocument, RenameSymbol.Name))
Microsoft.CodeAnalysis.EditorFeatures.Cocoa (6)
NavigationCommandHandlers\FindMemberOverloadsCommandHandler.cs (2)
84.Where(m => m.Kind == symbol.Kind && m.Name == symbol.Name))
NavigationCommandHandlers\FindReferencesOfOverloadsCommandHandler.cs (2)
114.Where(m => m.Kind == symbol.Kind && m.Name == symbol.Name))
Snippets\SnippetFunctions\AbstractSnippetFunctionGenerateSwitchCases.cs (2)
55enumFields.First().Name, 65casesBuilder.AppendFormat(CaseFormat, simplifiedTypeName, member.Name);
Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities (1)
CodeActions\AbstractCodeActionTest.cs (1)
233: MemberNames.SelectAsArray(n => members.Single(m => m.Name == n)),
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (6)
ExtractInterface\AbstractExtractInterfaceTests.cs (1)
115Assert.Equal(expectedMemberName, testState.TestExtractInterfaceOptionsService.AllExtractableMembers.Single().Name);
MoveStaticMembers\TestMoveStaticMembersService.cs (2)
42var actualPrecheckedMembers = selectedNodeSymbols.SelectAsArray(n => n.Name).Sort(); 52var selectedMembers = selectedType.GetMembers().WhereAsArray(symbol => SelectedMembers.Contains(symbol.Name));
PullMemberUp\TestPullMemberUpService.cs (3)
36: _selectedMembers.Select(selection => (members.Single(symbol => symbol.Name == selection.member), selection.makeAbstract)); 55destination = allInterfaces.SingleOrDefault(@interface => @interface.Name == DestinationName); 62if (i.Name == DestinationName)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (13)
CodeGeneration\CodeGenerationTests.cs (1)
265var expectedMessage = string.Format(WorkspaceExtensionsResources.Cannot_generate_code_for_unsupported_operator_0, method.Name);
SymbolFinder\DependentTypeFinderTests.cs (8)
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), 653Assert.Equal("Derived", results[0].Name); 706Assert.True(typesThatDerive.Any(t => t.Name == "T_DependProject_Class")); 713Assert.True(typesThatDerive.Any(t => t.Name == "T_DependProject_Class")); 720Assert.True(typesThatDerive.Any(t => t.Name == "T_DependProject_Class"));
Utilities\SymbolEquivalenceComparerTests.cs (4)
1589var namespace1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetNamespaceMembers().Single(n => n.Name == "N").GetNamespaceMembers().Single(n => n.Name == "M"); 1590var namespace2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetNamespaceMembers().Single(n => n.Name == "N").GetNamespaceMembers().Single(n => n.Name == "M");
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (9)
Diagnostics\DiagnosticServiceTests.vb (1)
1818_symbolNames.Add(context.Symbol.Name)
FindReferences\FindReferencesTests.LinkedFiles.vb (8)
44AssertEx.SetEqual(references.Select(Function(r) r.Definition.ContainingAssembly.Name), {"CSProj1", "CSProj2"}) 78AssertEx.SetEqual(references.Select(Function(r) r.Definition.ContainingAssembly.Name), {"VBProj1", "VBProj2"}) 120AssertEx.SetEqual(references.Select(Function(r) r.Definition.ContainingAssembly.Name), {"VBProj1", "VBProj2"}) 133AssertEx.SetEqual(references.Select(Function(r) r.Definition.ContainingAssembly.Name), {"VBProj1"}) 311AssertEx.SetEqual(sourceReferences.Select(Function(r) r.Definition.ContainingAssembly.Name), {"CSProj1", "CSProj2"}) 354AssertEx.SetEqual(sourceReferences.Select(Function(r) r.Definition.ContainingAssembly.Name), {"CSProj1", "CSProj2"}) 397AssertEx.SetEqual(sourceReferences.Select(Function(r) r.Definition.ContainingAssembly.Name), {"CSProj1", "CSProj2"}) 440AssertEx.SetEqual(sourceReferences.Select(Function(r) r.Definition.ContainingAssembly.Name), {"CSProj1", "CSProj2"})
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
InstructionDecoder.cs (1)
92builder.Append(parameter.Name);
Microsoft.CodeAnalysis.Features (391)
AbstractAddExplicitCastCodeFixProvider.cs (1)
183if (argumentName.Equals(parameters[j].Name))
AbstractAddParameterCodeFixProvider.cs (1)
437methodParameterNames.AddRange(method.Parameters.Select(p => p.Name));
AbstractAliasAmbiguousTypeCodeFixProvider.cs (3)
56var typeName = symbol.Name; 116if (string.IsNullOrEmpty(current.Name)) 119result.Add(current.Name);
AbstractConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
68var parentProperty = operationParent.Property.Name;
AbstractForEachCastDiagnosticAnalyzer.cs (1)
97if (conversion.IsUserDefined && conversion.MethodSymbol is { Name: WellKnownMemberNames.ImplicitConversionName })
AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
86symbol.Name,
AbstractMakeMethodAsynchronousCodeFixProvider.cs (5)
63var isEntryPoint = methodSymbol.IsStatic && IsLikelyEntryPointName(methodSymbol.Name, document); 132if (methodSymbol.Name.EndsWith(AsyncSuffix)) 162var name = methodSymbol.Name; 225return returnType.Name.Equals("Task") || 226returnType.Name.Equals("ValueTask");
AbstractMakeMethodSynchronousCodeFixProvider.cs (3)
62methodSymbol.Name.Length > AsyncSuffix.Length && 63methodSymbol.Name.EndsWith(AsyncSuffix)) 75var name = methodSymbol.Name;
AbstractPopulateSwitchCodeFixProvider.cs (1)
181let caseLabel = (TMemberAccessExpression)generator.MemberAccessExpression(generator.TypeExpression(enumType), e.Name).WithAdditionalAnnotations(Simplifier.Annotation)
AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
827attribute.AttributeConstructor?.Parameters is [_, { Name: "checkId", Type.SpecialType: SpecialType.System_String }, ..] && 835if (attribute.AttributeConstructor.Parameters[0].Name == "category" &&
AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (3)
450if (debuggerDisplayAttributeArguments.Any(arg => arg.Contains(member.Name))) 734if (methodSymbol.Name.StartsWith(prefix)) 736var suffix = methodSymbol.Name[prefix.Length..];
AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
541symbol.Name);
AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (2)
149parameter.Name, 213parameter.Name == DiscardVariableName ||
AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
574var declarationStatement = CreateLocalDeclarationStatement(declaredLocal.Type, declaredLocal.Name);
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;
AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
101if (s_nonEnumerableReturningLinqMethodNames.Contains(method.Name) &&
AbstractUnsealClassCodeFixProvider.cs (1)
46var title = string.Format(TitleFormat, type.Name);
AbstractUseAutoPropertyAnalyzer.cs (1)
113fieldNames.Add(field.Name);
AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
178syntaxFacts.GetIdentifierOfIdentifierName(identifier).ValueText == localSymbol.Name)
AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
248if (p.Name == searchArgumentName)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (3)
82var memberName = constructorCandidate.MissingMembers[i].Name; 83var parameterName = _missingParameters[i].Name; 97var signature = $"{_containingType.Name}({parameterString})";
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.cs (1)
156name: p.Name,
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.State.cs (4)
89constructor, document, parametersForSelectedMembers.SelectAsArray(p => p.Name), cancellationToken).ConfigureAwait(false)) 120!parameterNamesForSelectedMembers.Except(constructorParams.Select(p => p.Name)).Any(); 127var constructorParamNames = constructor.Parameters.SelectAsArray(p => p.Name); 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\SearchScopes\SearchScope.cs (4)
57SymbolResult.Create(s.Name, nameNode, s, weight: s.Name == name ? 0 : 1)); 67var areSimilar = similarityChecker.AreSimilar(s.Name, out var matchCost); 70return SymbolResult.Create(s.Name, nameNode, s, matchCost);
AddImport\SymbolReferenceFinder.cs (3)
321Equals(propertyType.Name, symbol.Name)) 325symbol.Name, simpleName, SymbolFilter.Type).ConfigureAwait(false);
AddImport\SymbolReferenceFinder_PackageAssemblySearch.cs (1)
149if (assemblySymbol?.Name == result.AssemblyName)
AddParameterService.cs (1)
166var uniqueName = NameGenerator.EnsureUniqueness(argumentNameSuggestion, method.Parameters.Select(p => p.Name));
ChangeSignature\AbstractChangeSignatureService.cs (9)
118if (method.Name == WellKnownMemberNames.DelegateBeginInvokeName && 318if (methodSymbol.Name == WellKnownMemberNames.DelegateBeginInvokeName && 519newArguments.Add(argument.WithName(param.Name).WithAdditionalAnnotations(Formatter.Annotation)); 542newArguments.Add(paramsArrayArgument.WithName(param.Name).WithAdditionalAnnotations(Formatter.Annotation)); 610var match = originalParameters.FirstOrDefault(p => p.Name == name); 841newArgument = AddNameToArgument(newArgument, parameters[indexInListOfPreexistingArguments].Name); 847newArgument = AddNameToArgument(newArgument, parameters[indexInListOfPreexistingArguments].Name); 874newArgument = AddNameToArgument(newArgument, parameters[indexInListOfPreexistingArguments].Name); 954return Generator.IdentifierName(symbol.Name);
ChangeSignature\Parameter.cs (1)
29public override string Name => Symbol.Name;
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (2)
196var typeName = semanticModel.GetDeclaredSymbol(typeDeclaration, cancellationToken).Name; 262.Select(n => semanticModel.GetDeclaredSymbol(n, cancellationToken).Name)
CodeRefactorings\MoveType\AbstractMoveTypeService.State.cs (2)
66typeSymbol.Name == string.Empty) 72TypeName = typeSymbol.Name;
Completion\CommonCompletionUtilities.cs (1)
244if (!symbol.Name.TryGetWithoutAttributeSuffix(syntaxFacts.IsCaseSensitive, out name) ||
Completion\Providers\AbstractContextVariableArgumentProvider.cs (11)
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\AbstractCrefCompletionProvider.cs (1)
40var bestSymbols = symbols.WhereAsArray(s => s.Kind == kind && s.Name == name);
Completion\Providers\AbstractDocCommentCompletionProvider.cs (6)
158var names = GetParameters(symbol).Select(p => p.Name); 168var names = symbol.GetAllTypeParameters().Select(t => t.Name); 183.Select(parameter => CreateCompletionItem(parameter.Name)); 188.Select(typeParameter => CreateCompletionItem(typeParameter.Name)); 193.Select(typeParameter => CreateCompletionItem(typeParameter.Name)); 258var names = symbols.Select(p => p.Name).ToSet();
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (2)
63var uninitializedMembers = members.Where(m => !alreadyTypedMembers.Contains(m.Name)); 67.OrderBy(m => m.Name);
Completion\Providers\AbstractOverrideCompletionProvider.cs (1)
50methodSymbol.Name == "ToString" &&
Completion\Providers\AbstractPartialMethodCompletionProvider.cs (2)
76name: member.Name, 78parameters: method.Parameters.SelectAsArray(p => CodeGenerationSymbolFactory.CreateParameterSymbol(p.GetAttributes(), p.RefKind, p.IsParams, p.Type, p.Name)),
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (1)
241return kind != null && info.Symbol.Kind == kind && info.Symbol.Name == name && isGeneric == info.Symbol.GetArity() > 0;
Completion\Providers\AbstractSymbolCompletionProvider.cs (3)
213return displayText == symbol.Name || displayText is ['@', ..] || (context.IsAttributeNameContext && symbol.IsAttribute()) 215: symbol.Name; 299foreach (var symbol in symbols.GroupBy(s => new { s.Symbol.Name, s.Symbol.Kind }).Select(g => g.First()))
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionProvider.cs (1)
109var 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 (4)
156var overloadKey = (containingNamespacename, symbol.Name, isGeneric: symbol.Arity > 0); 194bestSymbol.Name, 231return symbol.Name; 239name = GetFullyQualifiedNamespaceName(symbol.ContainingNamespace, stringCache) + "." + symbol.Name;
Completion\Providers\ImportCompletionProvider\TypeImportCompletionCacheEntry.cs (2)
182var isAttribute = symbol.Name.HasAttributeSuffix(isCaseSensitive: false) && symbol.IsAttribute(); 185symbol.Name,
Completion\Providers\SymbolCompletionItem.cs (3)
61filterText: filterText ?? (displayText is ['@', ..] ? displayText : firstSymbol.Name), 62sortText: sortText ?? firstSymbol.Name, 82.AddProperty("SymbolName", symbol.Name);
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (9)
229var className = classSymbol.Name; 237classSymbol.TypeParameters.Select(tp => g.IdentifierName(tp.Name))); 272properties.SelectAsArray(prop => CodeGenerationSymbolFactory.CreateParameterSymbol(prop.Type, prop.Name)), 337if (originalProperty.Name != newProperty.Name) 338builder[originalProperty] = newProperty.Name; 360GetLegalName(prop.Name.ToPascalCase(trimLeadingTypePrefix: false), document), 388prop.Type, prop.Name.ToCamelCase(trimLeadingTypePrefix: false)); 390parameterToPropMap[parameter.Name] = prop;
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (1)
235return methods.Where(m => m.Name == memberName);
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 (12)
407: (TNameSyntax)generator.GenericName(structNameToken, typeParameters.Select(tp => generator.IdentifierName(tp.Name))); 458var tupleFieldNames = tupleType.TupleElements.SelectAsArray<IFieldSymbol, string>(f => f.Name); 473var tupleFieldNames = tupleType.TupleElements.SelectAsArray<IFieldSymbol, string>(f => f.Name); 672if (!comparer.Equals(fields1[i].Name, fields2[i].Name)) 852generator.IdentifierName(constructor.Parameters[index].Name), 855field.Name)))).ToImmutableArray(); 867CodeGenerationSymbolFactory.CreateParameterSymbol(RefKind.Out, p.Type, p.Name)), 880generator.MemberAccessExpression(valueNode, field.Name))); 923var parameterName = isRecord ? field.Name : parameterNamingRule.NamingStyle.MakeCompliant(field.Name).First(); 927parameterToPropMap[parameter.Name] = field;
Debugging\AbstractBreakpointResolver.cs (2)
164return comparer.Equals(namespaceSymbol.Name, nameAndArity.Name) && nameAndArity.Arity == 0; 166return comparer.Equals(typeSymbol.Name, nameAndArity.Name) &&
DesignerAttribute\DesignerAttributeDiscoveryService.cs (3)
271Name: nameof(DesignerCategoryAttribute), 272ContainingNamespace.Name: nameof(System.ComponentModel), 273ContainingNamespace.ContainingNamespace.Name: nameof(System),
DocumentationComments\AbstractDocumentationCommentFormattingService.cs (1)
533var typeParameterIndex = typeResolutionSymbol.OriginalDefinition.GetAllTypeParameters().IndexOf(tp => tp.Name == crefValue);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (35)
2335=> oldParameters.SequenceEqual(newParameters, exact, (oldParameter, newParameter, exact) => oldParameter.Name == newParameter.Name && TypeParameterConstraintsEquivalent(oldParameter, newParameter, exact)); 2567if (oldType.Name != newType.Name) 3129var createDeleteAndInsertEdits = oldSymbol.Name != newSymbol.Name; 3153renamedParameter ??= oldMethod.Parameters[i].Name != newMethod.Parameters[i].Name ? newMethod.Parameters[i] : null; 3583var key = (oldType.Name, oldType.Arity); 3617if (deletedTypes.TryGetValue((newType.Name, newType.Arity), out var deletedTypeIndices) && deletedTypeIndices.Count > 0) 3647if (attributeData.AttributeClass is { Name: CreateNewOnMetadataUpdateAttributeName, ContainingNamespace: { Name: "CompilerServices", ContainingNamespace: { Name: "Runtime", ContainingNamespace.Name: "System" } } }) 3710else if (oldSymbol.Name != newSymbol.Name) 3950if (!hasParameterTypeChange && oldParameter.Name != newParameter.Name) 4383attributeData.AttributeClass!.Name, 4983oldCtor.GetParameters().First().Name != newCtor.GetParameters().First().Name && 5265var arguments = new[] { newCapture.Name, GetDisplayName(GetLambda(newLambdaBody)) }; 5469new[] { GetDisplayName(GetLambda(lambdaBody)), captures[firstAccessedCaptureIndex].Name, captures[i].Name })); 5643new[] { newCapture.Name })); 5665new[] { newCapture.Name })); 5708if (newCapture.Name != oldCapture.Name) 5714new[] { oldCapture.Name, newCapture.Name })); 5730new[] { newCapture.Name, oldTypeOpt.ToDisplayString(ErrorDisplayFormat) })); 5745new[] { newCapture.Name })); 5795new[] { oldCapture.Name })); 5808var name = oldCaptures[oldCaptureIndex].Name; 6053=> symbol is IMethodSymbol { Name: WellKnownMemberNames.TopLevelStatementsEntryPointMethodName };
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (2)
192return parameters.Any(static (p, argName) => p.Name == argName, argName); 195return parameter?.Name == FormatName;
EmbeddedLanguages\EmbeddedLanguageDetector.cs (6)
157Name: nameof(IFormattable), 160Name: nameof(System), 340Name: "StringSyntaxAttribute", 343Name: nameof(CodeAnalysis), 346Name: nameof(Diagnostics), 349Name: nameof(System),
EmbeddedLanguages\Json\LanguageServices\JsonLanguageDetector.cs (3)
156options = symbol.ContainingType.Name == nameof(JsonDocument) ? JsonOptions.Strict : default; 174if (exprType.Name != nameof(JsonDocumentOptions)) 216return parameter?.Name == JsonParameterName;
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (4)
87where method.Parameters.Any(static p => p.Name == _patternName) 88select method.Name); 196if (parameter?.Name != _patternName) 208if (exprType.Name == nameof(RegexOptions))
EncapsulateField\AbstractEncapsulateFieldService.cs (5)
94string.Format(FeaturesResources.Encapsulate_field_colon_0_and_use_property, field.Name), 96nameof(FeaturesResources.Encapsulate_field_colon_0_and_use_property) + "_" + field.Name), 98string.Format(FeaturesResources.Encapsulate_field_colon_0_but_still_use_field, field.Name), 100nameof(FeaturesResources.Encapsulate_field_colon_0_but_still_use_field) + "_" + field.Name)); 270if (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 (7)
271var conflictingTypeNames = type.ContainingNamespace.GetAllTypes(cancellationToken).Select(t => t.Name); 272var candidateInterfaceName = type.TypeKind == TypeKind.Interface ? type.Name : "I" + type.Name; 396name: @event.Name)); 407name: method.Name, 421name: property.Name, 440m.Name == "<Clone>$") // TODO: Use WellKnownMemberNames.CloneMethodName when it's public.
ExtractMethod\MethodExtractor.Analyzer.cs (3)
307string.Join(", ", failedVariables.Select(v => v.Name)))); 492if (symbol.Name.IsEmpty()) 931names.Add(field.Name ?? string.Empty);
ExtractMethod\MethodExtractor.CodeGenerator.cs (1)
338parameter.GetAttributes(), parameter.Variance, parameter.Name, ImmutableArray.Create<ITypeSymbol>(), parameter.NullableAnnotation,
FindUsages\DefinitionItem.cs (1)
262var containingTypeName = MetadataAsSourceHelpers.GetTopLevelContainingNamedType(symbol).Name;
FindUsages\FindUsagesHelpers.cs (2)
19=> symbol.IsConstructor() ? symbol.ContainingType.Name : symbol.Name;
FullyQualify\AbstractFullyQualifyService.cs (1)
205memberName = member != null ? member.Name : name;
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (1)
169compareMethod.Name != nameof(IComparable.CompareTo);
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.ConstructorDelegatingCodeAction.cs (3)
69var symbolName = _state.SelectedMembers[i].Name; 105typeName: _state.ContainingType.Name, 122_state.ContainingType.Name, parameterString);
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.FieldDelegatingCodeAction.cs (4)
50parameterToExistingFieldMap[_state.Parameters[i].Name] = _state.SelectedMembers[i]; 60_state.ContainingType.Name, 103_state.ContainingType.Name, parameterString); 108_state.ContainingType.Name, parameterString);
GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.AbstractCodeAction.cs (1)
75typeName: classType.Name,
GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.CodeAction.cs (2)
27var parameters = constructor.Parameters.Select(p => p.Name); 32state.ClassType.Name, parameterString);
GenerateMember\AbstractGenerateMemberService.cs (2)
194isColorColorCase = typeInfo.Type != null && semanticInfo.Symbol != null && semanticInfo.Symbol.Name == typeInfo.Type.Name;
GenerateMember\GenerateConstructor\AbstractGenerateConstructorService.cs (6)
96string.Format(FeaturesResources.Generate_constructor_in_0_with_fields, state.TypeToGenerateIn.Name), 98nameof(FeaturesResources.Generate_constructor_in_0_with_fields) + "_" + state.TypeToGenerateIn.Name)); 105string.Format(FeaturesResources.Generate_constructor_in_0_with_properties, state.TypeToGenerateIn.Name), 107nameof(FeaturesResources.Generate_constructor_in_0_with_properties) + "_" + state.TypeToGenerateIn.Name)); 112string.Format(FeaturesResources.Generate_constructor_in_0, state.TypeToGenerateIn.Name), 114nameof(FeaturesResources.Generate_constructor_in_0) + "_" + state.TypeToGenerateIn.Name));
GenerateMember\GenerateConstructor\AbstractGenerateConstructorService.State.cs (10)
135var typeParametersNames = TypeToGenerateIn.GetAllTypeParameters().Select(t => t.Name).ToImmutableArray(); 166delegatedConstructor.Parameters.Select(p => p.Name).ToList(), 172if (delegatedConstructor.Parameters.Select(p => p.Name).Intersect(remainingParameterNames.Select(n => n.BestNameForParameter)).Any()) 261? ctorParameter.Name == parameterName 262: string.Equals(ctorParameter.Name, parameterName, StringComparison.OrdinalIgnoreCase); 465where m.Name.Equals(expectedFieldName, StringComparison.OrdinalIgnoreCase) 470var symbol = membersArray.FirstOrDefault(m => m.Name.Equals(expectedFieldName, StringComparison.Ordinal)) ?? membersArray.FirstOrDefault(); 528select member.Name); 594typeName: TypeToGenerateIn.Name, 656TypeToGenerateIn.Name,
GenerateMember\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (4)
172var parameterNames = delegateInvokeMethod.ContainingType is { Name: nameof(Action) or nameof(Func<int>), ContainingNamespace.Name: nameof(System) } 174: delegateInvokeMethod.Parameters.SelectAsArray(p => p.Name); 239var typeLocalName = parameter.Type.GetLocalName(fallback: parameter.Name);
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (1)
74name: typeParameter.Name,
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.MethodSignatureInfo.cs (1)
51? _methodSymbol.Parameters.SelectAsArray(p => new ParameterName(p.Name, isFixed: true))
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (2)
134method.TypeParameters.SelectAsArray(t => t.Name), 151var availableTypeParameterNames = allTypeParameters.Select(t => t.Name).ToSet();
GenerateMember\GenerateParameterizedMember\TypeParameterSubstitution.cs (1)
70if (_availableTypeParameterNames.Contains(symbol.Name))
GenerateMember\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
187return ContainingMethod is { IsImplicitlyDeclared: false, Name: not WellKnownMemberNames.TopLevelStatementsEntryPointMethodName }
GenerateType\AbstractGenerateTypeService.cs (3)
208var name = type.Name; 228: s => state.TypeToGenerateInOpt.GetAllTypeParameters().All(t => t.Name != s); 233if (typeParameters[i] == null || typeParameters[i].Name != names[i])
GenerateType\AbstractGenerateTypeService.Editor.cs (2)
607where m.Name.Equals(expectedFieldName, StringComparison.OrdinalIgnoreCase) 613var symbol = membersArray.FirstOrDefault(m => m.Name.Equals(expectedFieldName, StringComparison.Ordinal)) ?? membersArray.FirstOrDefault();
HashCodeAnalyzer.cs (1)
64if (owningSymbol is not IMethodSymbol { Name: nameof(GetHashCode) } method)
HashCodeAnalyzer.OperationDeconstructor.cs (1)
87if (targetMethod.Name == nameof(GetHashCode) &&
ImplementAbstractClass\AbstractImplementAbstractClassCodeFixProvider.cs (4)
47var id = GetCodeActionId(abstractClassType.ContainingAssembly.Name, abstractClassType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)); 58abstractClassType.ContainingAssembly.Name, 60through.Name); 64string.Format(FeaturesResources.Implement_through_0, through.Name),
ImplementAbstractClass\ImplementAbstractClassData.cs (1)
259generator.MemberAccessExpression(throughExpression, @event.Name),
ImplementInterface\AbstractImplementInterfaceService.CodeAction.cs (13)
126return string.Format(FeaturesResources.Implement_interface_through_0, ThroughMember.Name); 145var assemblyName = interfaceType.ContainingAssembly.Name; 156throughMember?.Name; 271IdentifiersMatch(State.ClassOrStructType.Name, name) || 272State.ClassOrStructType.TypeParameters.Any(static (t, arg) => arg.self.IdentifiersMatch(t.Name, arg.name), (self: this, name)); 279var memberNames = State.ClassOrStructType.GetAccessibleMembersInThisAndBaseTypes<ISymbol>(State.ClassOrStructType).Select(m => m.Name); 282string.Format("{0}_{1}", member.ContainingType.Name, member.Name), 284!implementedVisibleMembers.Any(m => IdentifiersMatch(m.Name, n)) && 288return member.Name; 317memberName = generateInvisibleMember ? member.Name : memberName; 352if (member.Name != memberName) 406var accessibility = member.Name == memberName || generateAbstractly
ImplementInterface\AbstractImplementInterfaceService.CodeAction_Conflicts.cs (3)
29var conflict2 = IsReservedName(member.Name); 48if (!IdentifiersMatch(member1.Name, member2.Name))
ImplementInterface\AbstractImplementInterfaceService.CodeAction_Property.cs (1)
55property.Parameters.SelectAsArray(p => p.Name),
ImplementInterface\AbstractImplementInterfaceService.DisposePatternCodeAction.cs (3)
257g.IdentifierName(disposedValueField.Name), g.TrueLiteralExpression())); 260g.LogicalNotExpression(g.IdentifierName(disposedValueField.Name)), 268name: disposeMethod.Name,
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (5)
302if (targetMethod?.Name is nameof(string.IsNullOrEmpty) or nameof(string.IsNullOrWhiteSpace)) 386(TExpressionSyntax)generator.CreateNullCheckExpression(semanticModel, parameter.Name), 400generator.Argument(generator.IdentifierName(parameter.Name))); 551generator.NameOfExpression(generator.IdentifierName(parameter.Name))); 570var nameofExpression = generator.NameOfExpression(generator.IdentifierName(parameter.Name));
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (7)
209string.Format(FeaturesResources.Create_and_assign_field_0, field.Name), 211nameof(FeaturesResources.Create_and_assign_field_0) + "_" + field.Name); 213string.Format(FeaturesResources.Create_and_assign_property_0, property.Name), 215nameof(FeaturesResources.Create_and_assign_property_0) + "_" + property.Name); 259var title = string.Format(resource, fieldOrProperty.Name); 551generator.IdentifierName(fieldOrProperty.Name)), 552generator.IdentifierName(parameter.Name)));
InitializeParameter\AbstractInitializeParameterCodeRefactoringProvider.cs (1)
143return parameter != null && parameter.Name != "";
InlineHints\AbstractInlineParameterNameHintsService.cs (8)
93if (string.IsNullOrEmpty(parameter?.Name)) 107var inlineHintText = GetReplacementText(parameter.Name); 111ImmutableArray.Create(new TaggedText(TextTags.Text, parameter.Name + ": ")), 168var name = parameter?.Name; 186var name = parameter?.Name; 233var methodName = method.Name; 246return SuffixMatchesParameterName(suffix, parameter.Name); 276=> syntaxFacts.StringComparer.Compare(parameter.Name, identifierArgument) == 0;
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (2)
288var name = renameTable.TryGetValue(parameterSymbol, out var newName) ? newName : parameterSymbol.Name; 378symbol.Name,
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (1)
364callerSemanticModel.GetSymbolInfo(argument.Value.Syntax, cancellationToken).GetAnySymbol()?.Name))
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (2)
439? generator.GenericName(_methodSymbol.Name, _methodSymbol.TypeArguments) 440: generator.IdentifierName(_methodSymbol.Name);
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (2)
97return (declarationSyntax, declarator.Symbol.Name); 359=> syntaxFactsService.StringComparer.Equals(localVariable.Name, identifierName) &&
IntroduceVariable\AbstractIntroduceVariableService.cs (1)
272var reservedNames = declaringType.GetMembers().Select(m => m.Name);
LanguageServiceIndexFormat\SymbolMoniker.cs (2)
64var symbolMoniker = symbol.ContainingAssembly.Name + "#"; 68symbolMoniker += GetRequiredDocumentationCommentId(symbol.ContainingSymbol) + "#" + symbol.Name;
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.cs (1)
100typeParts.Add(Part(kind, structuralType, structuralType.Name));
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (3)
551if (typeArgument is ITypeParameterSymbol && typeArgument.Name == typeParameter.Name) 775parts.AddRange(TypeParameterName(typeParameters[i].Name));
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
71public string Name => _symbol.Name;
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (2)
85useDecompiler = !symbol.ContainingAssembly.GetAttributes().Any(static attribute => attribute.AttributeClass?.Name == nameof(SuppressIldasmAttribute) 192topLevelNamedType.Name,
MetadataAsSource\MetadataAsSourceGeneratedFileInfo.cs (1)
46this.TemporaryFilePath = Path.Combine(rootPath, directoryName, topLevelNamedType.Name + extension);
MetadataAsSource\MetadataAsSourceHelpers.cs (1)
101if (attribute.AttributeClass?.Name == nameof(ReferenceAssemblyAttribute) &&
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (1)
310replacement = generator.GenericName(newType.Name, newTypeArgs);
NameTupleElement\AbstractNameTupleElementCodeRefactoringProvider.cs (1)
80return (root, argument, element.Name);
NamingStyleCodeFixProvider.cs (1)
89var fixedNames = style.MakeCompliant(symbol.Name);
NamingStyleDiagnosticAnalyzerBase.cs (4)
111if (string.IsNullOrEmpty(symbol.Name)) 148if (!cache.TryGetValue(symbol.Name, out var failureReason)) 150if (applicableRule.NamingStyle.IsNameCompliant(symbol.Name, out failureReason)) 155cache.TryAdd(symbol.Name, failureReason);
PreferFrameworkType\PreferFrameworkTypeCodeFixProvider.cs (1)
62? generator.QualifiedName(generator.GlobalAliasedName(generator.IdentifierName(nameof(System))), generator.IdentifierName(typeSymbol.Name))
PullMemberUp\MembersPuller.cs (4)
54? string.Format(FeaturesResources.Pull_0_up_to_1, selectedMembers.Single().Name, result.Destination.Name) 55: string.Format(FeaturesResources.Pull_selected_members_up_to_0, result.Destination.Name); 520return destination.GetMembers(fieldSymbol.Name).Any();
QuickInfo\QuickInfoUtilities.cs (2)
135NullableFlowState.MaybeNull => string.Format(FeaturesResources._0_may_be_null_here, symbol.Name), 136NullableFlowState.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)
256var identifier = generator.IdentifierName(symbol.Name);
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (3)
78var parameter = symbol.GetParameters().FirstOrDefault(p => syntaxFacts.StringComparer.Equals(p.Name, singleWordText)); 85var typeParameter = symbol.GetTypeParameters().FirstOrDefault(t => syntaxFacts.StringComparer.Equals(t.Name, singleWordText)); 96var childMember = namedType.GetMembers().FirstOrDefault(m => syntaxFacts.StringComparer.Equals(m.Name, singleWordText));
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (3)
90string.Format(FeaturesResources.Replace_0_and_1_with_property, methodName, setMethod.Name), 106var setMethodName = "Set" + getMethod.Name[GetPrefix.Length..]; 109.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)
57var propertyName = propertySymbol.Name; 81var desiredMethodSuffix = NameGenerator.GenerateUniqueName(propertySymbol.Name, 177property.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)
188IParameterSymbol parameter => GetParameterDocumentation(parameter, compilation, cancellationToken)?.GetParameterText(parameter.Name), 189ITypeParameterSymbol typeParam => typeParam.ContainingSymbol.GetDocumentationComment(compilation, expandIncludes: true, expandInheritdoc: true, cancellationToken: cancellationToken)?.GetTypeParameterText(typeParam.Name), 204var symbolName = methodSymbol.Name;
Shared\Naming\IdentifierNameParts.cs (1)
30var baseName = RemovePrefixesAndSuffixes(symbol, rules, symbol.Name);
Shared\Utilities\ExtractTypeHelpers.cs (1)
126var typeParameterNames = typeParameters.SelectAsArray(p => p.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);
SolutionCrawler\WorkCoordinator.SemanticChangeProcessor.cs (2)
131Logger.Log(FunctionId.WorkCoordinator_SemanticChange_EnqueueFromType, symbol.Name); 158Logger.Log(FunctionId.WorkCoordinator_SemanticChange_EnqueueFromMember, symbol.Name);
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)
SuppressMessageAttributeState.cs (1)
71builder.Add((propertyReference.Property.Name, simpleAssignment.Value));
SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
552if (methodContext.TypeParameters[i].Name == typeParameterName) 564if (containingType.TypeParameters[i].Name == typeParameterName)
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
140fieldSymbol, propertySymbol.Name,
UseExplicitTupleNameDiagnosticAnalyzer.cs (3)
63nameof(ElementName), namedField.Name); 87!fieldSymbol.Name.Equals(unnamedField.Name))
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (2)
108var argumentName = parameters[argumentIndex].Name; 159? WithName((TSimpleArgumentSyntax)argument.WithoutTrivia(), parameters[i].Name).WithTriviaFrom(argument)
UseNamedMemberInitializerAnalyzer.cs (1)
181statement, leftMemberAccess, rightExpression, typeMember?.Name ?? identifier.ValueText));
Microsoft.CodeAnalysis.Test.Utilities (60)
Compilation\CompilationDifference.cs (1)
143var actual = EmitResult.Baseline.SynthesizedMembers.Single(e => e.Key.ToString() == typeName).Value.Where(s => s.Kind == SymbolKind.Field).Select(s => (IFieldSymbol)s.GetISymbol()).Select(f => f.Name + ": " + f.Type);
Compilation\CompilationExtensions.cs (1)
220if (!string.IsNullOrEmpty(symbolToVerify) && !declaration.DeclaredSymbol.Name.Equals(symbolToVerify, StringComparison.Ordinal))
Compilation\ControlFlowGraphVerifier.cs (3)
972TargetMethod: { Name: BoundInterpolatedString.AppendFormattedMethod or BoundInterpolatedString.AppendLiteralMethod, ContainingType: INamedTypeSymbol containingType } 2016Name: WellKnownMemberNames.TopLevelStatementsEntryPointMethodName, 2019Name: 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)}"; 972LogString($": {operation.Local.Name}"); 1019LogString($": {operation.Parameter.Name}");
Compilation\TestOperationVisitor.cs (4)
797semanticModel.Compilation.CreateBuiltinOperator(symbol.Name, method.ReturnType, method.Parameters[0].Type); 800semanticModel.Compilation.CreateBuiltinOperator(symbol.Name, method.ReturnType, method.Parameters[0].Type, method.Parameters[1].Type); 1471Assert.Equal("Deconstruct", method.Name); 1475Assert.Equal("ITuple", type.Name);
Diagnostics\CommonDiagnosticAnalyzers.cs (29)
524codeBlockContext.ReportDiagnostic(Diagnostic.Create(CodeBlockTopLevelRule, codeBlockContext.OwningSymbol.Locations[0], codeBlockContext.OwningSymbol.Name)); 533codeBlockContext.ReportDiagnostic(Diagnostic.Create(CodeBlockPerCompilationRule, codeBlockContext.OwningSymbol.Locations[0], codeBlockContext.OwningSymbol.Name)); 957symbolContext.ReportDiagnostic(Diagnostic.Create(Rule, symbolContext.Symbol.Locations[0], symbolContext.Symbol.Name)); 1042if (_symbolNames.Contains(type.Name)) 1067var diagnostic = Diagnostic.Create(Descriptor, symbolContext.Symbol.Locations[0], symbolContext.Symbol.Name); 1282var diagnostic = Diagnostic.Create(Descriptor, c.OwningSymbol.Locations[0], c.OwningSymbol.Name, operationRoot.Kind); 1335var diagnostic = Diagnostic.Create(Descriptor, operation.Syntax.GetLocation(), operation.Field.Name, operation.Field.ConstantValue); 1356var diagnostic = Diagnostic.Create(Descriptor, operationContext.Operation.Syntax.GetLocation(), operationContext.ContainingSymbol.Name); 1426sortedCallbackSymbolNames.Add($"{symbolContext.Symbol.Name}(IsGeneratedCode:{symbolContext.IsGeneratedCode})"); 1451sortedCallbackSyntaxNodeNames.Add($"{context.ContainingSymbol.Name}(IsGeneratedCode:{context.IsGeneratedCode})"), 1459sortedCallbackSymbolStartNames.Add($"{context.Symbol.Name}(IsGeneratedCode:{context.IsGeneratedCode})"); 1469sortedCallbackOperationBlockStartNames.Add($"{context.OwningSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})"); 1472sortedCallbackOperationNames.Add($"{context.ContainingSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})"), 1476sortedCallbackOperationBlockEndNames.Add($"{context.OwningSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})")); 1487sortedCallbackOperationBlockNames.Add($"{context.OwningSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})"); 1491sortedCallbackSymbolEndNames.Add($"{context.Symbol.Name}(IsGeneratedCode:{context.IsGeneratedCode})")); 1501sortedCallbackCodeBlockStartNames.Add($"{context.OwningSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})"); 1504sortedCallbackCodeBlockEndNames.Add($"{context.OwningSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})")); 1514sortedCallbackCodeBlockNames.Add($"{context.OwningSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})"); 1550ReportDiagnosticsCore(addDiagnostic, symbol.Locations[0], symbol.Name); 1596var diagnostic = Diagnostic.Create(Rule, namedType.Locations[0], namedType.Name, namedTypes.Count); 1704var diagnostic = Diagnostic.Create(descriptor, symbolContext.Symbol.Locations[0], symbolContext.Symbol.Name); 1939diagnostics.Add(Diagnostic.Create(DuplicateStartActionRule, Location.None, symbolStartContext.Symbol.Name, _analyzerId)); 1949diagnostics.Add(Diagnostic.Create(DuplicateEndActionRule, Location.None, symbolEndContext.Symbol.Name, _analyzerId)); 1954symbolEndContext.ReportDiagnostic(Diagnostic.Create(rule, Location.None, symbolStartContext.Symbol.Name, _analyzerId)); 1964operationContext.ReportDiagnostic(Diagnostic.Create(OperationRule, Location.None, symbolStartContext.Symbol.Name, operationContext.ContainingSymbol.Name, operationContext.Operation.Syntax.ToString(), _analyzerId)); 2271public string GetSortedSymbolCallbacksString() => string.Join(", ", Roslyn.Utilities.EnumerableExtensions.Order(_symbolCallbacks.Select(s => s.Name))); 2317=> reportDiagnostic(Diagnostic.Create(_rule, symbol.Locations[0], symbol.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 (41)
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)
1474Debug.Assert(namespaceSymbol.Name = "", "Namespace with Nothing container should be root namespace with empty name") 1483Return 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 (7)
160builder.Add(CreatePart(SymbolDisplayPartKind.LabelName, symbol, symbol.Name, False)) 164builder.Add(CreatePart(SymbolDisplayPartKind.LocalName, symbol, symbol.Name, False)) 173builder.Add(CreatePart(SymbolDisplayPartKind.ModuleName, symbol, symbol.Name, False)) 186Dim myCaseCorrectedNSName As String = symbol.Name 254Dim name = If(symbol.Name, "<anonymous local>") 279builder.Add(CreatePart(SymbolDisplayPartKind.RangeVariableName, symbol, symbol.Name, False)) 366symbol.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)
729Dim myKeys = Me.GetInternalsVisibleToPublicKeys(assemblyWantingAccess.Name)
Symbols\ModuleSymbol.vb (1)
274Return cns.GetNestedNamespace(namespaceSymbol.Name)
Symbols\Symbol.vb (1)
1246Private 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 (4)
ArgumentSyntaxExtensions.vb (1)
50Dim parameter = parameters.FirstOrDefault(Function(p) p.Name = name)
SemanticModelExtensions.vb (1)
257Return parameter.Name
VisualBasicSemanticFacts.vb (1)
157globalImport.Name.AppendToAliasNameSet(builder)
VisualBasicUnnecessaryImportsProvider.vb (1)
123Dim aliasSymbol = compilation.AliasImports.FirstOrDefault(Function(a) a.Name = clause.Alias.Identifier.ValueText)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (15)
ExpressionSyntaxGeneratorVisitor.vb (1)
61Dim result = AddInformationTo(symbol.Name.ToIdentifierName, symbol)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SymbolExtensions.vb\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
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\SymbolExtensions.vb\SymbolExtensions.vb (1)
18propertySymbol.ContainingType.Name = "MyForms" AndAlso
TypeSyntaxGeneratorVisitor.vb (7)
38Return AddInformationTo(symbol.Name.ToIdentifierName, symbol) 77If symbol.Name = String.Empty OrElse symbol.IsAnonymousType Then 86Return symbol.Name.ToIdentifierName 90symbol.Name.ToIdentifierToken, 143SyntaxFactory.Identifier(element.Name), 180Dim result = AddInformationTo(symbol.Name.ToIdentifierName, symbol) 203Return AddInformationTo(symbol.Name.ToIdentifierName, symbol)
VisualBasicTypeInferenceService.TypeInferrer.vb (2)
24otherSideType.Name = String.Empty 393.Where(Function(p) p.Name = simpleArgument.NameColonEquals.Name.Identifier.ValueText)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (5)
NavigationBar\VisualBasicEditorNavigationBarItemService_CodeGeneration.vb (5)
141typeName:=destinationType.Name, 182methodName = generateCodeItem.ContainerName + "_" + eventSymbol.Name 185methodName = destinationType.Name + "_" + eventSymbol.Name 188Dim handlesSyntax = SyntaxFactory.SimpleMemberAccessExpression(containerSyntax, SyntaxFactory.Token(SyntaxKind.DotToken), eventSymbol.Name.ToIdentifierName())
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (10)
SymbolId\SymbolKeyCompilationsTests.vb (2)
112Dim origlist = originalSymbols.OrderBy(Function(s) s.Name).ToList() 113Dim newlist = newSymbols.OrderBy(Function(s) s.Name).ToList()
SymbolId\SymbolKeyMetadataVsSourceTests.vb (6)
77Dim originalSymbols = GetSourceSymbols(comp1, SymbolCategory.DeclaredType).OrderBy(Function(s) s.Name).ToList() 162originalSymbols = originalSymbols.Where(Function(s) Not s.IsAccessor() AndAlso s.Kind <> SymbolKind.Parameter).OrderBy(Function(s) s.Name).ToList() 239Dim ver20Symbols = GetSourceSymbols(comp20, SymbolCategory.NonTypeMember Or SymbolCategory.Parameter).OrderBy(Function(s) s.Name).ToList() 247Dim localSymbols = ver40Symbols.OrderBy(Function(s) s.Name).[Select](Function(s) DirectCast(s, ILocalSymbol)).ToList() 313Dim ver20Symbols = GetSourceSymbols(comp20, SymbolCategory.NonTypeMember).Where(Function(s) Not s.IsAccessor() And s.Kind <> SymbolKind.Parameter).OrderBy(Function(s) s.Name) 388Dim ver20Symbols = GetSourceSymbols(comp20, SymbolCategory.NonTypeMember).Where(Function(s) Not s.IsAccessor() And s.Kind <> SymbolKind.Parameter).OrderBy(Function(s) s.Name).ToList()
SymbolId\SymbolKeyTestBase.vb (2)
36Dim newlist = newSymbols.OrderBy(Function(s) s.Name).ToList() 37Dim origlist = originalSymbols.OrderBy(Function(s) s.Name).ToList()
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (13)
Attributes\AttributeTests.vb (3)
1902Assert.Equal("Bar", ca.Type.Name) 4182Assert.Equal("Type", args(0).Type.Name) 4186Assert.Equal("String", args(1).Type.Name)
CodeGen\CodeGenTuples.vb (8)
9040Assert.Equal("Alice", sym.Symbol.Name) 9229Order By m.Name 9230Select m.Name 9276Order By m.Name 9277Select m.Name 17098Assert.Equal("C1", c1.Name) 17104Assert.Equal("C2", c2.Name) 17109Assert.Equal("C3", c3.Name)
PrivateProtected.vb (2)
134Select Case member.Name 139Assert.Equal("private protected member", member.Name)
Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator.ExpressionCompiler.UnitTests (2)
ExpressionCompilerTestBase.vb (2)
475Dim typeName = method.ContainingType.Name 478Dim methodName = method.Name
Microsoft.CodeAnalysis.VisualBasic.Features (76)
ChangeSignature\VisualBasicChangeSignatureService.vb (1)
657If (identifier Is Nothing OrElse identifier.ToString() <> declaredParameters.ElementAt(i).Name) Then
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.CodeAction.vb (2)
34Return String.Format(VBFeaturesResources.Create_event_0_in_1, _generatedEvent.Name, _targetSymbol.Name)
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (1)
371Any(Function(x) x.MatchesKind(SymbolKind.Event) AndAlso x.Name = handlesClauseItem.EventMember.Identifier.ValueText) Then
Completion\CompletionProviders\CompletionListTagCompletionProvider.vb (1)
104Dim additionalFilterTexts = ImmutableArray.Create(symbols(0).Symbol.Name)
Completion\CompletionProviders\CompletionUtilities.vb (1)
87name = symbol.Name
Completion\CompletionProviders\EnumCompletionProvider.vb (2)
119Dim text = _cachedDisplayAndInsertionTextContainingTypeText & "." & symbol.Name 151item = item.AddTag(WellKnownTags.TargetTypeMatch).WithAdditionalFilterTexts(ImmutableArray.Create(symbols(0).Symbol.Name))
Completion\CompletionProviders\NamedParameterCompletionProvider.vb (4)
86Where(Function(p) Not existingNamedParameters.Contains(p.Name)) 93displayText:=parameter.Name, 95insertionText:=parameter.Name.ToIdentifierToken().ToString() & textSuffix, 117Return existingNamedParameters.Except(parameterList.Select(Function(p) p.Name)).IsEmpty()
Completion\CompletionProviders\ObjectInitializerCompletionProvider.vb (1)
119Return symbol.Name.EscapeIdentifier()
Completion\CompletionProviders\OverrideCompletionProvider.vb (1)
159Dim finalizeMethod = members.OfType(Of IMethodSymbol)().Where(Function(x) x.Name = "Finalize" AndAlso OverridesObjectMethod(x)).SingleOrDefault()
Completion\CompletionProviders\PartialTypeCompletionProvider.vb (1)
70InsertionTextOnOpenParen, symbol.Name.EscapeIdentifier())
ConvertAutoPropertyToFullProperty\VisualBasicConvertAutoPropertyToFullProperty.vb (1)
35Return Task.FromResult(Underscore + propertySymbol.Name)
Diagnostics\Analyzers\TypeSyntaxSimplifierWalker.vb (1)
83_aliasedNames = _aliasedNames.Add(aliasSymbol.Target.Name)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (3)
273Where String.Equals(DirectCast(identifier.Identifier.Value, String), localOrParameter.Name, StringComparison.OrdinalIgnoreCase) AndAlso 1321Dim newSymbol = newSymbols.FirstOrDefault(Function(s, o) CaseInsensitiveComparison.Equals(s.Name, o.Name), oldSymbol)
EncapsulateField\VisualBasicEncapsulateFieldService.vb (7)
92Where(Function(f) f.Name.Length > 0). 111Dim propertyName = GeneratePropertyName(field.Name) 113Return (field.Name, propertyName) 115Dim propertyName = GeneratePropertyName(field.Name) 116Dim containingTypeMemberNames = field.ContainingType.GetAccessibleMembersInThisAndBaseTypes(Of ISymbol)(field.ContainingType).Select(Function(s) s.Name) 117propertyName = NameGenerator.GenerateUniqueName(propertyName, containingTypeMemberNames.Where(Function(m) m <> field.Name).ToSet(), StringComparer.OrdinalIgnoreCase) 129Dim containingTypeMemberNames = field.ContainingType.GetAccessibleMembersInThisAndBaseTypes(Of ISymbol)(field.ContainingType).Select(Function(s) s.Name)
ExtractInterface\VisualBasicExtractInterfaceService.vb (4)
108SyntaxFactory.Identifier(extractedInterfaceSymbol.Name), 109SyntaxFactory.TypeArgumentList(SyntaxFactory.SeparatedList(extractedInterfaceSymbol.TypeParameters.Select(Function(p) SyntaxFactory.ParseTypeName(p.Name))))), 110SyntaxFactory.ParseTypeName(extractedInterfaceSymbol.Name)) 138Dim qualifiedName As QualifiedNameSyntax = SyntaxFactory.QualifiedName(implementedInterfaceStatementSyntax.GetRightmostName(), SyntaxFactory.IdentifierName(member.Name))
ExtractMethod\VisualBasicMethodExtractor.Analyzer.vb (1)
73Dim info = semanticModel.GetSpeculativeTypeInfo(Me.SelectionResult.FinalSpan.Start, SyntaxFactory.ParseName(symbol.Name), SpeculativeBindingOption.BindAsExpression)
ExtractMethod\VisualBasicMethodExtractor.vb (1)
104Dim typeName = SyntaxFactory.ParseTypeName(typeParameter.Name)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.vb (2)
137Select SyntaxFactory.ParseTypeName(methodTypeParameter.Name)).ToList() 349If Not CaseInsensitiveComparison.Equals(method.Name, NameOf(Task.ConfigureAwait)) Then
GenerateMember\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (2)
167Return String.Format(VBFeaturesResources.Generate_narrowing_conversion_in_0, state.TypeToGenerateIn.Name) 171Return String.Format(VBFeaturesResources.Generate_widening_conversion_in_0, state.TypeToGenerateIn.Name)
GenerateMember\GenerateParameterizedMember\VisualBasicGenerateParameterizedMemberService.vb (4)
32Dim typeParametersNames = Me.DetermineTypeParameters(cancellationToken).SelectAsArray(Function(t) t.Name) 87Function(s) Not State.TypeToGenerateIn.GetAllTypeParameters().Any(Function(t) t.Name = s), 98Function(s) Not usedIdentifiers.Contains(s) AndAlso Not State.TypeToGenerateIn.GetAllTypeParameters().Any(Function(t) t.Name = s), 101usedIdentifiers.Add(typeParameter.Name)
InlineHints\VisualBasicInlineParameterNameHintsService.vb (1)
51If String.IsNullOrEmpty(parameter?.Name) Then
IntroduceParameter\VisualBasicIntroduceParameterCodeRefactoringProvider.vb (1)
35Return methodSymbol.Name.Equals(WellKnownMemberNames.DestructorName)
LanguageServices\VisualBasicStructuralTypeDisplayService.vb (1)
53members.Add(New SymbolDisplayPart(SymbolDisplayPartKind.PropertyName, [property], [property].Name))
NavigationBar\VisualBasicNavigationBarItemService.vb (18)
95Return typesAndDeclarations.Select(Function(kvp) Tuple.Create(kvp.Key, kvp.Value)).OrderBy(Function(t) t.Item1.Name) 133For Each member In type.GetMembers().OrderBy(Function(m) m.Name) 163Order By member.Name 172type.Name, 173type.Name, 193member.Name, 194member.Name, 238.GroupBy(Function(m) m.Name, CaseInsensitiveComparison.Comparer) _ 260type.Name, 322Dim accessibleEvents = semanticModel.LookupSymbols(position, eventType).OfType(Of IEventSymbol).OrderBy(Function(e) e.Name) 348e.Name, 349e.Name, 361Dim eventContainerName = eventContainer?.Name 365e.Name, 376eventContainer.Name, 382String.Format(VBFeaturesResources._0_Events, containingType.Name), 418method.Name, 437member.Name,
ReplacePropertyWithMethods\VisualBasicReplacePropertyWithMethods.vb (5)
133fieldReference, generator.IdentifierName(setMethod.Parameters(0).Name))) 176If explicitInterfaceImplMethod.Name = "get_" + [property].Name OrElse 177explicitInterfaceImplMethod.Name = "set_" + [property].Name Then
SignatureHelp\AbstractVisualBasicSignatureHelpProvider.vb (1)
45parameter.Name,
SignatureHelp\AttributeSignatureHelpProvider.vb (3)
114OrderBy(Function(s) s.Name). 154namedParameter, namedParameter.Name.ToIdentifierToken.ToString())) 159namedParameter.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,
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (164)
Binding\Binder_Expressions_Tests.vb (10)
3012Assert.Equal("Color", symbol.Name) 3058Assert.Equal("Color", symbol.Name) 3104Assert.Equal("Color", symbol.Name) 3153Assert.Equal("Color", symbol.Name) 3207Assert.Equal("Color", symbol.Name) 3255Assert.Equal("Color", symbol.Name) 3299Assert.Equal("Color", symbol.Name) 3352Assert.Equal("Color", symbol.Name) 3398Assert.Equal("Color", symbol.Name) 3442Assert.Equal("Color", symbol.Name)
Binding\ImplicitVariableTests.vb (1)
1299Dim actual = GetLookupSymbols(compilation, "a.vb").Select(Function(s) s.Name)
Binding\MethodBodyBindingTests.vb (2)
339Assert.Equal("ax", sym1.Name) 344Assert.Equal("ex", sym2.Name)
Compilation\CompilationAPITests.vb (1)
1502Assert.Equal({"Alice", "Bob"}, tupleWithNames.TupleElements.SelectAsArray(Function(e) e.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 (29)
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) 984Assert.Equal("z", parameterSymbol.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) 1711Assert.Equal("z", parameterSymbol.Name) 4029Assert.Equal(symbol.Name, "e") 4070Assert.Equal(propertyName, getterSymbol.Name) 4079Assert.Equal(propertyName, setterSymbol.Name)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (31)
74Assert.Equal("goo", symbol1.Name) 96Assert.Equal("goo", symbol1.Name) 118Assert.Equal("goo", symbol1.Name) 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 (12)
58Assert.Equal("A", semanticModel.GetTypeInfo(invocation).Type.Name) 59Assert.Equal("M", semanticModel.GetSymbolInfo(invocation).Symbol.Name) 73Assert.Equal("Int32", semanticModel.GetSpeculativeTypeInfo(position, speculativeInvocation, SpeculativeBindingOption.BindAsExpression).Type.Name) 74Assert.Equal("_num", semanticModel.GetSpeculativeSymbolInfo(position, speculativeInvocation, SpeculativeBindingOption.BindAsExpression).Symbol.Name) 90Assert.Equal("A", creationExpression.Type.Name) 123Assert.Equal("_p", symbolInfo.Symbol.Name) 190Assert.Equal("A", semanticModel.GetTypeInfo(invocation).Type.Name) 191Assert.Equal("M", semanticModel.GetSymbolInfo(invocation).Symbol.Name) 196Assert.Equal("Int32", semanticModel.GetSpeculativeTypeInfo(position, speculativeInvocation, SpeculativeBindingOption.BindAsExpression).Type.Name) 197Assert.Equal("InternalExtension", semanticModel.GetSpeculativeSymbolInfo(position, speculativeInvocation, SpeculativeBindingOption.BindAsExpression).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 (5)
167Assert.True(declaredSymbolNames.Contains(compilation.GlobalNamespace.Name)) 222Assert.True(declaredSymbolNames.Contains(compilation.GlobalNamespace.Name)) 431Dim added = declaredSymbolNames.Add(symbol.Name) 438Assert.True(isPartialMethod, "Unexpected multiple symbol declared events for same symbol " + symbol.Name) 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) 228Assert.Equal(If(alwaysAssigned, {}), analysis.AlwaysAssigned.Select(Function(s) s.Name).ToArray()) 229Assert.Equal(If(captured, {}), analysis.Captured.Select(Function(s) s.Name).ToArray()) 230Assert.Equal(If(dataFlowsIn, {}), analysis.DataFlowsIn.Select(Function(s) s.Name).ToArray()) 231Assert.Equal(If(dataFlowsOut, {}), analysis.DataFlowsOut.Select(Function(s) s.Name).ToArray()) 232Assert.Equal(If(definitelyAssignedOnEntry, {}), analysis.DefinitelyAssignedOnEntry.Select(Function(s) s.Name).ToArray()) 233Assert.Equal(If(definitelyAssignedOnExit, {}), analysis.DefinitelyAssignedOnExit.Select(Function(s) s.Name).ToArray()) 234Assert.Equal(If(readInside, {}), analysis.ReadInside.Select(Function(s) s.Name).ToArray()) 235Assert.Equal(If(readOutside, {}), analysis.ReadOutside.Select(Function(s) s.Name).ToArray()) 236Assert.Equal(If(variablesDeclared, {}), analysis.VariablesDeclared.Select(Function(s) s.Name).ToArray()) 237Assert.Equal(If(writtenInside, {}), analysis.WrittenInside.Select(Function(s) s.Name).ToArray()) 238Assert.Equal(If(writtenOutside, {}), analysis.WrittenOutside.Select(Function(s) s.Name).ToArray()) 239Assert.Equal(If(capturedInside, {}), analysis.CapturedInside.Select(Function(s) s.Name).ToArray()) 240Assert.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"))
FlowAnalysis\RegionAnalysisTests.vb (4)
3812Assert.True(dataResults1.WrittenOutside.Any(Function(ByVal s) s.Name = "f")) 3813Assert.False(dataResults2.WrittenOutside.Any(Function(ByVal s) s.Name = "f")) 3814Assert.Equal(GetSymbolNamesJoined(dataResults1.WrittenOutside.Where(Function(ByVal s) s.Name <> "f")), GetSymbolNamesJoined(dataResults2.WrittenOutside)) 3913Assert.Equal(GetSymbolNamesJoined(dataResults1.WrittenOutside.Where(Function(x) x.Name <> "f")),
Semantics\ForeachTest.vb (1)
1382Return String.Join(", ", symbols.Select(Function(symbol) symbol.Name).OrderBy(Function(name) name))
Semantics\ForLoopTest.vb (1)
651Return String.Join(", ", symbols.Select(Function(symbol) symbol.Name).OrderBy(Function(name) name))
Semantics\GetExtendedSemanticInfoTests.vb (1)
2372Assert.Equal("String", semanticInfo.Alias.Target.Name)
Semantics\GetSemanticInfoTests.vb (29)
605Assert.Equal("controlVar", symbol.Name) 616Assert.Equal("controlVar2", symbol.Name) 878Assert.Equal("value2", parameter.Name) 995Assert.Equal("10", labelSymbol.Name) 1025Assert.Equal("mylabel", declaredSymbol.Name) 1052Assert.Equal("mylabel", declaredSymbol.Name) 1295Assert.Equal("x", xSymbolInfo.Symbol.Name) 1453Dim parameter = DirectCast(accessor.Parameters.Where(Function(p) p.Name = "d").FirstOrDefault, ParameterSymbol) 1460parameter = DirectCast(accessor.Parameters.Where(Function(p) p.Name = "d").FirstOrDefault, ParameterSymbol) 1639Assert.Equal("A", symbolInfo.Symbol.Name) 1646Assert.Equal("B", symbolInfo.Symbol.Name) 1652Assert.Equal("C", symbolInfo.Symbol.Name) 1658Assert.Equal("C", symbolInfo.Symbol.Name) 1666Assert.Equal("B", symbolInfo.Symbol.Name) 1672Assert.Equal("B", symbolInfo.Symbol.Name) 1680Assert.Equal("B", symbolInfo.Symbol.Name) 1686Assert.Equal("ToString", symbolInfo.Symbol.Name) 1693Assert.Equal("F", symbolInfo.Symbol.Name) 1700Assert.Equal("P1", symbolInfo.Symbol.Name) 1707Assert.Equal("P2", symbolInfo.Symbol.Name) 1714Assert.Equal("P3", symbolInfo.Symbol.Name) 1721Assert.Equal("F1", symbolInfo.Symbol.Name) 1728Assert.Equal("F2", symbolInfo.Symbol.Name) 1735Assert.Equal("C", symbolInfo.Symbol.Name) 3086Assert.Equal("e1", handledEvent0.EventSymbol.Name) 3089Assert.Equal("C0", we.ContainingType.Name) 3099Assert.Equal("e1", handledEvent2.EventSymbol.Name) 4758Assert.Equal("Type", typeInfo.Type.Name) 4763Assert.Equal("EventHandler", typeInfo.Type.Name)
Semantics\IFOperatorTest.vb (1)
1236Return String.Join(", ", symbols.Select(Function(symbol) symbol.Name).OrderBy(Function(name) name))
Semantics\LambdaSemanticInfoTests.vb (1)
540Assert.Equal("e", e.Name)
Semantics\MultiDimensionalTest.vb (2)
326Assert.Equal(expectedSymbolName, symbol.Name) 369Return String.Join(", ", symbols.Select(Function(symbol) symbol.Name).OrderBy(Function(name) name))
Semantics\NonTrailingNamedArgumentsTests.vb (2)
74Assert.Equal("a", firstASymbol.Symbol.Name) 86Assert.Equal("a", secondASymbol.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)
Semantics\QueryExpressions_LookupSymbols.vb (4)
914Select(Function(s) s.Name).OrderBy(Function(n) n))) 945Dim lookupResult = New HashSet(Of String)(semanticModel.LookupSymbols(pos1, includeReducedExtensionMethods:=True).Select(Function(s) s.Name)) 1554Select(Function(s) s.Name).OrderBy(Function(n) n))) 1949Select(Function(s) s.Name).OrderBy(Function(n) n)))
Semantics\TypeOfTests.vb (2)
752Assert.Equal("HRESULT", aliasSymbol.Name) 768Assert.Equal("isString", symbolInfo.Symbol.Name)
Semantics\VariableTypeInference.vb (1)
708Assert.Equal(varName, varSymbol.Name)
Semantics\XmlLiteralSemanticModelTests.vb (1)
485symbols = symbols.WhereAsArray(Function(s) s.Name = "Value")
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (20)
DocumentationComments\DocCommentTests.vb (2)
11502Assert.Equal("A", symbols(0).ContainingAssembly.Name) 11503Assert.Equal("B", symbols(1).ContainingAssembly.Name)
SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb (8)
1701Dim symList = From ap In anonProps Let apsym = model.GetDeclaredSymbol(ap) Order By apsym.Name Select apsym.Name 1728Dim symList = From ap In anonProps Let apsym = model.GetDeclaredSymbol(ap) Order By apsym.Name Select apsym.Name 1779Dim symList = From ap In anonProps Let apsym = model.GetDeclaredSymbol(ap) Order By apsym.Name Select apsym.Name 1823Dim symList = From ap In anonProps Let apsym = model.GetDeclaredSymbol(ap) Order By apsym.Name Select apsym.Name
SymbolsTests\ExtensionMethods\ExtensionMethodTests.vb (2)
2408Assert.Equal("InstanceMethod", sym.Name) 2419Assert.Equal("ExtensionMethod", sym.Name)
SymbolsTests\Metadata\WinMdEventTest.vb (1)
1469Assert.Equal(eventSymbol.AddMethod.Name, symbol.Name)
SymbolsTests\MyBaseMyClassSemanticsTests.vb (3)
73Assert.Equal(info0.Type.Name, "B2") 76Assert.Equal(info1.Type.Name, "B2") 79Assert.Equal(info2.Type.Name, "B1")
SymbolsTests\Source\OverridesTests.vb (1)
6727If namedType.Name.StartsWith("Derived", StringComparison.OrdinalIgnoreCase) Then
SymbolsTests\Source\SourceSymbolTests.vb (3)
41Assert.Equal(String.Empty, symbol.Name) 87Assert.Equal("r1", r1Type.Name) 93Assert.Equal("r2", r2Type.Name)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (3)
CompilationTestUtils.vb (3)
1053Dim name1 = loc1.MetadataModule.ContainingAssembly.Name 1054Dim name2 = loc2.MetadataModule.ContainingAssembly.Name 1240Return result.Select(Function(s) s.Name).Distinct().ToList()
Microsoft.CodeAnalysis.VisualBasic.Workspaces (89)
ArgumentSyntaxExtensions.vb (1)
50Dim parameter = parameters.FirstOrDefault(Function(p) p.Name = name)
CaseCorrection\VisualBasicCaseCorrectionService.Rewriter.vb (10)
36[set].Add(import.Name) 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\AttributeGenerator.vb (1)
22Return SyntaxFactory.List(attributes.OrderBy(Function(a) a.AttributeClass.Name).Select(Function(a) GenerateAttributeBlock(a, options, target)))
CodeGeneration\ConstructorGenerator.vb (1)
103arguments:=SyntaxFactory.SeparatedList(constructor.Parameters.Select(Function(p) SyntaxFactory.SimpleArgument(SyntaxFactory.IdentifierName(p.Name))).OfType(Of ArgumentSyntax)))))
CodeGeneration\EnumMemberGenerator.vb (2)
36If enumMember.Name = WellKnownMemberNames.EnumBackingFieldName Then 46Dim member = SyntaxFactory.EnumMemberDeclaration(enumMember.Name.ToIdentifierToken()) _
CodeGeneration\EventGenerator.vb (4)
113[event].Name, 146identifier:=[event].Name.ToIdentifierToken, 155identifier:=[event].Name.ToIdentifierToken, 192Return CodeGenerationSymbolFactory.CreateParameterSymbol(parameter.GetAttributes(), parameter.RefKind, isParams:=False, type:=parameter.Type, name:=parameter.Name, hasDefaultValue:=False)
CodeGeneration\FieldGenerator.vb (1)
87SyntaxFactory.SingletonSeparatedList(field.Name.ToModifiedIdentifier),
CodeGeneration\MethodGenerator.vb (1)
78SyntaxFactory.MethodStatement(kind, subOrFunctionKeyword:=SyntaxFactory.Token(keyword), identifier:=method.Name.ToIdentifierToken).
CodeGeneration\NamedTypeGenerator.vb (3)
124identifier:=namedType.Name.ToIdentifierToken(), 140identifier:=namedType.Name.ToIdentifierToken(), 156namedType.Name.ToIdentifierToken,
CodeGeneration\NamespaceGenerator.vb (1)
113SyntaxFactory.SimpleImportsClause(SyntaxFactory.ImportAliasClause([alias].Name.ToIdentifierToken), name)))
CodeGeneration\OperatorGenerator.vb (1)
42Throw New ArgumentException(String.Format(WorkspaceExtensionsResources.Cannot_generate_code_for_unsupported_operator_0, method.Name), NameOf(method))
CodeGeneration\ParameterGenerator.vb (2)
56parameter.Name.ToModifiedIdentifier.WithArrayBounds(argumentList), 68parameter.Name.ToModifiedIdentifier(),
CodeGeneration\PropertyGenerator.vb (1)
69Dim begin = SyntaxFactory.PropertyStatement(identifier:=[property].Name.ToIdentifierToken).
CodeGeneration\TypeParameterGenerator.vb (1)
19identifier:=symbol.Name.ToIdentifierToken,
CodeGeneration\VisualBasicCodeGenerationHelpers.vb (1)
75DirectCast(type, NameSyntax), explicitInterfaceOpt.Name.ToIdentifierName())))
CodeGeneration\VisualBasicSyntaxGenerator.vb (2)
2794SyntaxFactory.Identifier(symbol.Name), 2869SyntaxFactory.IdentifierName(method.Name))
Editing\VisualBasicImportAdder.vb (5)
118_importedTypesAndNamespaces.Add((typeOrNamespace.Name, typeOrNamespace.GetArity()), ns) 125_importedExtensionMethods.Add(method.Name, ns) 135_importedTypesAndNamespaces.Add((moduleType.Name, moduleType.GetArity()), ns) 137_importedMembers.Add(member.Name, ns) 210_conflictNamespaces.AddRange(_importedExtensionMethods(method.Name))
ExpressionSyntaxGeneratorVisitor.vb (1)
61Dim result = AddInformationTo(symbol.Name.ToIdentifierName, symbol)
FindSymbols\VisualBasicReferenceFinder.vb (1)
63Where type.Name = "MyForms"
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SymbolExtensions.vb\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
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\SymbolExtensions.vb\SymbolExtensions.vb (1)
18propertySymbol.ContainingType.Name = "MyForms" AndAlso
Recommendations\VisualBasicRecommendationServiceRunner.vb (1)
343symbols = symbols.WhereAsArray(Function(s) s.Kind <> SymbolKind.Field OrElse Not s.ContainingType.IsEnumType() OrElse s.Name <> WellKnownMemberNames.EnumBackingFieldName)
Rename\VisualBasicRenameRewriterLanguageService.vb (21)
329fieldSymbol.Name = "_" + fieldSymbol.AssociatedSymbol.Name Then 529If oldIdentifier <> Me._renamedSymbol.Name Then 733CaseInsensitiveComparison.Equals(renamedSymbol.ContainingSymbol.Name, renamedSymbol.Name) Then 767renamedSymbol.Name, 784If renamedSymbol.ContainingType IsNot Nothing AndAlso renamedSymbol.ContainingType.GetMembers(renamedSymbol.Name).Contains(renamedSymbol) Then 786.Where(Function(t) CaseInsensitiveComparison.Equals(t.Name, renamedSymbol.Name)) _ 805CaseInsensitiveComparison.Equals(renameSymbol.Name, "Current") 808(CaseInsensitiveComparison.Equals(renameSymbol.Name, "MoveNext") OrElse 809CaseInsensitiveComparison.Equals(renameSymbol.Name, "GetEnumerator"))) 814If Not CaseInsensitiveComparison.Equals(renamedSymbol.Name, renameSymbol.Name) Then 907If CaseInsensitiveComparison.Equals(renamedSymbol.Name, "MoveNext") OrElse 908CaseInsensitiveComparison.Equals(renamedSymbol.Name, "GetEnumerator") OrElse 909CaseInsensitiveComparison.Equals(renamedSymbol.Name, "Current") Then 933renamedSymbol.Name) _ 944If CaseInsensitiveComparison.Equals(symbol.Name, "MoveNext") Then 948ElseIf CaseInsensitiveComparison.Equals(symbol.Name, "GetEnumerator") Then 957ElseIf CaseInsensitiveComparison.Equals(symbol.Name, "Current") Then
SemanticModelExtensions.vb (1)
257Return parameter.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 (5)
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) 576Dim name = symbol.Name
TypeSyntaxGeneratorVisitor.vb (7)
38Return AddInformationTo(symbol.Name.ToIdentifierName, symbol) 77If symbol.Name = String.Empty OrElse symbol.IsAnonymousType Then 86Return symbol.Name.ToIdentifierName 90symbol.Name.ToIdentifierToken, 143SyntaxFactory.Identifier(element.Name), 180Dim result = AddInformationTo(symbol.Name.ToIdentifierName, symbol) 203Return AddInformationTo(symbol.Name.ToIdentifierName, symbol)
Utilities\IntrinsicOperators\PredefinedCastExpressionDocumentation.vb (1)
62Return _resultingType.ContainingNamespace.Name + "." + _resultingType.MetadataName
VisualBasicSemanticFacts.vb (1)
157globalImport.Name.AppendToAliasNameSet(builder)
VisualBasicTypeInferenceService.TypeInferrer.vb (2)
24otherSideType.Name = String.Empty 393.Where(Function(p) p.Name = simpleArgument.NameColonEquals.Name.Identifier.ValueText)
VisualBasicUnnecessaryImportsProvider.vb (1)
123Dim aliasSymbol = compilation.AliasImports.FirstOrDefault(Function(a) a.Name = clause.Alias.Identifier.ValueText)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.vb (2)
1067Function(m) m.Name = WellKnownMemberNames.ExplicitConversionName AndAlso m.Parameters(0).Type.Equals(gcHandleType)) 1076Function(m) m.Name = WellKnownMemberNames.ImplicitConversionName AndAlso m.Parameters(0).Type.Equals(_emptyCompilation.GetSpecialType(SpecialType.System_Byte)))
Microsoft.CodeAnalysis.Workspaces (314)
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);
AbstractMoveDeclarationNearReferenceService.cs (1)
221if (syntaxFacts.StringComparer.Equals(name, localSymbol.Name))
AbstractSemanticFactsService.cs (2)
82return GenerateUniqueName(baseName, filteredCandidates.Select(s => s.Name).Concat(usedNames)); 119return disposableType?.GetMembers().OfType<IMethodSymbol>().FirstOrDefault(m => m.Parameters.Length == 0 && m.Name == methodName);
AbstractSpeculationAnalyzer.cs (12)
411symbol.Name == newSymbol.Name && 416return symbol.Name == newSymbol.Name; 419return symbol.Name == newSymbol.Name; 426return symbol.Name == newSymbol.Name && 436return symbol.Name == newSymbol.Name && 1092var parameter1 = signature1Parameters.FirstOrDefault(p => p.Name == name); 1095var parameter2 = signature2Parameters.FirstOrDefault(p => p.Name == name);
AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
126symbol.Name == nameof(Enum.HasFlag) &&
CodeGenerationConstructorInfo.cs (1)
84=> info == null ? constructor.ContainingType.Name : info._typeName;
CodeGenerationDestructorInfo.cs (1)
53=> info == null ? constructor.ContainingType.Name : info._typeName;
CodeGenerationHelpers.cs (10)
55if (info.Context.GenerateMembers && info.Context.MergeNestedNamespaces && @namespace.Name != string.Empty) 58names.Add(@namespace.Name); 67names.Add(childNamespace.Name); 79name = @namespace.Name; 169: f1.Name.CompareTo(f2.Name); 402Name: "NullableAttribute" or "NullableContextAttribute" or "NativeIntegerAttribute" or "DynamicAttribute", 405Name: nameof(System.Runtime.CompilerServices), 408Name: nameof(System.Runtime), 411Name: nameof(System),
CodeGenerationNamedTypeSymbol.cs (1)
92return this.GetMembers().Select(m => m.Name).ToList();
CodeGenerationNamespaceOrTypeSymbol.cs (2)
34=> GetMembers().WhereAsArray(s => s.Name == name); 40=> GetTypeMembers().WhereAsArray(s => s.Name == name);
CodeGenerationNamespaceSymbol.cs (1)
46=> GetMembers().Where(m => m.Name == name);
CodeGenerationSymbolFactory.cs (6)
306name.HasValue ? name.Value : parameter.Name, 372accessor.Name, 533name ?? method.Name, 561name ?? property.Name, 584name ?? @event.Name, 601name ?? field.Name);
Editing\SymbolEditor.cs (3)
138if (!_assemblyNameToProjectIdMap.TryGetValue(assembly.Name, out var projectIds)) 275throw new ArgumentException(string.Format(WorkspacesResources.The_symbol_0_cannot_be_located_within_the_current_solution, argSymbol.Name)); 413throw new ArgumentException(string.Format(WorkspacesResources.The_member_0_is_not_declared_within_the_declaration_of_the_symbol, member.Name));
Editing\SyntaxGenerator.cs (16)
136field.Name, 178=> MethodDeclaration(method, method.Name, statements); 206decl = WithDefaultConstraint(decl, typeParameter.Name); 212decl = WithTypeConstraint(decl, typeParameter.Name, SpecialTypeConstraintKind.ReferenceType); 277=> method.Name switch 337symbol.Name, 400property.Name, 498symbol.Name, 536symbol.Name, 565constructorMethod.ContainingType != null ? constructorMethod.ContainingType.Name : "New", 774type.Name, 783type.Name, 790type.Name, 796type.Name, 804type.Name, 882declaration = this.WithTypeConstraint(declaration, tp.Name,
FindSymbols\FindReferences\BaseTypeFinder.cs (1)
29foreach (var member in type.GetMembers(symbol.Name))
FindSymbols\FindReferences\DependentProjectsFinder.cs (6)
202return attrType?.Name == nameof(InternalsVisibleToAttribute) && 203attrType.ContainingNamespace?.Name == nameof(System.Runtime.CompilerServices) && 204attrType.ContainingNamespace.ContainingNamespace?.Name == nameof(System.Runtime) && 205attrType.ContainingNamespace.ContainingNamespace.ContainingNamespace?.Name == nameof(System) && 272return HasReferenceToAssembly(project, symbolOrigination.assembly.Name, cancellationToken); 294symbol.Name == assemblyName)
FindSymbols\FindReferences\DependentTypeFinder.cs (2)
235await AddSourceTypesThatDeriveFromNameAsync(tempBuffer, type.Name).ConfigureAwait(false); 355var baseTypeName = metadataType.Name;
FindSymbols\FindReferences\Finders\AbstractMemberScopedReferenceFinder.cs (2)
60var tokens = await FindMatchingIdentifierTokensAsync(state, symbol.Name, cancellationToken).ConfigureAwait(false); 112if (TokensMatch(state, token, symbol.Name))
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (8)
239!syntaxFacts.StringComparer.Equals(aliasSymbol.Name, aliasSymbol.Target.Name)) 297symbol, localAliasSymbol.Name, state, cancellationToken).ConfigureAwait(false); 301if (TryGetNameWithoutAttributeSuffix(localAliasSymbol.Name, state.SyntaxFacts, out var simpleName)) 321aliasSymbol, aliasSymbol.Name, state, cancellationToken).ConfigureAwait(false); 325if (TryGetNameWithoutAttributeSuffix(aliasSymbol.Name, state.SyntaxFacts, out var simpleName)) 823additionalProperty = new KeyValuePair<string, string>(propertyName, symbol.Name); 894symbol, symbol.Name, state, cancellationToken);
FindSymbols\FindReferences\Finders\AbstractTypeParameterSymbolReferenceFinder.cs (1)
31var tokens = await FindMatchingIdentifierTokensAsync(state, symbol.Name, cancellationToken).ConfigureAwait(false);
FindSymbols\FindReferences\Finders\ConstructorInitializerSymbolReferenceFinder.cs (4)
50}, symbol.ContainingType.Name, cancellationToken); 67static (token, tuple) => TokensMatch(tuple.state, token, tuple.methodSymbol.ContainingType.Name, tuple.cancellationToken), 85return containingType != null && containingType.BaseType != null && containingType.BaseType.Name == typeName; 90return containingType != null && containingType.Name == typeName;
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (3)
32return GetAllMatchingGlobalAliasNamesAsync(project, containingType.Name, containingType.Arity, cancellationToken); 44var typeName = symbol.ContainingType.Name; 106var name = methodSymbol.ContainingType.Name;
FindSymbols\FindReferences\Finders\EventSymbolReferenceFinder.cs (1)
44var documentsWithName = await FindDocumentsAsync(project, documents, cancellationToken, symbol.Name).ConfigureAwait(false);
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.cs (2)
20=> symbol is { MethodKind: MethodKind.Conversion, Name: WellKnownMemberNames.ExplicitConversionName or WellKnownMemberNames.ImplicitConversionName } && 46var documentsWithName = await FindDocumentsAsync(project, documents, cancellationToken, underlyingNamedType.Name).ConfigureAwait(false);
FindSymbols\FindReferences\Finders\FieldSymbolReferenceFinder.cs (1)
37var documentsWithName = await FindDocumentsAsync(project, documents, cancellationToken, symbol.Name).ConfigureAwait(false);
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (3)
58return FindDocumentsAsync(project, documents, cancellationToken, symbol.Name, 59GetMemberNameWithoutInterfaceName(symbol.DeclaringMethod.Name), 60symbol.DeclaringMethod.ContainingType.Name);
FindSymbols\FindReferences\Finders\NamedTypeSymbolReferenceFinder.cs (4)
24return GetAllMatchingGlobalAliasNamesAsync(project, symbol.Name, symbol.Arity, cancellationToken); 62await AddDocumentsToSearchAsync(symbol.Name, project, documents, result, cancellationToken).ConfigureAwait(false); 147namedType, namedType.Name, state, nonAliasReferences, cancellationToken).ConfigureAwait(false); 154if (state.SyntaxFacts.StringComparer.Equals(namedType.Name, globalAlias))
FindSymbols\FindReferences\Finders\NamespaceSymbolReferenceFinder.cs (3)
25return GetAllMatchingGlobalAliasNamesAsync(project, symbol.Name, arity: 0, cancellationToken); 39? await FindDocumentsAsync(project, documents, cancellationToken, symbol.Name).ConfigureAwait(false) 72var namespaceName = symbol.Name;
FindSymbols\FindReferences\Finders\OrdinaryMethodReferenceFinder.cs (5)
68var ordinaryDocuments = await FindDocumentsAsync(project, documents, cancellationToken, methodSymbol.Name).ConfigureAwait(false); 102=> methodSymbol.Name is WellKnownMemberNames.GetEnumeratorMethodName or 106=> methodSymbol.Name == WellKnownMemberNames.DeconstructMethodName; 109=> methodSymbol.Name == WellKnownMemberNames.GetAwaiter; 112=> methodSymbol.Name == WellKnownMemberNames.CollectionInitializerAddMethodName;
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (6)
36return FindDocumentsAsync(project, documents, cancellationToken, symbol.Name); 45return FindReferencesInDocumentUsingIdentifierAsync(symbol, symbol.Name, state, cancellationToken); 135if (IdentifiersMatch(syntaxFacts, parameter.Name, token)) 157if (!syntaxFacts.TextMatch(methodSymbol1.Parameters[i].Name, methodSymbol2.Parameters[i].Name)) 217containingMethod.Name == WellKnownMemberNames.DelegateBeginInvokeName)
FindSymbols\FindReferences\Finders\PropertyAccessorSymbolReferenceFinder.cs (1)
44var documentsWithName = await FindDocumentsAsync(project, documents, cancellationToken, symbol.Name).ConfigureAwait(false);
FindSymbols\FindReferences\Finders\PropertySymbolReferenceFinder.cs (4)
82if (property.Name.Equals(parameter.Name) && 102var ordinaryDocuments = await FindDocumentsAsync(project, documents, cancellationToken, symbol.Name).ConfigureAwait(false); 121=> symbol.Name == WellKnownMemberNames.CurrentPropertyName;
FindSymbols\FindReferences\Finders\TypeParameterSymbolReferenceFinder.cs (2)
32return FindDocumentsAsync(project, documents, cancellationToken, symbol.Name, symbol.ContainingType.Name);
FindSymbols\FindReferences\FindReferencesSearchEngine_FindReferencesInDocuments.cs (1)
122state, symbol.Name, cancellationToken).ConfigureAwait(false);
FindSymbols\ReferencedSymbol.cs (1)
52return string.Format("{0}, {1} {2}", this.Definition.Name, count, count == 1 ? "ref" : "refs");
FindSymbols\SymbolFinder.cs (3)
248/// In order to be returned the other symbols must have the same <see cref="ISymbol.Name"/> and <see 291linkedSymbol.Name == symbol.Name)
FindSymbols\SymbolFinder_Helpers.cs (2)
210var candidateAssemblyName = candidate.ContainingAssembly.Name; 213if (assembly.Name == candidateAssemblyName)
FindSymbols\SymbolFinder_Hierarchy.cs (4)
52foreach (var m in type.GetMembers(symbol.Name)) 149? ((IMethodSymbol)symbol).AssociatedSymbol?.Name 150: symbol.Name; 157foreach (var interfaceMember in interfaceType.GetMembers(symbol.Name))
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (3)
131var globalNamespaceName = assembly.GlobalNamespace.Name; 206symbolMap.Add(childNamespaceOrType.Name, childNamespaceOrType); 213symbolMap.Add(childType.Name, childType);
IMethodSymbolExtensions.cs (2)
72=> symbol.Name switch 102=> methodSymbol.Name is WellKnownMemberNames.EntryPointMethodName or WellKnownMemberNames.TopLevelStatementsEntryPointMethodName &&
INamespaceOrTypeSymbolExtensions.cs (1)
81result.Add(namespaceOrTypeSymbol.Name);
IParameterSymbolExtensions.cs (1)
42foreach (var member in containingType.GetMembers(parameter.Name))
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs\INamedTypeSymbolExtensions.cs (3)
70return type.GetBaseTypesAndThis().SelectMany(t => t.GetMembers(symbol.Name)) 444if (namedParameter != null && seenNames.Add(namedParameter.Name)) 613Name: nameof(Equals),
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs\ISymbolExtensions.cs (14)
607=> symbol.Name == WellKnownMemberNames.GetAwaiter && 619if (!returnType.GetMembers().OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.IsCompleted && p.Type.SpecialType == SpecialType.System_Boolean && p.GetMethod != null)) 633if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }])) 637return methods.Any(m => m.Name == WellKnownMemberNames.GetResult && !m.Parameters.Any()); 641=> symbol.Name == WellKnownMemberNames.GetEnumeratorMethodName && 658if (!members.OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.CurrentPropertyName && p.GetMethod != null)) 668Name: WellKnownMemberNames.MoveNextMethodName, 681=> symbol.Name == WellKnownMemberNames.GetAsyncEnumeratorMethodName && 698if (!members.OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.CurrentPropertyName && p.GetMethod != null)) 707if (!members.OfType<IMethodSymbol>().Any(x => x.Name == WellKnownMemberNames.MoveNextAsyncMethodName)) 733=> symbol.Name.StartsWith("_") && 734(symbol.Name.Length == 1 || uint.TryParse(symbol.Name[1..], out _)); 745ContainingNamespace.Name: nameof(System),
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs\ITypeSymbolExtensions.cs (3)
234b.ContainingNamespace.Name == "System" && 249&& symbol.ContainingNamespace?.Name == "System" 703if (attributeData.AttributeClass?.Name == nameof(ReferenceAssemblyAttribute)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\INamedTypeSymbolExtensions.cs\INamedTypeSymbolExtensions.cs (1)
26namedType.Name,
NamingStyleRules.cs (1)
100var implementedInterfaceMembersWithSameName = implementedInterface.GetMembers(symbol.Name);
ReassignedVariable\AbstractReassignedVariableService.cs (2)
194else if (parameter.ContainingSymbol.Name == WellKnownMemberNames.TopLevelStatementsEntryPointMethodName) 260if (!syntaxFacts.StringComparer.Equals(idToken.ValueText, localOrParameter.Name))
Recommendations\AbstractRecommendationServiceRunner.cs (1)
239parameterType = method.Parameters.FirstOrDefault(p => _stringComparerForLanguage.Equals(p.Name, argumentName))?.Type;
Rename\ConflictEngine\ConflictResolver.cs (4)
106return new ConflictResolution(string.Format(WorkspacesResources.Symbol_0_is_not_from_source, renameLocations.Symbol.Name)); 244var otherThingsNamedTheSame = renamedSymbol.ContainingType.GetMembers(renamedSymbol.Name) 269var otherThingsNamedTheSame = ((INamespaceSymbol)renamedSymbol.ContainingSymbol).GetMembers(renamedSymbol.Name) 279var otherThingsNamedTheSame = ((INamespaceOrTypeSymbol)renamedSymbol.ContainingSymbol).GetMembers(renamedSymbol.Name)
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
60_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)
111if (symbol is null || WorkspacePathUtilities.TypeNameMatchesDocumentName(documentWithNewName, symbol.Name)) 120symbol.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 && 206token.ValueText == referencedSymbol.Name) 278if (location.Alias.Name == referencedSymbol.Name) 323var renameText = originalSymbol.Name;
Shared\Extensions\IFindReferencesResultExtensions.cs (2)
129!comparer.Equals(reference.Definition.Name, symbol.Name))
Shared\Extensions\IMethodSymbolExtensions.cs (13)
60if (method.TypeParameters.Select(t => t.Name).SequenceEqual(newNames)) 83method.Name, 86CodeGenerationSymbolFactory.CreateParameterSymbol(p.GetAttributes(), p.RefKind, p.IsParams, p.Type.SubstituteTypes(mapping, typeGenerator), p.Name, p.IsOptional, 94if (parameterList.Select(p => p.Name).SequenceEqual(parameterNames)) 109method.Name, 161method.Parameters.SelectAsArray(p => p.Name), isCaseSensitive: syntaxFacts.IsCaseSensitive); 165.Select(tp => tp.Name) 166.Concat(method.Name) 167.Concat(containingType.Name); 173method.TypeParameters.SelectAsArray(tp => tp.Name), 207p.RefKind, p.IsParams, p.Type, p.Name, p.IsOptional, 231!method1.Parameters.Select(p => p.Name).SequenceEqual(method2.Parameters.Select(p => p.Name)))
Shared\Extensions\INamespaceSymbolExtensions.cs (1)
37result.Add(namespaceSymbol.Name);
Shared\Extensions\IParameterSymbolExtensions.cs (2)
18return parameter.Name == parameterName 40parameter.Name,
Shared\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,
Shared\Extensions\ISymbolExtensions.cs (1)
437var 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 (3)
100await constructedInterface.GetMembers(interfaceMember.Name).FirstOrDefaultAsync( 172from member in baseType.GetMembers(constructedInterfaceMember.Name).OfType<TSymbol>() 186return type?.RemoveUnavailableTypeParameters(compilation, availableTypeParameters.Select(t => t.Name).ToSet());
Shared\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
83symbol = updatedContainingType.GetTypeMembers(symbol.Name, symbol.Arity).First(m => m.TypeKind == symbol.TypeKind);
Shared\Extensions\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
73if (_availableTypeParameterNames.Contains(symbol.Name))
Shared\Extensions\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
46if (symbol.IsErrorType() && symbol.Name == string.Empty)
Shared\Extensions\SemanticModelExtensions.cs (1)
62var mapped = containingType.GetMembers(methodSymbol.Name)
Shared\Extensions\SyntaxGeneratorExtensions.cs (26)
109TryGetValue(parameterToNewFieldMap, parameter.Name, out var fieldName)) 131TryGetValue(parameterToNewPropertyMap, parameter.Name, out var propertyName)) 166value = symbol.Name; 182factory.IdentifierName(parameter.Name))).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation); 190var condition = factory.CreateNullCheckExpression(semanticModel, parameter.Name); 228var parameterName = parameter.Name; 296factory.IdentifierName(parameter.Name)))); 306factory.IdentifierName(parameter.Name), 355var getName = overriddenProperty.GetMethod?.Name; 356var setName = overriddenProperty.SetMethod?.Name; 383codeFactory.IdentifierName(overriddenProperty.Name)), codeFactory.CreateArguments(overriddenProperty.Parameters)))); 390codeFactory.IdentifierName(overriddenProperty.Name)), codeFactory.CreateArguments(overriddenProperty.Parameters)), 402codeFactory.IdentifierName(overriddenProperty.Name)))); 408codeFactory.IdentifierName(overriddenProperty.Name)), 440name: overriddenProperty.Name, 463name: overriddenEvent.Name); 532? codeFactory.IdentifierName(overriddenMethod.Name) 533: codeFactory.GenericName(overriddenMethod.Name, typeParams)), 561? generator.GenericName(method.Name, method.TypeArguments) 562: generator.IdentifierName(method.Name); 582through, generator.IdentifierName(throughMember.Name)); 630generator.IdentifierName(explicitlyImplementedProperty.Name)); 644? factory.GenericName(classOrStructType.Name, classOrStructType.TypeArguments) 645: factory.IdentifierName(classOrStructType.Name); 659throughExpression, generator.IdentifierName(property.Name)); 683throughExpression, generator.IdentifierName(property.Name));
Shared\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
222var symbolNameExpression = factory.IdentifierName(member.Name); 361var name = containingType.Name;
Shared\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))
SymbolEquivalenceComparer.AssemblyComparers.cs (3)
16=> AssemblyIdentityComparer.SimpleNameComparer.Equals(x?.Name, y?.Name); 23return AssemblyIdentityComparer.SimpleNameComparer.GetHashCode(obj.Name);
SymbolEquivalenceComparer.EquivalenceVisitor.cs (27)
156x.Name == y.Name && 164x.Name == y.Name && 211x.Name != y.Name) 280=> AssembliesAreEquivalent(x.ContainingAssembly, y.ContainingAssembly) && x.Name == y.Name; 346x.Name != y.Name || 363if (xNamespace.Name != yNamespace.Name) 368if (xNamespace.Name == "") 386!AssemblyIdentityComparer.SimpleNameComparer.Equals(x.ContainingAssembly.Name, y.ContainingAssembly.Name) && 422if (xElement.Name != yElement.Name) 522if (p1.Name != p2.Name || 537x.Name != y.Name) 555x.Name == y.Name && 596x.Name == y.Name && 644=> x.Name == y.Name;
SymbolEquivalenceComparer.GetHashCodeVisitor.cs (11)
95Hash.Combine(x.Name, 102Hash.Combine(x.Name, 127Hash.Combine(x.Name, currentHash))))))); 144=> CombineHashCodes(x.ContainingAssembly, Hash.Combine(x.Name, currentHash)); 177Hash.Combine(x.Name, 205return Hash.Combine(p.Name, 217return Hash.Combine(x.Name, currentHash); 222Hash.Combine(x.Name, 230Hash.Combine(x.Name, 246Hash.Combine(x.Name, 256Hash.Combine(x.Name,
SymbolEquivalenceComparer.ParameterSymbolEqualityComparer.cs (4)
48x.Name == y.Name 49: string.Equals(x.Name, y.Name, StringComparison.OrdinalIgnoreCase);
SymbolKey.AliasSymbolKey.cs (2)
19visitor.WriteString(symbol.Name); 67if (aliasSymbol.Name == name &&
SymbolKey.AnonymousTypeSymbolKey.cs (1)
24var propertyNames = properties.SelectAsArray(p => p.Name);
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))
SymbolKey.BuiltinOperatorSymbolKey.cs (1)
19visitor.WriteString(symbol.Name);
SymbolKey.cs (1)
75/// cref="SyntaxTree"/> is enumerated to list all the symbols with the same <see cref="ISymbol.Name"/> and <see
SymbolKey.ErrorTypeSymbolKey.cs (3)
19visitor.WriteString(symbol.Name); 56while (namespaceSymbol != null && namespaceSymbol.Name != "") 58builder.Add(namespaceSymbol.Name);
SymbolKey.NamedTypeSymbolKey.cs (2)
21visitor.WriteString(symbol.Name); 110if (errorType.Name != name || errorType.Arity != arity)
SymbolKey.TupleTypeSymbolKey.cs (1)
31friendlyNames.Add(element.IsImplicitlyDeclared ? null : element.Name);
SyntaxGeneratorExtensions.cs (1)
55return factory.Argument(parameter.RefKind, factory.IdentifierName(parameter.Name));
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);
SyntaxGeneratorExtensions_Negate.cs (1)
418if (property.Name is nameof(Array.Length) or nameof(Array.LongLength))
Workspace\Solution\SolutionState.SymbolToProjectId.cs (2)
46$"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}"); 57$"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)
1895Assert.Contains(attrs, ad => ad.AttributeClass.Name == "MyAttribute"); 1918Assert.DoesNotContain(attrs, ad => ad.AttributeClass.Name == "MyAttribute"); 1942Assert.Contains(attrs, ad => ad.AttributeClass.Name == "MyAttr"); 1965Assert.DoesNotContain(attrs, ad => ad.AttributeClass.Name == "MyAttr");
Microsoft.CodeAnalysis.Workspaces.UnitTests (66)
FindReferencesTests.cs (2)
482var refsFromVirtualSorted = refsFromVirtual.Select(r => r.Definition).OrderBy(r => r.ContainingType.Name).ToArray(); 483var refsFromOverrideSorted = refsFromOverride.Select(r => r.Definition).OrderBy(r => r.ContainingType.Name).ToArray();
SolutionTests\SolutionTests.cs (1)
2304where symbol.Name.Equals("Enumerable")
SymbolKeyTests.cs (34)
689var outer = GetDeclaredSymbols(compilation).OfType<INamedTypeSymbol>().First(s => s.Name == "A"); 712var a = GetDeclaredSymbols(compilation).OfType<INamedTypeSymbol>().Single(s => s.Name == "A"); 714var a_b_m = a_b.GetMembers().Single(s => s.Name == "M"); 722var a_string_b_m = a_string_b.GetMembers().Single(s => s.Name == "M"); 728var a_string_b_int_m = a_string_b_int.GetMembers().Single(s => s.Name == "M"); 736var a_b_int_m = a_b_int.GetMembers().Single(s => s.Name == "M"); 812var xSymbol = testModel.LookupSymbols(position).First(s => s.Name == "x"); 859var xSymbol = testModel.LookupSymbols(position).First(s => s.Name == "x"); 963Assert.Equal(symbol.Name, found.Name); 1000Assert.Equal(symbol.Name, found.Name); 1036Assert.Equal(propType.Name, found.Name); 1071Assert.Equal(propType.Name, found.Name); 1108Assert.Equal("Collections", propType.ContainingNamespace.Name); 1109Assert.Equal("System", propType.ContainingNamespace.ContainingNamespace.Name); 1120Assert.Equal(propType.Name, found.Name); 1122Assert.Equal(propType.ContainingNamespace.Name, found.ContainingNamespace.Name); 1155Assert.Equal("Collections", propType.ContainingNamespace.Name); 1156Assert.Equal("System", propType.ContainingNamespace.ContainingNamespace.Name); 1167Assert.Equal(propType.Name, found.Name); 1169Assert.Equal(propType.ContainingNamespace.Name, found.ContainingNamespace.Name); 1219Assert.Equal(symbol.Name, found.Name); 1231Assert.Equal(symbol.Name, found.Name); 1358Assert.Equal(resolved.Symbol.Name, symbol.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.VisualStudio.LanguageServices (56)
CallHierarchy\Finders\AbstractCallFinder.cs (1)
41this.SymbolName = symbol.Name;
ChangeSignature\ChangeSignatureDialogViewModel.ParameterViewModels.cs (1)
218public override string ParameterName => ParameterSymbol.Name;
ExtractClass\VisualStudioExtractClassOptionsService.cs (2)
72var conflictingTypeNames = selectedType.ContainingNamespace.GetAllTypes(cancellationToken).Select(t => t.Name); 73var candidateName = selectedType.Name + "Base";
Library\ObjectBrowser\AbstractListItemFactory.cs (1)
663builder.Add(new ReferenceListItem(parentListItem.ProjectId, assemblySymbol.Name, reference));
MoveStaticMembers\VisualStudioMoveStaticMembersOptionsService.cs (3)
118var candidateName = selectedType.Name + "Helpers"; 183(currentType.Name != t.Name || GetFile(l) != currentDocument.FilePath))
Progression\GraphBuilder.cs (9)
355commonLabel.Append(typeSymbol.Name); 357commonLabel.Append(string.Join(", ", typeSymbol.TypeParameters.Select(t => t.Name))); 365node.Label = symbol.Name; 374node.Label = CodeQualifiedIdentifierBuilder.SpecialNames.GetConstructorLabel(methodSymbol.ContainingSymbol.Name); 378node.Label = CodeQualifiedIdentifierBuilder.SpecialNames.GetStaticConstructorLabel(methodSymbol.ContainingSymbol.Name); 382node.Label = CodeQualifiedIdentifierBuilder.SpecialNames.GetFinalizerLabel(methodSymbol.ContainingSymbol.Name); 386node.Label = methodSymbol.Name; 398node.Label = symbol.Name.Replace("[]", string.Empty); 409node.Label = symbol.Name;
Progression\GraphNodeIdCreation.cs (10)
159return GraphNodeId.GetPartial(nodeName, namedType.Name); 174partials.Add(GraphNodeId.GetPartial(CodeQualifiedName.Name, namedType.Name)); 224partials.Add(GraphNodeId.GetPartial(CodeQualifiedName.Name, pointerType.PointedAtType.Name)); 247partials.Add(GraphNodeId.GetPartial(CodeQualifiedName.Name, underlyingType.Name)); 470if (property.Parameters.Any(static (p, symbol) => p.Name == symbol.Name, symbol)) 479return memberId + GraphNodeId.GetPartial(CodeGraphNodeIdName.Parameter, symbol.Name); 498builder.LocalVariable = symbol.Name; 542if (current != null && current.Name == symbol.Name && (current.Kind == SymbolKind.Local || current.Kind == SymbolKind.RangeVariable))
Progression\SymbolContainment.cs (2)
50!string.IsNullOrEmpty(symbol.Name) && 92if (!string.IsNullOrEmpty(member.Name))
ProjectSystem\AbstractEntryPointFinder.cs (1)
39if (!MatchesMainMethodName(symbol.Name))
PullMemberUp\WarningDialog\PullMemberUpWarningViewModel.cs (3)
31warningMessagesBuilder.Add(string.Format(ServicesVSResources._0_will_be_changed_to_abstract, options.Destination.Name)); 39warningMessagesBuilder.Add(string.Format(ServicesVSResources._0_will_be_changed_to_public, result.Member.Name)); 45warningMessagesBuilder.Add(string.Format(ServicesVSResources._0_will_be_changed_to_non_static, result.Member.Name));
Snippets\AbstractSnippetExpansionClient.cs (14)
565_state._methodNameForInsertFullMethodCall = methodSymbols.First().Name; 658template.Append('$').Append(parameter.Name).Append('$'); 661new XElement(snippetNamespace + "ID", new XText(parameter.Name)), 662new XElement(snippetNamespace + "Default", new XText(parameterValues.GetValueOrDefault(parameter.Name, ""))))); 790if (_state._methodNameForInsertFullMethodCall != method.Name) 840var firstField = _state._method?.Parameters.FirstOrDefault()?.Name ?? PlaceholderSnippetField; 850var lastField = _state._method?.Parameters.LastOrDefault()?.Name ?? PlaceholderSnippetField; 877newArguments = newArguments.SetItem(method.Parameters[0].Name, placeholderValue); 890if (ExpansionSession.GetFieldValue(previousParameter.Name, out var previousValue) == VSConstants.S_OK) 892newArguments = newArguments.SetItem(previousParameter.Name, previousValue); 903newArguments.TryGetValue(parameter.Name, out var value); 920newArguments = newArguments.SetItem(parameter.Name, value); 923var snippet = CreateMethodCallSnippet(method.Name, includeMethod: false, method.Parameters, newArguments); 930_state._methodNameForInsertFullMethodCall = method.Name;
Utilities\MemberSymbolViewModel.cs (1)
20public string MakeAbstractCheckBoxAutomationText => string.Format(ServicesVSResources.Make_0_abstract, Symbol.Name);
Venus\ContainedLanguageCodeSupport.cs (7)
70var reservedNames = semanticModel.LookupSymbols(point.Value.Position, type).Select(m => m.Name); 110return methods.Select(m => Tuple.Create(m.Name, ConstructMemberId(m))); 309return members.Select(m => Tuple.Create(m.Name, ConstructMemberId(m))); 338var undoTitle = string.Format(EditorFeaturesResources.Rename_0_to_1, symbol.Name, newName); 438ns = ns.GetNamespaceMembers().SingleOrDefault(n => n.Name == parts[i]); 455return string.Format("{0}({1})", member.Name, string.Join(",", ((IMethodSymbol)member).Parameters.Select(p => p.Type.ToDisplayString()))); 459return member.Name + "(EVENT)";
Workspace\VisualStudioSymbolRenamedCodeActionOperationFactoryWorkspaceService.cs (1)
84public override string Title => string.Format(EditorFeaturesResources.Rename_0_to_1, _symbol.Name, _newName);
Microsoft.VisualStudio.LanguageServices.CSharp (14)
CodeModel\CSharpCodeModelService.cs (1)
687if (SyntaxFactsService.IsValidIdentifier(typeSymbol.Name))
CodeModel\CSharpCodeModelService_Prototype.cs (7)
91AppendDelegatePrototype(builder, symbol, flags, symbol.Name); 133AppendEventPrototype(builder, symbol, flags, symbol.Name); 154AppendFunctionPrototype(builder, symbol, flags, symbol.Name); 196AppendPropertyPrototype(builder, symbol, flags, symbol.Name); 238AppendVariablePrototype(builder, symbol, flags, symbol.Name); 551builder.Append(parameter.Name); 584builder.Append(current.Name);
ObjectBrowser\DescriptionBuilder.cs (6)
205switch (methodSymbol.Name) 353AddName(typeParameterSymbol.Name); 440AddParam(current.Name); 472AddName(fieldSymbol.Name); 491AddName(propertySymbol.Name); 528AddName(eventSymbol.Name);
Microsoft.VisualStudio.LanguageServices.Implementation (9)
CodeModel\Collections\ExternalOverloadsCollection.cs (1)
60foreach (var method in symbol.ContainingType.GetMembers(symbol.Name))
CodeModel\Collections\ExternalParameterCollection.cs (1)
69var index = parameters.IndexOf(p => p.Name == name);
CodeModel\Collections\ExternalTypeCollection.cs (1)
54var index = _typeSymbols.IndexOf(t => t.Name == name);
CodeModel\Collections\OverloadsCollection.cs (1)
64foreach (var method in symbol.ContainingType.GetMembers(symbol.Name))
CodeModel\ExternalElements\ExternalCodeFunction.cs (1)
79var methodsOfName = symbol.ContainingType.GetMembers(symbol.Name)
CodeModel\FileCodeModel_CodeGen.cs (1)
756return typeSymbol.Name;
CodeModel\InternalElements\CodeFunction.cs (1)
128var methodsOfName = symbol.ContainingType.GetMembers(symbol.Name)
CodeModel\MetadataNameHelpers.cs (2)
17=> builder.Append(namespaceSymbol.Name); 21builder.Append(namedTypeSymbol.Name);
Microsoft.VisualStudio.LanguageServices.UnitTests (4)
CommonControls\NewTypeDestinationSelectionViewModelTests.vb (1)
245conflictingNames:=symbol.ContainingNamespace.GetAllTypes(CancellationToken.None).SelectAsArray(Function(t) t.Name),
MoveStaticMembers\MoveStaticMembersViewModelTest.vb (3)
54Dim member = memberArray.FirstOrDefault(Function(memberViewModel) memberViewModel.Symbol.Name.Equals(name)) 278If member.Symbol.Name <> "Barbar" Then 652If member.Symbol.Name <> "Barbar" Then
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)
448If symbol.Name.Equals("My", StringComparison.CurrentCultureIgnoreCase) Then 451result = "vb." + symbol.Name
ObjectBrowser\DescriptionBuilder.vb (6)
128Select Case methodSymbol.Name 228AddText(fieldSymbol.Name) 257AddName(propertySymbol.Name) 274AddName(eventSymbol.Name) 400AddParam(current.Name) 428AddName(current.Name)
Roslyn.Compilers.VisualBasic.IOperation.UnitTests (11)
IOperation\IOperationTests.vb (11)
71Assert.Equal(DirectCast(left1, ILocalReferenceOperation).Local.Name, "x") 102Assert.Equal(add2.OperatorMethod.Name, "op_Addition") 105Assert.Equal(DirectCast(left2, ILocalReferenceOperation).Local.Name, "x") 108Assert.Equal(DirectCast(right2, ILocalReferenceOperation).Local.Name, "y") 137Assert.Equal(DirectCast(operand3, ILocalReferenceOperation).Local.Name, "x") 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)