14 interfaces inheriting from ISymbol
Microsoft.CodeAnalysis (14)
Symbols\IAliasSymbol.cs (1)
16public interface IAliasSymbol : ISymbol
Symbols\IAssemblySymbol.cs (1)
18public interface IAssemblySymbol : ISymbol
Symbols\IDiscardSymbol.cs (1)
13public interface IDiscardSymbol : ISymbol
Symbols\IEventSymbol.cs (1)
17public interface IEventSymbol : ISymbol
Symbols\IFieldSymbol.cs (1)
17public interface IFieldSymbol : ISymbol
Symbols\ILabelSymbol.cs (1)
16public interface ILabelSymbol : ISymbol
Symbols\ILocalSymbol.cs (1)
14public interface ILocalSymbol : ISymbol
Symbols\IMethodSymbol.cs (1)
19public interface IMethodSymbol : ISymbol
Symbols\IModuleSymbol.cs (1)
17public interface IModuleSymbol : ISymbol
Symbols\INamespaceOrTypeSymbol.cs (1)
18public interface INamespaceOrTypeSymbol : ISymbol
Symbols\IParameterSymbol.cs (1)
18public interface IParameterSymbol : ISymbol
Symbols\IPreprocessingSymbol.cs (1)
14public interface IPreprocessingSymbol : ISymbol
Symbols\IPropertySymbol.cs (1)
17public interface IPropertySymbol : ISymbol
Symbols\IRangeVariableSymbol.cs (1)
16public interface IRangeVariableSymbol : ISymbol
7 implementations of ISymbol
Analyzer.Utilities.UnitTests (1)
Lightup\LightupHelpersTests.cs (1)
98private sealed class EmptySymbol : ISymbol
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
22internal abstract class CodeGenerationSymbol : ISymbol
Microsoft.CodeAnalysis.CSharp (2)
Symbols\PublicModel\Symbol.cs (1)
15internal abstract class Symbol : ISymbol
Symbols\PublicModel\TypeSymbol.cs (1)
12internal abstract class TypeSymbol : NamespaceOrTypeSymbol, ISymbol, ITypeSymbol
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
16private abstract class AbstractWrappedSymbol : ISymbol
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Symbol.vb (1)
25Implements ISymbol, ISymbolInternal, IFormattable
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
22internal abstract class CodeGenerationSymbol : ISymbol
8477 references to ISymbol
Analyzer.Utilities.UnitTests (42)
FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysisTests.cs (1)
74ISymbol? symbol = model.GetDeclaredSymbol(syntaxNode.Parent) ?? model.GetSymbolInfo(syntaxNode.Parent).Symbol;
Lightup\LightupHelpersTests.cs (38)
48var propertyAccessor = LightupHelpers.CreateSymbolPropertyAccessor<ISymbol, object>(type, "NonExistentProperty", fallbackResult); 53var withPropertyAccessor = LightupHelpers.CreateSymbolWithPropertyAccessor<ISymbol, object>(type, "NonExistentProperty", fallbackResult); 100SymbolKind ISymbol.Kind => throw new NotImplementedException(); 101string ISymbol.Language => throw new NotImplementedException(); 102string ISymbol.Name => throw new NotImplementedException(); 103string ISymbol.MetadataName => throw new NotImplementedException(); 104ISymbol ISymbol.ContainingSymbol => throw new NotImplementedException(); 105IAssemblySymbol ISymbol.ContainingAssembly => throw new NotImplementedException(); 106IModuleSymbol ISymbol.ContainingModule => throw new NotImplementedException(); 107INamedTypeSymbol ISymbol.ContainingType => throw new NotImplementedException(); 108INamespaceSymbol ISymbol.ContainingNamespace => throw new NotImplementedException(); 109bool ISymbol.IsDefinition => throw new NotImplementedException(); 110bool ISymbol.IsStatic => throw new NotImplementedException(); 111bool ISymbol.IsVirtual => throw new NotImplementedException(); 112bool ISymbol.IsOverride => throw new NotImplementedException(); 113bool ISymbol.IsAbstract => throw new NotImplementedException(); 114bool ISymbol.IsSealed => throw new NotImplementedException(); 115bool ISymbol.IsExtern => throw new NotImplementedException(); 116bool ISymbol.IsImplicitlyDeclared => throw new NotImplementedException(); 117bool ISymbol.CanBeReferencedByName => throw new NotImplementedException(); 118ImmutableArray<Location> ISymbol.Locations => throw new NotImplementedException(); 119ImmutableArray<SyntaxReference> ISymbol.DeclaringSyntaxReferences => throw new NotImplementedException(); 120Accessibility ISymbol.DeclaredAccessibility => throw new NotImplementedException(); 121ISymbol ISymbol.OriginalDefinition => throw new NotImplementedException(); 122bool ISymbol.HasUnsupportedMetadata => throw new NotImplementedException(); 124void ISymbol.Accept(SymbolVisitor visitor) 127TResult ISymbol.Accept<TResult>(SymbolVisitor<TResult> visitor) 130public bool Equals(ISymbol? other) 133ImmutableArray<AttributeData> ISymbol.GetAttributes() 136string ISymbol.GetDocumentationCommentId() 139string ISymbol.GetDocumentationCommentXml(CultureInfo? preferredCulture, bool expandIncludes, CancellationToken cancellationToken) 142ImmutableArray<SymbolDisplayPart> ISymbol.ToDisplayParts(SymbolDisplayFormat? format) 145string ISymbol.ToDisplayString(SymbolDisplayFormat? format) 148ImmutableArray<SymbolDisplayPart> ISymbol.ToMinimalDisplayParts(SemanticModel semanticModel, int position, SymbolDisplayFormat? format) 151string ISymbol.ToMinimalDisplayString(SemanticModel semanticModel, int position, SymbolDisplayFormat? format) 154public bool Equals(ISymbol? other, SymbolEqualityComparer equalityComparer)
Options\SymbolNamesWithValueOptionTests.cs (3)
366var symbol = FindSymbol(compilation, symbolName); 376static ISymbol FindSymbol(Compilation compilation, string symbolName) 402foreach (var member in innerClassSymbol.GetMembers())
ConfigurationSchemaGenerator (7)
ConfigSchemaEmitter.cs (2)
346private string? GetDocComment(ISymbol? symbol) 372.GetMethod("GetDocumentationComment", BindingFlags.Public | BindingFlags.Static, [typeof(ISymbol), typeof(Compilation), typeof(CultureInfo), typeof(bool), typeof(bool), typeof(CancellationToken)])!;
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (3)
666ImmutableArray<ISymbol> members = current.GetMembers(); 667foreach (ISymbol member in members) 954foreach (var throwIfNullMethod in throwIfNullMethods)
RuntimeSource\Configuration.Binder\Specs\Members\MemberSpec.cs (1)
12public MemberSpec(ISymbol member, TypeRef typeRef)
RuntimeSource\Roslyn\GetBestTypeByMetadataName.cs (1)
94private static SymbolVisibility GetResultantVisibility(this ISymbol symbol)
IdeCoreBenchmarks (2)
FindReferencesBenchmarks.cs (1)
30ISymbol _type;
RenameBenchmarks.cs (1)
22private ISymbol _symbol;
ILLink.CodeFixProvider (13)
BaseAttributeCodeFixProvider.cs (4)
68 var attributableSymbol = model.GetDeclaredSymbol (attributableNode, cancellationToken); 129 ISymbol? attributableSymbol, 130 ISymbol targetSymbol, 134 protected static bool HasPublicAccessibility (ISymbol? m)
RequiresAssemblyFilesCodeFixProvider.cs (2)
35 protected override SyntaxNode[] GetAttributeArguments (ISymbol? attributableSymbol, ISymbol targetSymbol, SyntaxGenerator syntaxGenerator, Diagnostic diagnostic) =>
RequiresDynamicCodeCodeFixProvider.cs (2)
32 protected override SyntaxNode[] GetAttributeArguments (ISymbol? attributableSymbol, ISymbol targetSymbol, SyntaxGenerator syntaxGenerator, Diagnostic diagnostic) =>
RequiresHelpers.cs (1)
13 internal static SyntaxNode[] GetAttributeArgumentsForRequires (ISymbol targetSymbol, SyntaxGenerator syntaxGenerator, bool hasPublicAccessibility)
RequiresUnreferencedCodeCodeFixProvider.cs (2)
32 protected override SyntaxNode[] GetAttributeArguments (ISymbol? attributableSymbol, ISymbol targetSymbol, SyntaxGenerator syntaxGenerator, Diagnostic diagnostic) =>
UnconditionalSuppressMessageCodeFixProvider.cs (2)
40 protected override SyntaxNode[] GetAttributeArguments (ISymbol? attributableSymbol, ISymbol targetSymbol, SyntaxGenerator syntaxGenerator, Diagnostic diagnostic)
ILLink.RoslynAnalyzer (112)
COMAnalyzer.cs (1)
60 static bool IsComInterop (ISymbol symbol)
CompilationExtensions.cs (1)
79 private static SymbolVisibility GetResultantVisibility (this ISymbol symbol)
DataFlow\DynamicallyAccessedMembersBinder.cs (10)
17 public static IEnumerable<ISymbol> GetDynamicallyAccessedMembers (this ITypeSymbol typeDefinition, DynamicallyAccessedMemberTypes memberTypes, bool declaredOnly = false) 23 var members = new List<ISymbol> (); 25 foreach (var m in members) 75 var members = new List<ISymbol> (); 77 foreach (var m in members) 86 var members = new List<ISymbol> (); 88 foreach (var m in members) 375 public static void GetAllOnType (this ITypeSymbol type, bool declaredOnly, List<ISymbol> members) => GetAllOnType (type, declaredOnly, members, new HashSet<ITypeSymbol> (SymbolEqualityComparer.Default)); 378 static void GetAllOnType (ITypeSymbol type, bool declaredOnly, List<ISymbol> members, HashSet<ITypeSymbol> types) 410 foreach (var member in type.GetMembers ()) {
DataFlow\LocalDataFlowAnalysis.cs (2)
96 void AnalyzeAttribute (ISymbol owningSymbol, IAttributeOperation attribute) 117 ISymbol owningSymbol,
DataFlow\LocalDataFlowVisitor.cs (2)
43 protected readonly ISymbol OwningSymbol; 62 ISymbol owningSymbol,
DataFlow\MethodBodyValue.cs (2)
17 public ISymbol OwningSymbol { get; } 21 public MethodBodyValue (ISymbol owningSymbol, ControlFlowGraph cfg)
DataFlowAnalyzerContext.cs (4)
13 private readonly Dictionary<RequiresAnalyzerBase, ImmutableArray<ISymbol>> _enabledAnalyzers; 17 public ImmutableArray<ISymbol> GetSpecialIncompatibleMembers (RequiresAnalyzerBase analyzer) 31 Dictionary<RequiresAnalyzerBase, ImmutableArray<ISymbol>> enabledAnalyzers, 42 var enabledAnalyzers = new Dictionary<RequiresAnalyzerBase, ImmutableArray<ISymbol>> ();
DynamicallyAccessedMembersAnalyzer.cs (8)
150 static void VerifyMemberOnlyApplyToTypesOrStrings (SymbolAnalysisContext context, ISymbol member) 171 if (methodSymbol.TryGetOverriddenMember (out var overriddenSymbol) && overriddenSymbol is IMethodSymbol overriddenMethod 177 static void VerifyDamOnMethodsMatch (SymbolAnalysisContext context, IMethodSymbol overrideMethod, IMethodSymbol baseMethod, ISymbol? origin = null) 194 var returnOrigin = origin ??= overrideMethod; 216 var parameterOrigin = origin ?? overrideParam.ParameterSymbol; 240 var typeParameterOrigin = origin ?? overrideMethod.TypeParameters[i]; 253 var methodOrigin = origin ?? overrideMethod; 266 ISymbol origin = implementationMethod;
ImmutableArrayOperations.cs (4)
23 internal static TSymbol? TryGetSingleSymbol<TSymbol> (ImmutableArray<ISymbol> members) where TSymbol : class, ISymbol 26 foreach (var m in members) { 38 internal static void AddIfNotNull<TSymbol> (ImmutableArray<TSymbol>.Builder properties, TSymbol? p) where TSymbol : class, ISymbol
INamedTypeSymbolExtensions.cs (6)
33 internal static IEnumerable<(ISymbol InterfaceMember, ISymbol ImplementationMember)> GetMemberInterfaceImplementationPairs (this INamedTypeSymbol namedType) 43 private static IEnumerable<(ISymbol InterfaceMember, ISymbol ImplementationMember)> GetMatchingMembers (INamedTypeSymbol implementationSymbol, INamedTypeSymbol interfaceSymbol) 46 foreach (ISymbol interfaceMember in members) { 47 if (implementationSymbol.FindImplementationForInterfaceMember (interfaceMember) is ISymbol implementationMember) {
IOperationExtensions.cs (4)
17 public static ValueUsageInfo GetValueUsageInfo (this IOperation operation, ISymbol containingSymbol) 175 public static RefKind GetRefKind (this IReturnOperation operation, ISymbol containingSymbol) 252 public static ISymbol FindContainingSymbol (this IOperation operation, ISymbol owningSymbol)
ISymbolExtensions.cs (12)
20 internal static bool HasAttribute (this ISymbol symbol, string attributeName) 29 internal static bool TryGetAttribute (this ISymbol member, string attributeName, [NotNullWhen (returnValue: true)] out AttributeData? attribute) 42 internal static IEnumerable<AttributeData> GetAttributes (this ISymbol member, string attributeName) 56 internal static DynamicallyAccessedMemberTypes GetDynamicallyAccessedMemberTypes (this ISymbol symbol) 104 methodSymbol.AssociatedSymbol is ISymbol associatedSymbol ? GetDynamicallyAccessedMemberTypes (associatedSymbol) : DynamicallyAccessedMemberTypes.None; 106 internal static bool TryGetOverriddenMember (this ISymbol? symbol, [NotNullWhen (returnValue: true)] out ISymbol? overriddenMember) 135 public static string GetDisplayName (this ISymbol symbol) 177 public static bool IsInterface (this ISymbol symbol) 186 public static bool IsSubclassOf (this ISymbol symbol, string ns, string type) 201 public static bool IsConstructor ([NotNullWhen (returnValue: true)] this ISymbol? symbol) 204 public static bool IsStaticConstructor ([NotNullWhen (returnValue: true)] this ISymbol? symbol)
RequiresAnalyzerBase.cs (20)
74 if (syntaxNodeAnalysisContext.ContainingSymbol is not ISymbol containingSymbol || containingSymbol.IsInRequiresScope (RequiresAttributeName, out _)) 126 ISymbol member) 128 if ((member.IsVirtual || member.IsOverride) && member.TryGetOverriddenMember (out var overriddenMember) && HasMismatchingAttributes (member, overriddenMember)) 143 ISymbol origin = memberpair.ImplementationMember; 159 ISymbol member, 160 ISymbol containingSymbol, 161 ImmutableArray<ISymbol> incompatibleMembers, 202 protected static ISymbol FindContainingSymbol (OperationAnalysisContext operationContext, DiagnosticTargets targets) 234 private void CreateRequiresDiagnostic (ISymbol member, AttributeData requiresAttribute, in DiagnosticContext diagnosticContext) 257 private void ReportMismatchInAttributesDiagnostic (SymbolAnalysisContext symbolAnalysisContext, ISymbol member, ISymbol baseMember, bool isInterface = false, ISymbol? origin = null) 267 private bool HasMismatchingAttributes (ISymbol member1, ISymbol member2) 299 ImmutableArray<ISymbol> specialIncompatibleMembers, 300 ISymbol member, 311 internal virtual ImmutableArray<ISymbol> GetSpecialIncompatibleMembers (Compilation compilation) => default; 347 ISymbol member, 348 ISymbol owningSymbol, 357 ISymbol containingSymbol = operation.FindContainingSymbol (owningSymbol);
RequiresAssemblyFilesAnalyzer.cs (5)
83 internal override ImmutableArray<ISymbol> GetSpecialIncompatibleMembers (Compilation compilation) 85 var dangerousPatternsBuilder = ImmutableArray.CreateBuilder<ISymbol> (); 107 ImmutableArray<ISymbol> dangerousPatterns, 108 ISymbol member, 116 else if (method.AssociatedSymbol is ISymbol associatedSymbol &&
RequiresISymbolExtensions.cs (3)
15 public static bool DoesMemberRequire (this ISymbol member, string requiresAttribute, [NotNullWhen (returnValue: true)] out AttributeData? requiresAttributeData) 31 public static bool IsInRequiresScope (this ISymbol member, string attributeName) 40 public static bool IsInRequiresScope (this ISymbol member, string attributeName, [NotNullWhen (true)] out AttributeData? requiresAttribute)
RequiresUnreferencedCodeAnalyzer.cs (2)
86 ImmutableArray<ISymbol> specialIncompatibleMembers, 87 ISymbol member,
RequiresUnreferencedCodeUtils.cs (3)
14 public static bool TryGetRequiresUnreferencedCodeAttribute (this ISymbol member, [NotNullWhen (returnValue: true)] out AttributeData? requiresAttributeData) => 21 public static bool DoesMemberRequireUnreferencedCodeAttribute (this ISymbol member, [NotNullWhen (returnValue: true)] out AttributeData? requiresAttributeData) 28 public static bool IsInRequiresUnreferencedCodeAttributeScope (this ISymbol member, [NotNullWhen (true)] out AttributeData? requiresAttribute)
TrimAnalysis\DiagnosticContext.cs (1)
53 ISymbol symbol = actualValue switch {
TrimAnalysis\FlowAnnotations.cs (1)
38 internal static bool ShouldWarnWhenAccessedForReflection (ISymbol symbol) =>
TrimAnalysis\HandleCallAction.cs (2)
25 readonly ISymbol _owningSymbol; 32 ISymbol owningSymbol,
TrimAnalysis\ReflectionAccessAnalyzer.cs (4)
30 foreach (var member in typeSymbol.GetDynamicallyAccessedMembers (requiredMemberTypes, declaredOnly)) { 86 void ReportRequiresUnreferencedCodeDiagnostic (Location location, AttributeData requiresAttributeData, ISymbol member) 108 internal void GetTypeHierarchyReflectionAccessDiagnostics (Location location, ISymbol member) 119 static bool IsDeclaredWithinType (ISymbol member, INamedTypeSymbol type)
TrimAnalysis\TrimAnalysisAssignmentPattern.cs (2)
23 public ISymbol OwningSymbol { get; init; } 30 ISymbol owningSymbol,
TrimAnalysis\TrimAnalysisFieldAccessPattern.cs (2)
17 public ISymbol OwningSymbol { get; init; } 23 ISymbol owningSymbol,
TrimAnalysis\TrimAnalysisGenericInstantiationPattern.cs (4)
14 public ISymbol GenericInstantiation { get; init; } 16 public ISymbol OwningSymbol { get; init; } 20 ISymbol genericInstantiation, 22 ISymbol owningSymbol,
TrimAnalysis\TrimAnalysisMethodCallPattern.cs (2)
22 public ISymbol OwningSymbol { get; init; } 30 ISymbol owningSymbol,
TrimAnalysis\TrimAnalysisReflectionAccessPattern.cs (2)
16 public ISymbol OwningSymbol { get; init; } 22 ISymbol owningSymbol,
TrimAnalysis\TrimAnalysisVisitor.cs (2)
49 ISymbol owningSymbol, 327 ISymbol owningSymbol,
TrimAnalysis\TrimDataFlowAnalysis.cs (1)
61 ISymbol owningSymbol,
Metrics (136)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (8)
28ISymbol symbol, 65public ISymbol Symbol { get; } 228public static Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, Compilation compilation, CancellationToken cancellationToken) 246public static Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, CodeMetricsAnalysisContext context) 265static async Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, CodeMetricsAnalysisContext context) 291public static CodeAnalysisMetricData ComputeSynchronously(ISymbol symbol, CodeMetricsAnalysisContext context) 325internal static async Task<ImmutableArray<CodeAnalysisMetricData>> ComputeAsync(IEnumerable<ISymbol> children, CodeMetricsAnalysisContext context) 333internal static ImmutableArray<CodeAnalysisMetricData> ComputeSynchronously(IEnumerable<ISymbol> children, CodeMetricsAnalysisContext context)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
51private static IEnumerable<ISymbol> GetMembers(INamedTypeSymbol namedType, CodeMetricsAnalysisContext context)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\ComputationalComplexityMetrics.cs (8)
28ImmutableHashSet<BinaryOperatorKind>.Empty, ImmutableHashSet<UnaryOperatorKind>.Empty, ImmutableHashSet<CaseKind>.Empty, ImmutableHashSet<ISymbol>.Empty, ImmutableHashSet<object>.Empty); 36private readonly ImmutableHashSet<ISymbol> _distinctReferencedSymbols; 49ImmutableHashSet<ISymbol> distinctReferencedSymbols, 75ImmutableHashSet<ISymbol> distinctReferencedSymbols, 101ImmutableHashSet<ISymbol>.Builder? distinctReferencedSymbolsBuilder = null; 296distinctReferencedSymbolsBuilder != null ? distinctReferencedSymbolsBuilder.ToImmutable() : ImmutableHashSet<ISymbol>.Empty, 341void countOperand(ISymbol? symbol) 347distinctReferencedSymbolsBuilder ??= ImmutableHashSet.CreateBuilder<ISymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (6)
65internal static long GetLinesOfCode(ImmutableArray<SyntaxReference> declarations, ISymbol symbol, CodeMetricsAnalysisContext context) 179internal static SyntaxNode GetTopmostSyntaxNodeForDeclaration(SyntaxReference declaration, ISymbol declaredSymbol, CodeMetricsAnalysisContext context) 196ISymbol symbol, 249var declaredSymbol = model.GetDeclaredSymbol(node, context.CancellationToken); 402internal static void RemoveContainingTypes(ISymbol symbol, ImmutableHashSet<INamedTypeSymbol>.Builder coupledTypesBuilder) 412internal static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol member)
src\RoslynAnalyzers\Utilities\Compiler\DiagnosticHelpers.cs (1)
65public static string GetMemberName(ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (2)
79this ISymbol symbol, 87this ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (5)
135/// "qualifying member" (<see cref="IsQualifyingMember(ISymbol)"/>) and no 136/// "disqualifying members" (<see cref="IsDisqualifyingMember(ISymbol)"/>). 165foreach (var member in symbol.GetMembers()) 195private static bool IsQualifyingMember(ISymbol member) 243private static bool IsDisqualifyingMember(ISymbol member)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (6)
503public static PooledHashSet<ISymbol> GetCaptures(this IOperation operation, IMethodSymbol lambdaOrLocalFunction) 510var builder = PooledHashSet<ISymbol>.GetInstance(); 543void ProcessLocalOrParameter(ISymbol symbol) 656public static ISymbol? GetReferencedMemberOrLocalOrParameter(this IOperation? operation) 912public static ValueUsageInfo GetValueUsageInfo(this IOperation operation, ISymbol containingSymbol) 1117public static RefKind GetRefKind(this IReturnOperation operation, ISymbol containingSymbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (59)
20public static bool IsType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 25public static bool IsAccessorMethod([NotNullWhen(returnValue: true)] this ISymbol? symbol) 31public static IEnumerable<IMethodSymbol> GetAccessors(this ISymbol symbol) 70public static bool IsDefaultConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 75public static bool IsPublic(this ISymbol symbol) 80public static bool IsProtected(this ISymbol symbol) 85public static bool IsPrivate(this ISymbol symbol) 90public static bool IsErrorType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 97public static bool IsConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 102public static bool IsDestructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 107public static bool IsIndexer([NotNullWhen(returnValue: true)] this ISymbol? symbol) 112public static bool IsPropertyWithBackingField([NotNullWhen(returnValue: true)] this ISymbol? symbol, [NotNullWhen(true)] out IFieldSymbol? backingField) 116foreach (ISymbol member in propertySymbol.ContainingType.GetMembers()) 139[NotNullWhen(returnValue: true)] this ISymbol? symbol, 156public static bool IsUserDefinedOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 161public static bool IsConversionOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 166public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol? symbol) 179public static bool IsExternallyVisible(this ISymbol symbol) => 182public static SymbolVisibility GetResultantVisibility(this ISymbol symbol) 229public static bool MatchMemberDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 239public static bool MatchMethodByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 244public static bool MatchPropertyDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 249public static bool MatchMemberByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 254public static bool MatchPropertyByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 259public static bool MatchFieldByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 283public static string FormatMemberName(this ISymbol member) 419public static bool IsFromMscorlib(this ISymbol symbol, Compilation compilation) 460public static bool IsImplementationOfAnyInterfaceMember(this ISymbol symbol) 465public static bool IsImplementationOfAnyImplicitInterfaceMember(this ISymbol symbol) 467return IsImplementationOfAnyImplicitInterfaceMember<ISymbol>(symbol); 473public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol) 474where TSymbol : ISymbol 496public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol, out TSymbol interfaceMember) 497where TSymbol : ISymbol 518public static bool IsImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 527public static bool IsOverrideOrImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 546/// <remarks>Requires that <see cref="ISymbol.IsOverride"/> is true for the given <paramref name="symbol"/>.</remarks> 547public static ISymbol GetOverriddenMember(this ISymbol symbol) 566public static bool IsImplementationOfAnyExplicitInterfaceMember([NotNullWhen(returnValue: true)] this ISymbol? symbol) 586public static ITypeSymbol? GetMemberOrLocalOrParameterType(this ISymbol symbol) 598public static ITypeSymbol? GetMemberType(this ISymbol? symbol) 614public static bool IsReadOnlyFieldOrProperty([NotNullWhen(returnValue: true)] this ISymbol? symbol) 626public static AttributeData? GetAttribute(this ISymbol symbol, [NotNullWhen(true)] INamedTypeSymbol? attributeType) 631public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, IEnumerable<INamedTypeSymbol?> attributesToMatch) 649public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 655public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1) 666public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1, INamedTypeSymbol? attributeTypeToMatch2) 679public static bool HasAnyAttribute(this ISymbol symbol, IEnumerable<INamedTypeSymbol> attributesToMatch) 684public static bool HasAnyAttribute(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 707public static bool HasAnyAttribute(this ISymbol symbol, [NotNullWhen(returnValue: true)] INamedTypeSymbol? attribute) 806public static bool[] HasAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributes) 826public static bool IsInSource(this ISymbol symbol) 831public static bool IsLambdaOrLocalFunction([NotNullWhen(returnValue: true)] this ISymbol? symbol) 839public static bool IsSymbolWithSpecialDiscardName([NotNullWhen(returnValue: true)] this ISymbol? symbol) 843public static bool IsConst([NotNullWhen(returnValue: true)] this ISymbol? symbol) 855public static bool IsReadOnly([NotNullWhen(returnValue: true)] this ISymbol? symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\UriExtensions.cs (2)
32public static bool SymbolNameContainsUriWordSubstring(this ISymbol symbol, CancellationToken cancellationToken) 58public static bool SymbolNameContainsUriWords(this ISymbol symbol, CancellationToken cancellationToken)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
55where TSymbol : ISymbol 99where TSymbol : ISymbol
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (18)
29private static bool TryGetSyntaxTreeForOption(ISymbol symbol, [NotNullWhen(returnValue: true)] out SyntaxTree? tree) 48ISymbol symbol, 66ISymbol symbol, 84ISymbol symbol, 117ISymbol symbol, 189ISymbol symbol, 254ISymbol symbol, 261ISymbol symbol, 262ISymbol containingContextSymbol, 298ISymbol symbol, 307ISymbol symbol, 317ISymbol symbol, 331ISymbol symbol, 380ISymbol symbol, 578ISymbol symbol, 593ISymbol symbol, 594ISymbol containingContextSymbol, 612ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolModifiers.cs (1)
38public static SymbolModifiers GetSymbolModifiers(this ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (15)
31private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 58private readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> _wildcardMatchResult = new(); 60private readonly ConcurrentDictionary<ISymbol, string> _symbolToDeclarationId = new(); 62private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 75_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 90var symbolsBuilder = PooledDictionary<ISymbol, TValue>.GetInstance(); 189static void ProcessSymbolName(NameParts parts, Compilation compilation, string? optionalPrefix, PooledDictionary<ISymbol, TValue> symbolsBuilder) 201foreach (var symbol in DocumentationCommentId.GetSymbolsForDeclarationId(nameWithPrefix, compilation)) 230public bool Contains(ISymbol symbol) 236public bool TryGetValue(ISymbol symbol, [MaybeNullWhen(false)] out TValue value) 266private bool TryGetFirstWildcardMatch(ISymbol symbol, [NotNullWhen(true)] out string? firstMatchName, [MaybeNullWhen(false)] out TValue firstMatchValue) 344static string GetDeclarationId(ISymbol symbol) 374internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 378internal ref readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> WildcardMatchResult => ref _symbolNamesWithValueOption._wildcardMatchResult; 380internal ref readonly ConcurrentDictionary<ISymbol, string> SymbolToDeclarationId => ref _symbolNamesWithValueOption._symbolToDeclarationId;
src\RoslynAnalyzers\Utilities\Compiler\SymbolDisplayStringCache.cs (2)
29private readonly ConcurrentDictionary<ISymbol, string> SymbolToDisplayNames = new(); 65public string GetDisplayString(ISymbol symbol)
Metrics.Legacy (136)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (8)
28ISymbol symbol, 65public ISymbol Symbol { get; } 228public static Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, Compilation compilation, CancellationToken cancellationToken) 246public static Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, CodeMetricsAnalysisContext context) 265static async Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, CodeMetricsAnalysisContext context) 291public static CodeAnalysisMetricData ComputeSynchronously(ISymbol symbol, CodeMetricsAnalysisContext context) 325internal static async Task<ImmutableArray<CodeAnalysisMetricData>> ComputeAsync(IEnumerable<ISymbol> children, CodeMetricsAnalysisContext context) 333internal static ImmutableArray<CodeAnalysisMetricData> ComputeSynchronously(IEnumerable<ISymbol> children, CodeMetricsAnalysisContext context)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
51private static IEnumerable<ISymbol> GetMembers(INamedTypeSymbol namedType, CodeMetricsAnalysisContext context)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\ComputationalComplexityMetrics.cs (8)
28ImmutableHashSet<BinaryOperatorKind>.Empty, ImmutableHashSet<UnaryOperatorKind>.Empty, ImmutableHashSet<CaseKind>.Empty, ImmutableHashSet<ISymbol>.Empty, ImmutableHashSet<object>.Empty); 36private readonly ImmutableHashSet<ISymbol> _distinctReferencedSymbols; 49ImmutableHashSet<ISymbol> distinctReferencedSymbols, 75ImmutableHashSet<ISymbol> distinctReferencedSymbols, 101ImmutableHashSet<ISymbol>.Builder? distinctReferencedSymbolsBuilder = null; 296distinctReferencedSymbolsBuilder != null ? distinctReferencedSymbolsBuilder.ToImmutable() : ImmutableHashSet<ISymbol>.Empty, 341void countOperand(ISymbol? symbol) 347distinctReferencedSymbolsBuilder ??= ImmutableHashSet.CreateBuilder<ISymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (6)
65internal static long GetLinesOfCode(ImmutableArray<SyntaxReference> declarations, ISymbol symbol, CodeMetricsAnalysisContext context) 179internal static SyntaxNode GetTopmostSyntaxNodeForDeclaration(SyntaxReference declaration, ISymbol declaredSymbol, CodeMetricsAnalysisContext context) 196ISymbol symbol, 249var declaredSymbol = model.GetDeclaredSymbol(node, context.CancellationToken); 402internal static void RemoveContainingTypes(ISymbol symbol, ImmutableHashSet<INamedTypeSymbol>.Builder coupledTypesBuilder) 412internal static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol member)
src\RoslynAnalyzers\Utilities\Compiler\DiagnosticHelpers.cs (1)
65public static string GetMemberName(ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (2)
79this ISymbol symbol, 87this ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (5)
135/// "qualifying member" (<see cref="IsQualifyingMember(ISymbol)"/>) and no 136/// "disqualifying members" (<see cref="IsDisqualifyingMember(ISymbol)"/>). 165foreach (var member in symbol.GetMembers()) 195private static bool IsQualifyingMember(ISymbol member) 243private static bool IsDisqualifyingMember(ISymbol member)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (6)
503public static PooledHashSet<ISymbol> GetCaptures(this IOperation operation, IMethodSymbol lambdaOrLocalFunction) 510var builder = PooledHashSet<ISymbol>.GetInstance(); 543void ProcessLocalOrParameter(ISymbol symbol) 656public static ISymbol? GetReferencedMemberOrLocalOrParameter(this IOperation? operation) 912public static ValueUsageInfo GetValueUsageInfo(this IOperation operation, ISymbol containingSymbol) 1117public static RefKind GetRefKind(this IReturnOperation operation, ISymbol containingSymbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (59)
20public static bool IsType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 25public static bool IsAccessorMethod([NotNullWhen(returnValue: true)] this ISymbol? symbol) 31public static IEnumerable<IMethodSymbol> GetAccessors(this ISymbol symbol) 70public static bool IsDefaultConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 75public static bool IsPublic(this ISymbol symbol) 80public static bool IsProtected(this ISymbol symbol) 85public static bool IsPrivate(this ISymbol symbol) 90public static bool IsErrorType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 97public static bool IsConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 102public static bool IsDestructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 107public static bool IsIndexer([NotNullWhen(returnValue: true)] this ISymbol? symbol) 112public static bool IsPropertyWithBackingField([NotNullWhen(returnValue: true)] this ISymbol? symbol, [NotNullWhen(true)] out IFieldSymbol? backingField) 116foreach (ISymbol member in propertySymbol.ContainingType.GetMembers()) 139[NotNullWhen(returnValue: true)] this ISymbol? symbol, 156public static bool IsUserDefinedOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 161public static bool IsConversionOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 166public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol? symbol) 179public static bool IsExternallyVisible(this ISymbol symbol) => 182public static SymbolVisibility GetResultantVisibility(this ISymbol symbol) 229public static bool MatchMemberDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 239public static bool MatchMethodByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 244public static bool MatchPropertyDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 249public static bool MatchMemberByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 254public static bool MatchPropertyByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 259public static bool MatchFieldByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 283public static string FormatMemberName(this ISymbol member) 419public static bool IsFromMscorlib(this ISymbol symbol, Compilation compilation) 460public static bool IsImplementationOfAnyInterfaceMember(this ISymbol symbol) 465public static bool IsImplementationOfAnyImplicitInterfaceMember(this ISymbol symbol) 467return IsImplementationOfAnyImplicitInterfaceMember<ISymbol>(symbol); 473public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol) 474where TSymbol : ISymbol 496public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol, out TSymbol interfaceMember) 497where TSymbol : ISymbol 518public static bool IsImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 527public static bool IsOverrideOrImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 546/// <remarks>Requires that <see cref="ISymbol.IsOverride"/> is true for the given <paramref name="symbol"/>.</remarks> 547public static ISymbol GetOverriddenMember(this ISymbol symbol) 566public static bool IsImplementationOfAnyExplicitInterfaceMember([NotNullWhen(returnValue: true)] this ISymbol? symbol) 586public static ITypeSymbol? GetMemberOrLocalOrParameterType(this ISymbol symbol) 598public static ITypeSymbol? GetMemberType(this ISymbol? symbol) 614public static bool IsReadOnlyFieldOrProperty([NotNullWhen(returnValue: true)] this ISymbol? symbol) 626public static AttributeData? GetAttribute(this ISymbol symbol, [NotNullWhen(true)] INamedTypeSymbol? attributeType) 631public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, IEnumerable<INamedTypeSymbol?> attributesToMatch) 649public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 655public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1) 666public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1, INamedTypeSymbol? attributeTypeToMatch2) 679public static bool HasAnyAttribute(this ISymbol symbol, IEnumerable<INamedTypeSymbol> attributesToMatch) 684public static bool HasAnyAttribute(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 707public static bool HasAnyAttribute(this ISymbol symbol, [NotNullWhen(returnValue: true)] INamedTypeSymbol? attribute) 806public static bool[] HasAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributes) 826public static bool IsInSource(this ISymbol symbol) 831public static bool IsLambdaOrLocalFunction([NotNullWhen(returnValue: true)] this ISymbol? symbol) 839public static bool IsSymbolWithSpecialDiscardName([NotNullWhen(returnValue: true)] this ISymbol? symbol) 843public static bool IsConst([NotNullWhen(returnValue: true)] this ISymbol? symbol) 855public static bool IsReadOnly([NotNullWhen(returnValue: true)] this ISymbol? symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\UriExtensions.cs (2)
32public static bool SymbolNameContainsUriWordSubstring(this ISymbol symbol, CancellationToken cancellationToken) 58public static bool SymbolNameContainsUriWords(this ISymbol symbol, CancellationToken cancellationToken)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
55where TSymbol : ISymbol 99where TSymbol : ISymbol
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (18)
29private static bool TryGetSyntaxTreeForOption(ISymbol symbol, [NotNullWhen(returnValue: true)] out SyntaxTree? tree) 48ISymbol symbol, 66ISymbol symbol, 84ISymbol symbol, 117ISymbol symbol, 189ISymbol symbol, 254ISymbol symbol, 261ISymbol symbol, 262ISymbol containingContextSymbol, 298ISymbol symbol, 307ISymbol symbol, 317ISymbol symbol, 331ISymbol symbol, 380ISymbol symbol, 578ISymbol symbol, 593ISymbol symbol, 594ISymbol containingContextSymbol, 612ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolModifiers.cs (1)
38public static SymbolModifiers GetSymbolModifiers(this ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (15)
31private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 58private readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> _wildcardMatchResult = new(); 60private readonly ConcurrentDictionary<ISymbol, string> _symbolToDeclarationId = new(); 62private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 75_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 90var symbolsBuilder = PooledDictionary<ISymbol, TValue>.GetInstance(); 189static void ProcessSymbolName(NameParts parts, Compilation compilation, string? optionalPrefix, PooledDictionary<ISymbol, TValue> symbolsBuilder) 201foreach (var symbol in DocumentationCommentId.GetSymbolsForDeclarationId(nameWithPrefix, compilation)) 230public bool Contains(ISymbol symbol) 236public bool TryGetValue(ISymbol symbol, [MaybeNullWhen(false)] out TValue value) 266private bool TryGetFirstWildcardMatch(ISymbol symbol, [NotNullWhen(true)] out string? firstMatchName, [MaybeNullWhen(false)] out TValue firstMatchValue) 344static string GetDeclarationId(ISymbol symbol) 374internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 378internal ref readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> WildcardMatchResult => ref _symbolNamesWithValueOption._wildcardMatchResult; 380internal ref readonly ConcurrentDictionary<ISymbol, string> SymbolToDeclarationId => ref _symbolNamesWithValueOption._symbolToDeclarationId;
src\RoslynAnalyzers\Utilities\Compiler\SymbolDisplayStringCache.cs (2)
29private readonly ConcurrentDictionary<ISymbol, string> SymbolToDisplayNames = new(); 65public string GetDisplayString(ISymbol symbol)
Microsoft.Analyzers.Extra (7)
AsyncMethodWithoutCancellation.cs (1)
123bool IsObsoleteSymbol(ISymbol symbol)
CallAnalysis\CallAnalyzer.Handlers.cs (1)
66var impl = type.FindImplementationForInterfaceMember(h.Method);
MakeExeTypesInternalAnalyzer.cs (1)
119foreach (var member in members)
UsingToStringInLoggersAnalyzer.cs (2)
51private static bool IsLoggerMethod(ISymbol symbol) 56private static bool IsLoggerMessageAttribute(ISymbol attributeSymbol)
Utilities\SymbolExtensions.cs (2)
37public static bool IsExternallyVisible(this ISymbol symbol) 69var impl = method.ContainingType.FindImplementationForInterfaceMember(member);
Microsoft.Analyzers.Local (17)
ApiLifecycle\ApiLifecycleAnalyzer.cs (1)
72foreach (var symbol in assemblyAnalysis.NotFoundInBaseline)
ApiLifecycle\AssemblyAnalysis.cs (5)
17public Dictionary<ISymbol, List<string>> MissingConstraints { get; } = new(SymbolEqualityComparer.Default); 18public Dictionary<ISymbol, List<string>> MissingBaseTypes { get; } = new(SymbolEqualityComparer.Default); 22public HashSet<(ISymbol symbol, Stage stage)> FoundInBaseline { get; } = []; 23public HashSet<ISymbol> NotFoundInBaseline { get; } = new(SymbolEqualityComparer.Default); 215foreach (var member in members)
CallAnalysis\CallAnalyzer.Handlers.cs (1)
66var impl = type.FindImplementationForInterfaceMember(h.Method);
InternalReferencedInPublicDocAnalyzer.cs (2)
131var symbol = context.SemanticModel.GetDeclaredSymbol(symbolNode); 145var referencedSymbol = context.SemanticModel.GetSymbolInfo(crefNode.Cref).Symbol;
Utilities\SymbolExtensions.cs (8)
13public static bool IsExternallyVisible(this ISymbol symbol) 37public static bool HasAttribute(this ISymbol sym, INamedTypeSymbol attribute) 50public static bool HasAttribute(this ISymbol sym, string attributeName) 64public static bool IsContaminated(this ISymbol symbol, INamedTypeSymbol? contaminationAttribute) 68bool IsContaminated(ISymbol symbol) 114public static bool IsContaminated(this ISymbol symbol, string attributeName) 118bool IsContaminated(ISymbol symbol) 164internal static ITypeSymbol? GetFieldOrPropertyType(this ISymbol symbol)
Microsoft.AspNetCore.Analyzers (1)
ConfigureMethodVisitor.cs (1)
47foreach (var member in symbol.GetMembers())
Microsoft.AspNetCore.App.Analyzers (52)
Mvc\DetectOverriddenAuthorizeAttribute.cs (3)
112private static bool IsSameSymbol(ISymbol? x, ISymbol? y) => SymbolEqualityComparer.Default.Equals(x, y); 152private static void FindAuthorizeAndAllowAnonymous(WellKnownTypes wellKnownTypes, ISymbol symbol, bool isCheckingBaseType,
Mvc\MvcAnalyzer.cs (1)
60foreach (var member in namedTypeSymbol.GetMembers())
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (2)
364var attributeTypeSymbol = semanticModel.GetSymbolInfo(attribute, cancellationToken).GetAnySymbol(); 393var parameterTypeSymbol = semanticModel.GetSymbolInfo(token.Parent!, cancellationToken).GetAnySymbol();
RouteEmbeddedLanguage\Infrastructure\RoutePatternParametersDetector.cs (11)
15public static ImmutableArray<ParameterSymbol> ResolvedParameters(ISymbol symbol, WellKnownTypes wellKnownTypes) 19static ImmutableArray<ParameterSymbol> ResolvedParametersCore(ISymbol symbol, ISymbol? topLevelSymbol, WellKnownTypes wellKnownTypes) 24foreach (var child in childSymbols) 43static string ResolveRouteParameterName(ISymbol parameterSymbol, WellKnownTypes wellKnownTypes) 65public static ImmutableArray<ISymbol> GetParameterSymbols(ISymbol symbol) 69ITypeSymbol typeSymbol => typeSymbol.GetMembers().OfType<IPropertySymbol>().ToImmutableArray().As<ISymbol>(), 70IMethodSymbol methodSymbol => methodSymbol.Parameters.As<ISymbol>(), 75private static bool HasSpecialType(ISymbol child, WellKnownTypes wellKnownTypes, WellKnownType[] specialTypes) 85private static bool HasExplicitNonRouteAttribute(ISymbol child, WellKnownTypes wellKnownTypes, WellKnownType[] allNoneRouteMetadataTypes)
RouteEmbeddedLanguage\Infrastructure\RouteStringSyntaxDetector.cs (11)
116var symbol = 128var symbol = semanticModel.GetDeclaredSymbol(property, cancellationToken); 245var symbol = semanticModel.GetSymbolInfo(left, cancellationToken).Symbol; 288var fieldOrProperty = FindFieldOrPropertyForAttributeArgument(semanticModel, argument, cancellationToken); 300ISymbol? symbol, [NotNullWhen(true)] out string? identifier) 308[NotNullWhen(true)] ISymbol? symbol, 367private static ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 405foreach (var symbol in symbols) 485foreach (var symbol in symbols) 528public static ImmutableArray<ISymbol> GetBestOrAllSymbols(SymbolInfo info) 539return ImmutableArray<ISymbol>.Empty;
RouteEmbeddedLanguage\Infrastructure\RouteUsageDetector.cs (9)
28internal record struct ParameterSymbol(string RouteParameterName, ISymbol Symbol, ISymbol? TopLevelSymbol = null) 38ImmutableArray<ISymbol> Parameters, 66Parameters: ImmutableArray<ISymbol>.Empty, 145Parameters: ImmutableArray<ISymbol>.Empty, 245foreach (var symbol in symbols) 336var delegateSymbol = delegateSymbolInfo.Symbol; 345private static ImmutableArray<ISymbol> GetBestOrAllSymbols(SymbolInfo info) 356return ImmutableArray<ISymbol>.Empty;
RouteEmbeddedLanguage\RoutePatternAnalyzer.cs (2)
114private record struct InsertPoint(ISymbol ExistingParameter, bool Before); 137var s = parameterSymbol.TopLevelSymbol ?? parameterSymbol.Symbol;
RouteEmbeddedLanguage\RoutePatternHighlighter.cs (1)
72private static void HighlightSymbol(SemanticModel semanticModel, IMethodSymbol methodSymbol, IList<AspNetCoreHighlightSpan> highlightSpans, ISymbol matchingParameter, CancellationToken cancellationToken)
RouteHandlers\AtMostOneFromBodyAttribute.cs (2)
46static void ReportDiagnostics(OperationAnalysisContext context, IEnumerable<ISymbol> symbols) 48foreach (var symbol in symbols)
src\Shared\Roslyn\CodeAnalysisExtensions.cs (2)
21public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, ITypeSymbol attribute) 131public static bool HasAttribute(this ISymbol symbol, ITypeSymbol attribute)
src\Shared\Roslyn\MvcFacts.cs (1)
142var implementedMethod = method.ContainingType.FindImplementationForInterfaceMember(disposableDispose);
src\Shared\RoslynUtils\ParsabilityHelper.cs (1)
183foreach (var methodSymbolCandidate in baseTypeBindAsyncMethods)
src\Shared\RoslynUtils\SymbolExtensions.cs (6)
52public static bool HasAttribute(this ISymbol symbol, INamedTypeSymbol attributeType) 85public static bool HasAttributeImplementingInterface(this ISymbol symbol, INamedTypeSymbol interfaceType) 90public static bool TryGetAttributeImplementingInterface(this ISymbol symbol, INamedTypeSymbol interfaceType, [NotNullWhen(true)] out AttributeData? matchedAttribute) 143public static ITypeSymbol GetParameterType(this ISymbol symbol) 153public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol? symbol) 161public static ISymbol? GetAnySymbol(this SymbolInfo info)
Microsoft.AspNetCore.App.CodeFixes (2)
Dependencies\AddPackageFixer.cs (1)
66var symbol = semanticModel.GetSymbolInfo(((MemberAccessExpressionSyntax)node.Parent).Expression).Symbol;
Dependencies\ExtensionMethodsCompletionProvider.cs (1)
103ISymbol? symbolType,
Microsoft.AspNetCore.Components.Analyzers (14)
ComponentInternalUsageDiagnosticAnalzyer.cs (1)
39private static bool IsInInternalNamespace(ISymbol symbol)
ComponentParameterAnalyzer.cs (1)
55foreach (var member in type.GetMembers())
InternalUsageAnalyzer.cs (12)
14private readonly Func<ISymbol, bool> _isInternalNamespace; 15private readonly Func<ISymbol, bool> _hasInternalAttribute; 28public InternalUsageAnalyzer(Func<ISymbol, bool> isInInternalNamespace, Func<ISymbol, bool> hasInternalAttribute, DiagnosticDescriptor descriptor) 30_isInternalNamespace = isInInternalNamespace ?? new Func<ISymbol, bool>((_) => false); 31_hasInternalAttribute = hasInternalAttribute ?? new Func<ISymbol, bool>((_) => false); 61var symbol = context.Operation switch 127private void VisitOperationSymbol(OperationAnalysisContext context, ISymbol symbol) 156private void VisitDeclarationSymbol(SymbolAnalysisContext context, ISymbol symbol, ISymbol symbolForDiagnostic) 184private bool HasInternalAttribute(ISymbol symbol) => _hasInternalAttribute(symbol); 186private bool IsInInternalNamespace(ISymbol symbol) => _isInternalNamespace(symbol);
Microsoft.AspNetCore.Components.SdkAnalyzers (14)
ComponentInternalUsageDiagnosticAnalzyer.cs (1)
39private static bool IsInInternalNamespace(ISymbol symbol)
ComponentParameterAnalyzer.cs (1)
49foreach (var member in type.GetMembers())
InternalUsageAnalyzer.cs (12)
14private readonly Func<ISymbol, bool> _isInternalNamespace; 15private readonly Func<ISymbol, bool> _hasInternalAttribute; 28public InternalUsageAnalyzer(Func<ISymbol, bool> isInInternalNamespace, Func<ISymbol, bool> hasInternalAttribute, DiagnosticDescriptor descriptor) 30_isInternalNamespace = isInInternalNamespace ?? new Func<ISymbol, bool>((_) => false); 31_hasInternalAttribute = hasInternalAttribute ?? new Func<ISymbol, bool>((_) => false); 61var symbol = context.Operation switch 127private void VisitOperationSymbol(OperationAnalysisContext context, ISymbol symbol) 156private void VisitDeclarationSymbol(SymbolAnalysisContext context, ISymbol symbol, ISymbol symbolForDiagnostic) 184private bool HasInternalAttribute(ISymbol symbol) => _hasInternalAttribute(symbol); 186private bool IsInInternalNamespace(ISymbol symbol) => _isInternalNamespace(symbol);
Microsoft.AspNetCore.Http.RequestDelegateGenerator (10)
src\Shared\RoslynUtils\ParsabilityHelper.cs (1)
183foreach (var methodSymbolCandidate in baseTypeBindAsyncMethods)
src\Shared\RoslynUtils\SymbolExtensions.cs (6)
52public static bool HasAttribute(this ISymbol symbol, INamedTypeSymbol attributeType) 85public static bool HasAttributeImplementingInterface(this ISymbol symbol, INamedTypeSymbol interfaceType) 90public static bool TryGetAttributeImplementingInterface(this ISymbol symbol, INamedTypeSymbol interfaceType, [NotNullWhen(true)] out AttributeData? matchedAttribute) 143public static ITypeSymbol GetParameterType(this ISymbol symbol) 153public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol? symbol) 161public static ISymbol? GetAnySymbol(this SymbolInfo info)
StaticRouteHandlerModel\EndpointParameter.cs (2)
68private void ProcessEndpointParameterSource(Endpoint endpoint, ISymbol symbol, ImmutableArray<AttributeData> attributes, WellKnownTypes wellKnownTypes) 423private static bool TryGetExplicitFromJsonBody(ISymbol typeSymbol,
StaticRouteHandlerModel\InvocationOperationExtensions.cs (1)
97private static IOperation? ResolveDeclarationOperation(ISymbol symbol, SemanticModel? semanticModel)
Microsoft.AspNetCore.Http.ValidationsGenerator (4)
Extensions\ISymbolExtensions.cs (1)
11public static string GetDisplayName(this ISymbol property, INamedTypeSymbol displayAttribute)
Parsers\ValidationsGenerator.AddValidation.cs (1)
29var symbol = semanticModel.GetSymbolInfo(node, cancellationToken).Symbol;
Parsers\ValidationsGenerator.TypesParser.cs (1)
112internal static ImmutableArray<ValidationAttribute> ExtractValidationAttributes(ISymbol symbol, RequiredSymbols requiredSymbols, out bool isRequired)
src\Http\Http.Extensions\gen\Microsoft.AspNetCore.Http.RequestDelegateGenerator\StaticRouteHandlerModel\InvocationOperationExtensions.cs (1)
97private static IOperation? ResolveDeclarationOperation(ISymbol symbol, SemanticModel? semanticModel)
Microsoft.AspNetCore.Mvc.Analyzers (6)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (1)
124private static AttributeData? GetAttribute(ISymbol symbol, INamedTypeSymbol attributeType)
src\Shared\Roslyn\CodeAnalysisExtensions.cs (2)
21public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, ITypeSymbol attribute) 131public static bool HasAttribute(this ISymbol symbol, ITypeSymbol attribute)
src\Shared\Roslyn\MvcFacts.cs (1)
142var implementedMethod = method.ContainingType.FindImplementationForInterfaceMember(disposableDispose);
TopLevelParameterNameAnalyzer.cs (2)
108foreach (var member in type.GetMembers()) 150internal static string GetName(in SymbolCache symbolCache, ISymbol symbol)
Microsoft.AspNetCore.Mvc.Api.Analyzers (9)
ActualApiResponseMetadataFactory.cs (2)
274var implementedProperty = property.ContainingType.FindImplementationForInterfaceMember(statusCodeActionResultStatusProperty); 278private static bool HasAttributeNamed(ISymbol symbol, string attributeName)
AddResponseTypeAttributeCodeFixAction.cs (1)
153foreach (var member in statusCodesType.GetMembers())
src\Shared\Roslyn\CodeAnalysisExtensions.cs (2)
21public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, ITypeSymbol attribute) 131public static bool HasAttribute(this ISymbol symbol, ITypeSymbol attribute)
src\Shared\Roslyn\MvcFacts.cs (1)
142var implementedMethod = method.ContainingType.FindImplementationForInterfaceMember(disposableDispose);
SymbolApiConventionMatcher.cs (2)
61internal static SymbolApiConventionNameMatchBehavior GetNameMatchBehavior(ApiControllerSymbolCache symbolCache, ISymbol symbol) 83internal static SymbolApiConventionTypeMatchBehavior GetTypeMatchBehavior(ApiControllerSymbolCache symbolCache, ISymbol symbol)
SymbolApiResponseMetadataProvider.cs (1)
110var conventionMethod = conventionType.GetMembers(conventionMethodName)
Microsoft.AspNetCore.OpenApi.SourceGenerators (42)
Helpers\AssemblyTypeSymbolsVisitor.cs (1)
80private bool IsAccessibleType(ISymbol symbol) =>
Helpers\ISymbolExtensions.cs (24)
14public static ImmutableArray<ISymbol> ExplicitOrImplicitInterfaceImplementations(this ISymbol symbol) 21var result = ImmutableArray.CreateBuilder<ISymbol>(); 25foreach (var interfaceMember in iface.GetMembers()) 27var impl = symbol.ContainingType.FindImplementationForInterfaceMember(interfaceMember); 42public static ImmutableArray<ISymbol> ExplicitInterfaceImplementations(this ISymbol symbol) 45IEventSymbol @event => ImmutableArray<ISymbol>.CastUp(@event.ExplicitInterfaceImplementations), 46IMethodSymbol method => ImmutableArray<ISymbol>.CastUp(method.ExplicitInterfaceImplementations), 47IPropertySymbol property => ImmutableArray<ISymbol>.CastUp(property.ExplicitInterfaceImplementations), 51public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 64public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 72public static ImmutableArray<ITypeSymbol> GetAllTypeArguments(this ISymbol symbol) 87public static ImmutableArray<ITypeSymbol> GetTypeArguments(this ISymbol? symbol) 95public static ISymbol? GetOverriddenMember(this ISymbol? symbol, bool allowLooseMatch = false) 102ISymbol? exactMatch = symbol switch 120if (TryFindLooseMatch(symbol, baseType, out var looseMatch)) 129static bool TryFindLooseMatch(ISymbol symbol, INamedTypeSymbol baseType, [NotNullWhen(true)] out ISymbol? looseMatch) 134foreach (var member in baseType.GetMembers(symbol.Name)) 168public static bool IsOverridable([NotNullWhen(true)] this ISymbol? symbol) 175public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol? symbol) 193public static bool IsAccessibleType(this ISymbol symbol)
XmlCommentGenerator.Parser.cs (2)
94if (DocumentationCommentId.GetFirstSymbolForDeclarationId(name, compilation) is ISymbol symbol && 121var symbol = context.SemanticModel.GetSymbolInfo(invocationExpression, cancellationToken).Symbol;
XmlComments\XmlComment.cs (2)
156public static XmlComment? Parse(ISymbol symbol, Compilation compilation, string xmlText, CancellationToken cancellationToken) 191var symbol = DocumentationCommentId.GetFirstSymbolForDeclarationId(cref, compilation);
XmlComments\XmlComment.InheritDoc.cs (13)
25private static string? GetDocumentationComment(ISymbol symbol, string xmlText, HashSet<ISymbol>? visitedSymbols, Compilation compilation, CancellationToken cancellationToken) 59private static bool IsEligibleForAutomaticInheritdoc(ISymbol symbol) 95private static XNode[] RewriteMany(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XNode[] nodes, CancellationToken cancellationToken) 106private static XNode[] RewriteInheritdocElements(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XNode node, CancellationToken cancellationToken) 142private static XNode[]? RewriteInheritdocElement(ISymbol memberSymbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XElement element, CancellationToken cancellationToken) 147var candidate = GetCandidateSymbol(memberSymbol); 158ISymbol? symbol; 269static ISymbol? GetCandidateSymbol(ISymbol memberSymbol)
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (2)
HubClientProxyGenerator.Parser.cs (1)
39var attributeSymbol = ModelExtensions.GetSymbolInfo(context.SemanticModel, attributeSyntax).Symbol;
HubServerProxyGenerator.Parser.cs (1)
39var attributeSymbol = context.SemanticModel.GetSymbolInfo(attributeSyntax).Symbol;
Microsoft.CodeAnalysis (448)
CodeGen\PermissionSetAttribute.cs (1)
84ISymbol iSymbol = _sourceAttribute.GetType(context).GetInternalSymbol()!.GetISymbol();
Compilation\Compilation.cs (14)
893public ISymbol? GetAssemblyOrModuleSymbol(MetadataReference reference) 898protected abstract ISymbol? CommonGetAssemblyOrModuleSymbol(MetadataReference reference); 901internal abstract TSymbol? GetSymbolInternal<TSymbol>(ISymbol? symbol) where TSymbol : class, ISymbolInternal; 1629ISymbol symbol, 1630ISymbol within, 1657void checkInCompilationReferences(ISymbol s, string parameterName) 1707bool isContainingAssemblyInReferences(ISymbol s) 1758ISymbol symbol, 1759ISymbol within, 3066Func<ISymbol, bool> isAddedSymbol, 3093Func<ISymbol, bool> isAddedSymbol, 3139Func<ISymbol, bool> isAddedSymbol, 3701public abstract IEnumerable<ISymbol> GetSymbolsWithName(Func<string, bool> predicate, SymbolFilter filter = SymbolFilter.TypeAndMember, CancellationToken cancellationToken = default(CancellationToken)); 3718public abstract IEnumerable<ISymbol> GetSymbolsWithName(string name, SymbolFilter filter = SymbolFilter.TypeAndMember, CancellationToken cancellationToken = default(CancellationToken));
Compilation\DataFlowAnalysis.cs (14)
23public abstract ImmutableArray<ISymbol> VariablesDeclared { get; } 29public abstract ImmutableArray<ISymbol> DataFlowsIn { get; } 35public abstract ImmutableArray<ISymbol> DataFlowsOut { get; } 43public abstract ImmutableArray<ISymbol> DefinitelyAssignedOnEntry { get; } 51public abstract ImmutableArray<ISymbol> DefinitelyAssignedOnExit { get; } 57public abstract ImmutableArray<ISymbol> AlwaysAssigned { get; } 62public abstract ImmutableArray<ISymbol> ReadInside { get; } 67public abstract ImmutableArray<ISymbol> WrittenInside { get; } 72public abstract ImmutableArray<ISymbol> ReadOutside { get; } 77public abstract ImmutableArray<ISymbol> WrittenOutside { get; } 86public abstract ImmutableArray<ISymbol> Captured { get; } 91public abstract ImmutableArray<ISymbol> CapturedInside { get; } 96public abstract ImmutableArray<ISymbol> CapturedOutside { get; } 102public abstract ImmutableArray<ISymbol> UnsafeAddressTaken { get; }
Compilation\Extensions.cs (2)
129public static ISymbol? GetDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)) 140public static ImmutableArray<ISymbol> GetMemberGroup(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken))
Compilation\IImportScope.cs (2)
13/// location can be found using either <see cref="ISymbol.Locations"/> or <see 14/// cref="ISymbol.DeclaringSyntaxReferences"/> on the <see cref="IAliasSymbol"/> itself. For <see cref="Imports"/>
Compilation\SemanticModel.cs (26)
387internal ISymbol? GetDeclaredSymbolForNode(SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)) 401protected abstract ISymbol? GetDeclaredSymbolCore(SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)); 419internal ImmutableArray<ISymbol> GetDeclaredSymbolsForNode(SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)) 440protected abstract ImmutableArray<ISymbol> GetDeclaredSymbolsCore(SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)); 463public ImmutableArray<ISymbol> LookupSymbols( 475protected abstract ImmutableArray<ISymbol> LookupSymbolsCore( 516public ImmutableArray<ISymbol> LookupBaseMembers( 526protected abstract ImmutableArray<ISymbol> LookupBaseMembersCore( 550public ImmutableArray<ISymbol> LookupStaticMembers( 561protected abstract ImmutableArray<ISymbol> LookupStaticMembersCore( 584public ImmutableArray<ISymbol> LookupNamespacesAndTypes( 595protected abstract ImmutableArray<ISymbol> LookupNamespacesAndTypesCore( 614public ImmutableArray<ISymbol> LookupLabels( 624protected abstract ImmutableArray<ISymbol> LookupLabelsCore( 762internal ImmutableArray<ISymbol> GetMemberGroup(SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken)) 772protected abstract ImmutableArray<ISymbol> GetMemberGroupCore(SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken)); 778public ISymbol? GetEnclosingSymbol(int position, CancellationToken cancellationToken = default(CancellationToken)) 787protected abstract ISymbol? GetEnclosingSymbolCore(int position, CancellationToken cancellationToken = default(CancellationToken)); 814public bool IsAccessible(int position, ISymbol symbol) 834protected abstract bool IsAccessibleCore(int position, ISymbol symbol); 887internal abstract void ComputeDeclarationsInNode(SyntaxNode node, ISymbol associatedSymbol, bool getSymbol, ArrayBuilder<DeclarationInfo> builder, CancellationToken cancellationToken, int? levelsToCompute = null); 895/// <see cref="ShouldSkipSyntaxNodeAnalysis(SyntaxNode, ISymbol)"/>. 897internal virtual Func<SyntaxNode, bool>? GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol) => null; 903/// logic to <see cref="GetSyntaxNodesToAnalyzeFilter(SyntaxNode, ISymbol)"/>. 905internal virtual bool ShouldSkipSyntaxNodeAnalysis(SyntaxNode node, ISymbol containingSymbol) => false; 910protected internal virtual SyntaxNode GetTopmostNodeForDiagnosticAnalysis(ISymbol symbol, SyntaxNode declaringSyntax)
Compilation\SymbolInfo.cs (12)
22private readonly ImmutableArray<ISymbol> _candidateSymbols; 30public ISymbol? Symbol { get; } 39public ImmutableArray<ISymbol> CandidateSymbols => _candidateSymbols.NullToEmpty(); 48internal SymbolInfo(ISymbol symbol) 49: this(symbol, ImmutableArray<ISymbol>.Empty, CandidateReason.None) 53internal SymbolInfo(ISymbol symbol, CandidateReason reason) 54: this(symbol, ImmutableArray<ISymbol>.Empty, reason) 58internal SymbolInfo(ImmutableArray<ISymbol> candidateSymbols, CandidateReason candidateReason) 63private SymbolInfo(ISymbol? symbol, ImmutableArray<ISymbol> candidateSymbols, CandidateReason candidateReason) 71foreach (var item in _candidateSymbols) 80internal ImmutableArray<ISymbol> GetAllSymbols()
Diagnostic\CommonMessageProvider.cs (1)
104public abstract string GetErrorDisplayString(ISymbol symbol);
Diagnostic\DiagnosticInfo.cs (2)
343var symbol = _arguments[i] as ISymbol ?? (_arguments[i] as ISymbolInternal)?.GetISymbol();
DiagnosticAnalyzer\AnalysisContextInfo.cs (5)
18private readonly ISymbol? _symbol; 32public AnalysisContextInfo(Compilation compilation, ISymbol symbol) : 52public AnalysisContextInfo(Compilation compilation, ISymbol symbol, SyntaxNode node) : 60ISymbol? symbol, 90sb.AppendLine($"{nameof(ISymbol)}: {_symbol.Name} ({_symbol.Kind})");
DiagnosticAnalyzer\AnalysisScope.cs (2)
219public static bool ShouldSkipDeclarationAnalysis(ISymbol symbol) 238Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopmostNodeForAnalysis,
DiagnosticAnalyzer\AnalyzerDriver.cs (38)
38private static readonly Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> s_getTopmostNodeForAnalysis = GetTopmostNodeForAnalysis; 247private Dictionary<SyntaxTree, ImmutableHashSet<ISymbol>>? _lazyGeneratedCodeSymbolsForTreeMap; 252private Dictionary<SyntaxTree, ImmutableHashSet<ISymbol>> GeneratedCodeSymbolsForTreeMap 291private ConcurrentDictionary<ISymbol, bool>? _lazyIsGeneratedCodeSymbolMap; 296private ConcurrentDictionary<ISymbol, bool> IsGeneratedCodeSymbolMap 419_lazyGeneratedCodeSymbolsForTreeMap = new Dictionary<SyntaxTree, ImmutableHashSet<ISymbol>>(); 420_lazyIsGeneratedCodeSymbolMap = new ConcurrentDictionary<ISymbol, bool>(); 1274foreach (var symbol in declaredSymbols) 1287ImmutableHashSet<ISymbol> getOrComputeGeneratedCodeSymbolsInTree(SyntaxTree tree, Compilation compilation, CancellationToken cancellationToken) 1292ImmutableHashSet<ISymbol>? generatedCodeSymbols; 1305ImmutableHashSet<ISymbol>? existingGeneratedCodeSymbols; 1318static ImmutableHashSet<ISymbol> computeGeneratedCodeSymbolsInTree(SyntaxTree tree, Compilation compilation, INamedTypeSymbol generatedCodeAttribute, CancellationToken cancellationToken) 1324return ImmutableHashSet<ISymbol>.Empty; 1331ImmutableHashSet<ISymbol>.Builder? generatedSymbolsBuilder = null; 1334var symbol = declarationInfo.DeclaredSymbol; 1338generatedSymbolsBuilder ??= ImmutableHashSet.CreateBuilder<ISymbol>(); 1344return generatedSymbolsBuilder != null ? generatedSymbolsBuilder.ToImmutable() : ImmutableHashSet<ISymbol>.Empty; 1685async Task onSymbolAndMembersProcessedAsync(ISymbol symbol, DiagnosticAnalyzer analyzer) 1703async Task processContainerOnMemberCompletedAsync(INamespaceOrTypeSymbol containerSymbol, ISymbol processedMemberSymbol, DiagnosticAnalyzer analyzer) 1755var symbol = symbolEvent.Symbol; 1788var symbol = symbolEvent.Symbol; 1819var symbol = symbolEvent.Symbol; 1885private static SyntaxNode GetTopmostNodeForAnalysis(ISymbol symbol, SyntaxReference syntaxReference, Compilation compilation, CancellationToken cancellationToken) 2107ISymbol symbol, 2138ISymbol symbol, 2167async ValueTask<IGroupedAnalyzerActions> getAllActionsAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer, SyntaxTree? filterTree, TextSpan? filterSpan, CancellationToken cancellationToken) 2183async ValueTask<IGroupedAnalyzerActions> getInheritedActionsAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer, SyntaxTree? filterTree, TextSpan? filterSpan, CancellationToken cancellationToken) 2207static async ValueTask<AnalyzerActions> getSymbolActionsCoreAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer, SyntaxTree? filterTree, TextSpan? filterSpan, CancellationToken cancellationToken) 2272private bool IsGeneratedCodeSymbol(ISymbol symbol, CancellationToken cancellationToken) 2447ISymbol symbol, 2501var symbol = symbolEvent.Symbol; 2536ISymbol symbol, 2556private static void ComputeDeclarationsInNode(SemanticModel semanticModel, ISymbol declaredSymbol, SyntaxNode declaringReferenceSyntax, SyntaxNode topmostNodeForAnalysis, ArrayBuilder<DeclarationInfo> builder, CancellationToken cancellationToken) 2583var symbol = symbolEvent.Symbol; 2859ISymbol declaredSymbol, 2892var declaredSymbolOfDeclInNode = declInNode.DeclaredSymbol ?? semanticModel.GetDeclaredSymbol(declInNode.DeclaredNode, cancellationToken); 2917private static bool IsEquivalentSymbol(ISymbol declaredSymbol, ISymbol? otherSymbol)
DiagnosticAnalyzer\AnalyzerExecutor.cs (20)
246ISymbol symbol, 367Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 382var symbol = symbolDeclaredEvent.Symbol; 425ISymbol processedMemberSymbol, 427Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 464Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 481Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 492var symbol = symbolDeclaredEvent.Symbol; 717ISymbol declaredSymbol, 723public readonly ISymbol DeclaredSymbol = declaredSymbol; 738ISymbol declaredSymbol, 841ISymbol declaredSymbol, 1002ISymbol declaredSymbol, 1102ISymbol declaredSymbol, 1169internal static bool CanHaveExecutableCodeBlock(ISymbol symbol) 1415private Action<Diagnostic> GetAddDiagnostic(ISymbol contextSymbol, ImmutableArray<SyntaxReference> cachedDeclaringReferences, DiagnosticAnalyzer analyzer, Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, CancellationToken cancellationToken) 1422ISymbol contextSymbol, 1429Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 1558private bool IsAnalyzerSuppressedForSymbol(DiagnosticAnalyzer analyzer, ISymbol symbol, CancellationToken cancellationToken)
DiagnosticAnalyzer\AnalyzerManager.AnalyzerExecutionContext.cs (23)
33private Dictionary<ISymbol, HashSet<ISymbol>?>? _lazyPendingMemberSymbolsMap; 38private Dictionary<ISymbol, (ImmutableArray<SymbolEndAnalyzerAction>, SymbolDeclaredCompilationEvent)>? _lazyPendingSymbolEndActionsMap; 54private Dictionary<ISymbol, Task<HostSymbolStartAnalysisScope>>? _lazySymbolScopeTasks; 140ISymbol symbol, 150_lazySymbolScopeTasks ??= new Dictionary<ISymbol, Task<HostSymbolStartAnalysisScope>>(); 170_lazyPendingMemberSymbolsMap ??= new Dictionary<ISymbol, HashSet<ISymbol>?>(); 182HashSet<ISymbol>? getDependentSymbols() 184HashSet<ISymbol>? memberSet = null; 198void processMembers(IEnumerable<ISymbol> members) 200foreach (var member in members) 204memberSet ??= new HashSet<ISymbol>(); 223private void VerifyNewEntryForPendingMemberSymbolsMap(ISymbol symbol, HashSet<ISymbol>? dependentSymbols) 241public void ClearSymbolScopeTask(ISymbol symbol) 403ISymbol containingSymbol, 404ISymbol processedMemberSymbol, 436var symbol = symbolDeclaredEvent.Symbol; 455public void MarkSymbolEndAnalysisComplete(ISymbol symbol) 463public void MarkSymbolEndAnalysisPending(ISymbol symbol, ImmutableArray<SymbolEndAnalyzerAction> symbolEndActions, SymbolDeclaredCompilationEvent symbolDeclaredEvent) 471private void MarkSymbolEndAnalysisPending_NoLock(ISymbol symbol, ImmutableArray<SymbolEndAnalyzerAction> symbolEndActions, SymbolDeclaredCompilationEvent symbolDeclaredEvent) 473_lazyPendingSymbolEndActionsMap ??= new Dictionary<ISymbol, (ImmutableArray<SymbolEndAnalyzerAction>, SymbolDeclaredCompilationEvent)>();
DiagnosticAnalyzer\AnalyzerManager.cs (7)
92ISymbol symbol, 106ISymbol symbol, 186ISymbol symbol, 465ISymbol containingSymbol, 466ISymbol processedMemberSymbol, 479ISymbol symbol, 487public void MarkSymbolEndAnalysisComplete(ISymbol symbol, DiagnosticAnalyzer analyzer)
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (65)
71/// Register an action to be executed at completion of semantic analysis of an <see cref="ISymbol"/> with an appropriate Kind. 72/// A symbol action reports <see cref="Diagnostic"/>s about <see cref="ISymbol"/>s. 74/// <param name="action">Action to be executed for an <see cref="ISymbol"/>.</param> 75/// <param name="symbolKinds">Action will be executed only if an <see cref="ISymbol"/>'s Kind matches one of the <see cref="SymbolKind"/> values.</param> 82/// Register an action to be executed at completion of semantic analysis of an <see cref="ISymbol"/> with an appropriate Kind. 83/// A symbol action reports <see cref="Diagnostic"/>s about <see cref="ISymbol"/>s. 85/// <param name="action">Action to be executed for an <see cref="ISymbol"/>.</param> 86/// <param name="symbolKinds">Action will be executed only if an <see cref="ISymbol"/>'s Kind matches one of the <see cref="SymbolKind"/> values.</param> 90/// Register an action to be executed at start of semantic analysis of an <see cref="ISymbol"/> and its members with an appropriate Kind. 93/// <param name="symbolKind">Action will be executed only if an <see cref="ISymbol"/>'s Kind matches the given <see cref="SymbolKind"/>.</param> 366/// Register an action to be executed at completion of semantic analysis of an <see cref="ISymbol"/> with an appropriate Kind. 367/// A symbol action reports <see cref="Diagnostic"/>s about <see cref="ISymbol"/>s. 369/// <param name="action">Action to be executed for an <see cref="ISymbol"/>.</param> 370/// <param name="symbolKinds">Action will be executed only if an <see cref="ISymbol"/>'s Kind matches one of the <see cref="SymbolKind"/> values.</param> 377/// Register an action to be executed at completion of semantic analysis of an <see cref="ISymbol"/> with an appropriate Kind. 378/// A symbol action reports <see cref="Diagnostic"/>s about <see cref="ISymbol"/>s. 380/// <param name="action">Action to be executed for an <see cref="ISymbol"/>.</param> 381/// <param name="symbolKinds">Action will be executed only if an <see cref="ISymbol"/>'s Kind matches one of the <see cref="SymbolKind"/> values.</param> 385/// Register an action to be executed at start of semantic analysis of an <see cref="ISymbol"/> and its members with an appropriate Kind. 388/// <param name="symbolKind">Action will be executed only if an <see cref="ISymbol"/>'s Kind matches the given <see cref="SymbolKind"/>.</param> 762/// A symbol action can use a <see cref="SymbolAnalysisContext"/> to report <see cref="Diagnostic"/>s about an <see cref="ISymbol"/>. 766private readonly ISymbol _symbol; 774/// <see cref="ISymbol"/> that is the subject of the analysis. 776public ISymbol Symbol { get { return _symbol; } } 779/// <see cref="CodeAnalysis.Compilation"/> containing the <see cref="ISymbol"/>. 815public SymbolAnalysisContext(ISymbol symbol, Compilation compilation, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 821ISymbol symbol, 845/// Report a <see cref="Diagnostic"/> about an <see cref="ISymbol"/>. 860/// A symbol start/end action can use a <see cref="SymbolStartAnalysisContext"/> to report <see cref="Diagnostic"/>s about code within a <see cref="ISymbol"/> and its members. 865/// <see cref="ISymbol"/> that is the subject of the analysis. 867public ISymbol Symbol { get; } 870/// <see cref="CodeAnalysis.Compilation"/> containing the <see cref="ISymbol"/>. 904public SymbolStartAnalysisContext(ISymbol symbol, Compilation compilation, AnalyzerOptions options, CancellationToken cancellationToken) 909internal SymbolStartAnalysisContext(ISymbol symbol, Compilation compilation, AnalyzerOptions options, bool isGeneratedCode, SyntaxTree? filterTree, TextSpan? filterSpan, CancellationToken cancellationToken) 923/// Register an action to be executed at end of semantic analysis of an <see cref="ISymbol"/> and its members. 1021private readonly ISymbol _owningSymbol; 1032/// <see cref="ISymbol"/> for which the code block provides a definition or value. 1034public ISymbol OwningSymbol { get { return _owningSymbol; } } 1069protected CodeBlockStartAnalysisContext(SyntaxNode codeBlock, ISymbol owningSymbol, SemanticModel semanticModel, AnalyzerOptions options, CancellationToken cancellationToken) 1076ISymbol owningSymbol, 1129private readonly ISymbol _owningSymbol; 1142/// <see cref="ISymbol"/> for which the code block provides a definition or value. 1144public ISymbol OwningSymbol { get { return _owningSymbol; } } 1179public CodeBlockAnalysisContext(SyntaxNode codeBlock, ISymbol owningSymbol, SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 1186ISymbol owningSymbol, 1237private readonly ISymbol _owningSymbol; 1252/// <see cref="ISymbol"/> for which the <see cref="OperationBlocks"/> provides a definition or value. 1254public ISymbol OwningSymbol => _owningSymbol; 1291ISymbol owningSymbol, 1302ISymbol owningSymbol, 1377private readonly ISymbol _owningSymbol; 1394/// <see cref="ISymbol"/> for which the <see cref="OperationBlocks"/> provides a definition or value. 1396public ISymbol OwningSymbol => _owningSymbol; 1433ISymbol owningSymbol, 1446ISymbol owningSymbol, 1661private readonly ISymbol? _containingSymbol; 1674/// <see cref="ISymbol"/> for the declaration containing the syntax node. 1676public ISymbol? ContainingSymbol => _containingSymbol; 1716public SyntaxNodeAnalysisContext(SyntaxNode node, ISymbol? containingSymbol, SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 1729ISymbol? containingSymbol, 1771private readonly ISymbol _containingSymbol; 1785/// <see cref="ISymbol"/> for the declaration containing the operation. 1787public ISymbol ContainingSymbol => _containingSymbol; 1824ISymbol containingSymbol, 1836ISymbol containingSymbol,
DiagnosticAnalyzer\DiagnosticStartAnalysisScope.cs (3)
229ISymbol owningSymbol, 294ISymbol owningSymbol, 328ISymbol owningSymbol,
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (20)
36private readonly ConcurrentDictionary<ISymbol, ImmutableDictionary<string, SuppressMessageInfo>> _localSuppressionsBySymbol; 41private StrongBox<ISymbol?>? _lazySuppressMessageAttribute; 42private StrongBox<ISymbol?>? _lazyUnconditionalSuppressMessageAttribute; 47private readonly Dictionary<ISymbol, Dictionary<string, SuppressMessageInfo>> _globalSymbolSuppressions = new Dictionary<ISymbol, Dictionary<string, SuppressMessageInfo>>(); 54public void AddGlobalSymbolSuppression(ISymbol symbol, SuppressMessageInfo info) 73public bool HasGlobalSymbolSuppression(ISymbol symbol, string id, bool isImmediatelyContainingSymbol, out SuppressMessageInfo info) 108_localSuppressionsBySymbol = new ConcurrentDictionary<ISymbol, ImmutableDictionary<string, SuppressMessageInfo>>(); 173foreach (var symbol in declaredSymbols) 212private bool IsDiagnosticGloballySuppressed(string id, ISymbol? symbolOpt, bool isImmediatelyContainingSymbol, out SuppressMessageInfo info) 219private bool IsDiagnosticLocallySuppressed(string id, ISymbol symbol, out SuppressMessageInfo info) 225private ISymbol? SuppressMessageAttribute 233new StrongBox<ISymbol?>(_compilation.GetTypeByMetadataName("System.Diagnostics.CodeAnalysis.SuppressMessageAttribute")), 241private ISymbol? UnconditionalSuppressMessageAttribute 249new StrongBox<ISymbol?>(_compilation.GetTypeByMetadataName("System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute")), 277private ImmutableDictionary<string, SuppressMessageInfo> DecodeLocalSuppressMessageAttributes(ISymbol symbol) 311private void DecodeGlobalSuppressMessageAttributes(Compilation compilation, ISymbol symbol, GlobalSuppressions globalSuppressions) 350foreach (var target in ResolveTargetSymbols(compilation, info.Target, scope)) 357internal static ImmutableArray<ISymbol> ResolveTargetSymbols(Compilation compilation, string target, TargetScope scope) 370return ImmutableArray<ISymbol>.Empty;
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (17)
65public ImmutableArray<ISymbol> Resolve(out bool resolvedWithDocCommentIdFormat) 70return ImmutableArray<ISymbol>.Empty; 82var results = ArrayBuilder<ISymbol>.GetInstance(); 198ISymbol singleResult; 377private TypeInfo? ParseType(ISymbol bindingContext) 491private TypeInfo? ParseIndexedTypeParameter(ISymbol bindingContext) 540private TypeInfo? ParseNamedTypeParameter(ISymbol bindingContext) 574private TypeInfo? ParseNamedType(ISymbol bindingContext) 655private TypeInfo[] ParseTypeArgumentList(ISymbol bindingContext) 724private ISymbol GetFirstMatchingIndexer(ImmutableArray<ISymbol> candidateMembers, ParameterInfo[] parameters) 726foreach (var symbol in candidateMembers) 738private ImmutableArray<IMethodSymbol> GetMatchingMethods(ImmutableArray<ISymbol> candidateMembers, int? arity, ParameterInfo[] parameters, TypeInfo? returnType) 742foreach (var symbol in candidateMembers) 806private ITypeSymbol BindParameterOrReturnType(ISymbol bindingContext, TypeInfo type) 821private static INamedTypeSymbol GetFirstMatchingNamedType(ImmutableArray<ISymbol> candidateMembers, int arity) 828private static INamespaceOrTypeSymbol GetFirstMatchingNamespaceOrType(ImmutableArray<ISymbol> candidateMembers)
DiagnosticAnalyzer\SymbolDeclaredCompilationEvent.cs (1)
31public ISymbol Symbol => SymbolInternal.GetISymbol();
DocumentationCommentId.cs (52)
41private static readonly ListPool<ISymbol> s_symbolListPool = new ListPool<ISymbol>(); 50public static string? CreateDeclarationId(ISymbol symbol) 69public static string CreateReferenceId(ISymbol symbol) 98public static ImmutableArray<ISymbol> GetSymbolsForDeclarationId(string id, Compilation compilation) 126private static bool TryGetSymbolsForDeclarationId(string id, Compilation compilation, List<ISymbol> results) 149public static ISymbol? GetFirstSymbolForDeclarationId(string id, Compilation compilation) 176public static ImmutableArray<ISymbol> GetSymbolsForReferenceId(string id, Compilation compilation) 204private static bool TryGetSymbolsForReferenceId(string id, Compilation compilation, List<ISymbol> results) 232public static ISymbol? GetFirstSymbolForReferenceId(string id, Compilation compilation) 318/// Callers should only call into <see cref="SymbolVisitor{TResult}.Visit(ISymbol?)"/> and should check <see 344public override void DefaultVisit(ISymbol symbol) 399private ReferenceGenerator GetReferenceGenerator(ISymbol typeParameterContext) 412public override bool DefaultVisit(ISymbol symbol) 544private readonly ISymbol? _typeParameterContext; 546public ReferenceGenerator(StringBuilder builder, ISymbol? typeParameterContext) 552public ISymbol? TypeParameterContext 557private void BuildDottedName(ISymbol symbol) 673var container = symbol.ContainingSymbol?.ContainingSymbol; 685var typeParameterDeclarer = typeParameterSymbol.ContainingSymbol; 687for (var scope = _typeParameterContext; scope != null; scope = scope.ContainingSymbol) 701public static bool ParseDeclaredSymbolId(string id, Compilation compilation, List<ISymbol> results) 720public static bool ParseReferencedSymbolId(string id, Compilation compilation, List<ISymbol> results) 733private static void ParseDeclaredId(string id, ref int index, Compilation compilation, List<ISymbol> results) 864private static ITypeSymbol? ParseTypeSymbol(string id, ref int index, Compilation compilation, ISymbol? typeParameterContext) 885private static void ParseTypeSymbol(string id, ref int index, Compilation compilation, ISymbol? typeParameterContext, List<ISymbol> results) 909foreach (var context in contexts) 973private static void ParseTypeParameterSymbol(string id, ref int index, ISymbol? typeParameterContext, List<ISymbol> results) 1010private static void ParseNamedTypeSymbol(string id, ref int index, Compilation compilation, ISymbol? typeParameterContext, List<ISymbol> results) 1121private static bool ParseTypeArguments(string id, ref int index, Compilation compilation, ISymbol? typeParameterContext, List<ITypeSymbol> typeArguments) 1155private static void GetMatchingTypes(List<INamespaceOrTypeSymbol> containers, string memberName, int arity, List<ISymbol> results) 1163private static void GetMatchingTypes(INamespaceOrTypeSymbol container, string memberName, int arity, List<ISymbol> results) 1167foreach (var symbol in members) 1180private static void GetMatchingNamespaceOrTypes(List<INamespaceOrTypeSymbol> containers, string memberName, List<ISymbol> results) 1188private static void GetMatchingNamespaceOrTypes(INamespaceOrTypeSymbol container, string memberName, List<ISymbol> results) 1192foreach (var symbol in members) 1201private static void GetMatchingNamespaces(List<INamespaceOrTypeSymbol> containers, string memberName, List<ISymbol> results) 1209private static void GetMatchingNamespaces(INamespaceOrTypeSymbol container, string memberName, List<ISymbol> results) 1213foreach (var symbol in members) 1222private static void GetMatchingMethods(string id, ref int index, List<INamespaceOrTypeSymbol> containers, string memberName, int arity, Compilation compilation, List<ISymbol> results) 1234foreach (var symbol in members) 1289private static void GetMatchingProperties(string id, ref int index, List<INamespaceOrTypeSymbol> containers, string memberName, Compilation compilation, List<ISymbol> results) 1302foreach (var symbol in members) 1347private static void GetMatchingFields(List<INamespaceOrTypeSymbol> containers, string memberName, List<ISymbol> results) 1353foreach (var symbol in members) 1363private static void GetMatchingEvents(List<INamespaceOrTypeSymbol> containers, string memberName, List<ISymbol> results) 1369foreach (var symbol in members) 1453private static bool ParseParameterList(string id, ref int index, Compilation compilation, ISymbol typeParameterContext, List<ParameterInfo> parameters) 1494private static ParameterInfo? ParseParameter(string id, ref int index, Compilation compilation, ISymbol? typeParameterContext)
Emit\EditAndContinue\DefinitionMap.cs (1)
105protected abstract ISymbolInternal? GetISymbolInternalOrNull(ISymbol symbol);
Emit\EditAndContinue\SymbolChanges.cs (5)
48private readonly Func<ISymbol, bool> _isAddedSymbol; 50protected SymbolChanges(DefinitionMap definitionMap, IEnumerable<SemanticEdit> edits, Func<ISymbol, bool> isAddedSymbol) 88public bool IsAdded(ISymbol symbol) 320protected abstract ISymbolInternal? GetISymbolInternalOrNull(ISymbol symbol); 322public ISymbolInternal GetRequiredInternalSymbol(ISymbol? symbol)
Emit\NoPia\CommonEmbeddedParameter.cs (1)
271return ((ISymbol)UnderlyingParameter).ToDisplayString(SymbolDisplayFormat.ILVisualizationFormat);
Emit\SemanticEdit.cs (8)
30public ISymbol? OldSymbol { get; } 36public ISymbol? NewSymbol { get; } 65public SemanticEdit(SemanticEditKind kind, ISymbol? oldSymbol, ISymbol? newSymbol, Func<SyntaxNode, SyntaxNode?>? syntaxMap, bool preserveLocalVariables) 74public SemanticEdit(SemanticEditKind kind, ISymbol? oldSymbol, ISymbol? newSymbol, Func<SyntaxNode, SyntaxNode?>? syntaxMap, bool preserveLocalVariables, MethodInstrumentation instrumentation) 104public SemanticEdit(SemanticEditKind kind, ISymbol? oldSymbol, ISymbol? newSymbol, Func<SyntaxNode, SyntaxNode?>? syntaxMap = null, Func<SyntaxNode, RuntimeRudeEdit?>? runtimeRudeEdit = null, MethodInstrumentation instrumentation = default)
Generated\Operations.Generated.cs (30)
906ISymbol Member { get; } 2951ISymbol? DeclaredSymbol { get; } 3227ISymbol? DeconstructSymbol { get; } 3239ISymbol? DeclaredSymbol { get; } 3775ISymbol? LengthSymbol { get; } 3780ISymbol? IndexerSymbol { get; } 3788ISymbol? DeclaredSymbol { get; } 3806ISymbol? SliceSymbol { get; } 3842ISymbol LengthSymbol { get; } 3846ISymbol IndexerSymbol { get; } 8570internal DeclarationPatternOperation(ITypeSymbol? matchedType, bool matchesNull, ISymbol? declaredSymbol, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8579public ISymbol? DeclaredSymbol { get; } 9227internal RecursivePatternOperation(ITypeSymbol matchedType, ISymbol? deconstructSymbol, ImmutableArray<IPatternOperation> deconstructionSubpatterns, ImmutableArray<IPropertySubpatternOperation> propertySubpatterns, ISymbol? declaredSymbol, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9237public ISymbol? DeconstructSymbol { get; } 9240public ISymbol? DeclaredSymbol { get; } 10357internal ListPatternOperation(ISymbol? lengthSymbol, ISymbol? indexerSymbol, ImmutableArray<IPatternOperation> patterns, ISymbol? declaredSymbol, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 10365public ISymbol? LengthSymbol { get; } 10366public ISymbol? IndexerSymbol { get; } 10368public ISymbol? DeclaredSymbol { get; } 10418internal SlicePatternOperation(ISymbol? sliceSymbol, IPatternOperation? pattern, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 10424public ISymbol? SliceSymbol { get; } 10471internal ImplicitIndexerReferenceOperation(IOperation instance, IOperation argument, ISymbol lengthSymbol, ISymbol indexerSymbol, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10482public ISymbol LengthSymbol { get; } 10483public ISymbol IndexerSymbol { get; } 10795private ImmutableArray<(ISymbol, T)> VisitArray<T>(ImmutableArray<(ISymbol, T)> nodes) where T : IOperation => nodes.SelectAsArray((n, @this) => (n.Item1, @this.Visit(n.Item2)), this)!;
Operations\ControlFlowGraphBuilder.cs (1)
3338foreach (ISymbol candidate in valueType.GetMembers(method.Name))
Operations\OperationNodes.cs (5)
184public abstract ISymbol Member { get; } 189public override ISymbol Member => Method; 194public override ISymbol Member => Property; 199public override ISymbol Member => Event; 204public override ISymbol Member => Field;
SourceGeneration\GeneratedCodeUtilities.cs (1)
19ISymbol symbol, INamedTypeSymbol generatedCodeAttribute)
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithMetadataName.cs (5)
27public ISymbol TargetSymbol { get; } 39/// To get the entire list of attributes, use <see cref="ISymbol.GetAttributes"/> on <see cref="TargetSymbol"/>. 46ISymbol targetSymbol, 110var targetSymbol = 139ISymbol symbol,
src\Compilers\Core\AnalyzerDriver\DeclarationComputer.cs (4)
17var declaredSymbol = GetDeclaredSymbol(model, node, getSymbol, cancellationToken); 21internal static DeclarationInfo GetDeclarationInfo(SyntaxNode node, ISymbol? declaredSymbol, IEnumerable<SyntaxNode>? executableCodeBlocks) 42private static ISymbol? GetDeclaredSymbol(SemanticModel model, SyntaxNode node, bool getSymbol, CancellationToken cancellationToken) 49var declaredSymbol = model.GetDeclaredSymbol(node, cancellationToken);
src\Compilers\Core\AnalyzerDriver\DeclarationInfo.cs (2)
15internal DeclarationInfo(SyntaxNode declaredNode, ImmutableArray<SyntaxNode> executableCodeBlocks, ISymbol? declaredSymbol) 42public ISymbol? DeclaredSymbol { get; }
SymbolDisplay\AbstractSymbolDisplayVisitor.cs (2)
198var containingSymbol = type.ContainingSymbol; 317foreach (var member in enumType.GetMembers())
SymbolDisplay\AbstractSymbolDisplayVisitor_Minimal.cs (9)
25ImmutableArray<ISymbol> normalSymbols = ShouldRestrictMinimallyQualifyLookupToNamespacesAndTypes() 28ISymbol? normalSymbol = SingleSymbolWithArity(normalSymbols, symbol.Arity); 44ImmutableArray<ISymbol> typeOnlySymbols = SemanticModelOpt.LookupNamespacesAndTypes(PositionOpt, name: symbol.Name); 45ISymbol? typeOnlySymbol = SingleSymbolWithArity(typeOnlySymbols, symbol.Arity); 62private static ISymbol? SingleSymbolWithArity(ImmutableArray<ISymbol> candidates, int desiredArity) 64ISymbol? singleSymbol = null; 65foreach (ISymbol candidate in candidates) 97protected static ITypeSymbol? GetSymbolType(ISymbol symbol)
SymbolDisplay\FormattedSymbolList.cs (3)
18private readonly IEnumerable<ISymbol> _symbols; 21internal FormattedSymbolList(IEnumerable<ISymbol> symbols, SymbolDisplayFormat symbolDisplayFormat = null) 35foreach (var symbol in _symbols)
SymbolDisplay\SymbolDisplayFormat.cs (1)
147/// Formats a symbol description in a form that suits <see cref="ISymbol.ToMinimalDisplayString"/>.
SymbolDisplay\SymbolDisplayMiscellaneousOptions.cs (1)
49/// Has no effect outside <see cref="ISymbol.ToMinimalDisplayString"/> and only applies
SymbolDisplay\SymbolDisplayPart.cs (5)
13/// <seealso cref="ISymbol.ToDisplayParts"/> 14/// <seealso cref="ISymbol.ToMinimalDisplayParts"/> 20private readonly ISymbol? _symbol; 32public ISymbol? Symbol { get { return _symbol; } } 40public SymbolDisplayPart(SymbolDisplayPartKind kind, ISymbol? symbol, string text)
Symbols\IErrorTypeSymbol.cs (1)
33ImmutableArray<ISymbol> CandidateSymbols { get; }
Symbols\IFieldSymbol.cs (1)
26ISymbol? AssociatedSymbol { get; }
Symbols\IMethodSymbol.cs (1)
240ISymbol? AssociatedSymbol { get; }
Symbols\INamedTypeSymbol.cs (1)
164ISymbol? AssociatedSymbol { get; }
Symbols\INamespaceOrTypeSymbol.cs (2)
25ImmutableArray<ISymbol> GetMembers(); 32ImmutableArray<ISymbol> GetMembers(string name);
Symbols\ISymbol.cs (6)
23public interface ISymbol : IEquatable<ISymbol?> 68/// Gets the <see cref="ISymbol"/> for the immediately containing symbol. 70ISymbol ContainingSymbol { get; } 205/// Gets the <see cref="ISymbol"/> for the original definition of the symbol. 209ISymbol OriginalDefinition { get; } 313bool Equals([NotNullWhen(returnValue: true)] ISymbol? other, SymbolEqualityComparer equalityComparer);
Symbols\ISymbolExtensions.cs (2)
109internal static bool IsInSource(this ISymbol symbol) 176foreach (var member in members)
Symbols\ISymbolInternal.cs (4)
14/// An object implementing this interface might also implement <see cref="ISymbol"/> (as is done in VB), 155/// Returns an <see cref="ISymbol"/> instance associated with this symbol. 157ISymbol GetISymbol(); 170/// cref="ISymbol.Locations"/> as it will avoid an unnecessary array allocation.
Symbols\ITypeSymbol.cs (2)
117ISymbol? FindImplementationForInterfaceMember(ISymbol interfaceMember);
Symbols\SymbolEqualityComparer.cs (8)
12/// Allows for the comparison of two <see cref="ISymbol"/> instances 14public sealed class SymbolEqualityComparer : IEqualityComparer<ISymbol?> 17/// Compares two <see cref="ISymbol"/> instances based on the default comparison rules, equivalent to calling <see cref="IEquatable{ISymbol}.Equals(ISymbol)"/>. 25/// Compares two <see cref="ISymbol"/> instances, considering that a reference type and the same nullable reference type are not equal. 45/// Determines if two <see cref="ISymbol" /> instances are equal according to the rules of this comparer 50public bool Equals(ISymbol? x, ISymbol? y) 60public int GetHashCode(ISymbol? obj)
Symbols\SymbolVisitor.cs (2)
9public virtual void Visit(ISymbol? symbol) 14public virtual void DefaultVisit(ISymbol symbol)
Symbols\SymbolVisitor`1.cs (2)
9public virtual TResult? Visit(ISymbol? symbol) 16public virtual TResult? DefaultVisit(ISymbol symbol)
Symbols\SymbolVisitor`2.cs (2)
11public virtual TResult Visit(ISymbol? symbol, TArgument argument) 21public virtual TResult DefaultVisit(ISymbol symbol, TArgument argument)
Symbols\TypedConstant.cs (1)
26Debug.Assert(!(value is ISymbol) || value is ISymbolInternal);
TreeDumper.cs (2)
223var symbol = o as ISymbol;
Microsoft.CodeAnalysis.Analyzers (164)
MetaAnalyzers\CompareSymbolsCorrectlyAnalyzer.cs (2)
29private static readonly string s_symbolTypeFullName = typeof(ISymbol).FullName; 30private const string s_symbolEqualsName = nameof(ISymbol.Equals);
MetaAnalyzers\CompilerExtensionStrictApiAnalyzer.cs (1)
174$"Expected attributes returned by {nameof(ISymbol.GetAttributes)} (as opposed to {nameof(ITypeSymbolExtensions.GetApplicableAttributes)}) to have a non-null application.");
MetaAnalyzers\CompilerExtensionTargetFrameworkAnalyzer.cs (1)
123$"Expected attributes returned by {nameof(ISymbol.GetAttributes)} (as opposed to {nameof(ITypeSymbolExtensions.GetApplicableAttributes)}) to have a non-null application.");
MetaAnalyzers\DiagnosticAnalyzerFieldsAnalyzer.cs (1)
35private static readonly string s_symbolTypeFullName = typeof(ISymbol).FullName;
MetaAnalyzers\RegisterActionAnalyzer.cs (1)
313ISymbol? symbol = semanticModel.GetSymbolInfo(invocation, context.CancellationToken).Symbol;
MetaAnalyzers\ReportDiagnosticAnalyzer.cs (3)
183ISymbol? symbol = semanticModel.GetSymbolInfo(identifier, cancellationToken).Symbol; 199ISymbol? symbol = semanticModel.GetSymbolInfo(syntaxNode, symbolContext.CancellationToken).Symbol; 215ISymbol? argSymbol = semanticModel.GetSymbolInfo(argument, symbolContext.CancellationToken).Symbol;
MetaAnalyzers\SymbolIsBannedInAnalyzersAnalyzer.cs (1)
73var symbol = symbolAnalysisContext.Symbol;
src\RoslynAnalyzers\Microsoft.CodeAnalysis.BannedApiAnalyzers\Core\DocumentationCommentIdParser.cs (2)
8/// Stripped down port of the code in roslyn. Responsible only for determining the <see cref="ISymbol.Name"/> and 9/// name of the <see cref="ISymbol.ContainingSymbol"/> for a given xml doc comment symbol id.
src\RoslynAnalyzers\Microsoft.CodeAnalysis.BannedApiAnalyzers\Core\SymbolIsBannedAnalyzerBase.cs (16)
164bool IsBannedSymbol([NotNullWhen(true)] ISymbol? symbol, [NotNullWhen(true)] out BanFileEntry? entry) 171foreach (var bannedSymbol in bannedFileEntry.Symbols) 211bool ContainsAttributeSymbol(ISymbol symbol) 295static IEnumerable<INamespaceSymbol> GetContainingNamespaces(ISymbol symbol) 344void VerifySymbol(Action<Diagnostic> reportDiagnostic, ISymbol symbol, SyntaxNode syntaxNode) 346foreach (var currentSymbol in GetSymbolAndOverridenSymbols(symbol)) 359static IEnumerable<ISymbol> GetSymbolAndOverridenSymbols(ISymbol symbol) 361ISymbol? currentSymbol = symbol.OriginalDefinition; 378var symbol = context.SemanticModel.GetSymbolInfo(syntaxNode, context.CancellationToken).Symbol; 394var symbol = context.SemanticModel.GetSymbolInfo(typeSyntaxNode, context.CancellationToken).Symbol; 412private readonly Lazy<ImmutableArray<ISymbol>> _lazySymbols; 413public ImmutableArray<ISymbol> Symbols => _lazySymbols.Value; 440_lazySymbols = new Lazy<ImmutableArray<ISymbol>>( 444static IEnumerable<ISymbol> ExpandConstituentNamespaces(ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (8)
28ISymbol symbol, 65public ISymbol Symbol { get; } 228public static Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, Compilation compilation, CancellationToken cancellationToken) 246public static Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, CodeMetricsAnalysisContext context) 265static async Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, CodeMetricsAnalysisContext context) 291public static CodeAnalysisMetricData ComputeSynchronously(ISymbol symbol, CodeMetricsAnalysisContext context) 325internal static async Task<ImmutableArray<CodeAnalysisMetricData>> ComputeAsync(IEnumerable<ISymbol> children, CodeMetricsAnalysisContext context) 333internal static ImmutableArray<CodeAnalysisMetricData> ComputeSynchronously(IEnumerable<ISymbol> children, CodeMetricsAnalysisContext context)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
51private static IEnumerable<ISymbol> GetMembers(INamedTypeSymbol namedType, CodeMetricsAnalysisContext context)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\ComputationalComplexityMetrics.cs (8)
28ImmutableHashSet<BinaryOperatorKind>.Empty, ImmutableHashSet<UnaryOperatorKind>.Empty, ImmutableHashSet<CaseKind>.Empty, ImmutableHashSet<ISymbol>.Empty, ImmutableHashSet<object>.Empty); 36private readonly ImmutableHashSet<ISymbol> _distinctReferencedSymbols; 49ImmutableHashSet<ISymbol> distinctReferencedSymbols, 75ImmutableHashSet<ISymbol> distinctReferencedSymbols, 101ImmutableHashSet<ISymbol>.Builder? distinctReferencedSymbolsBuilder = null; 296distinctReferencedSymbolsBuilder != null ? distinctReferencedSymbolsBuilder.ToImmutable() : ImmutableHashSet<ISymbol>.Empty, 341void countOperand(ISymbol? symbol) 347distinctReferencedSymbolsBuilder ??= ImmutableHashSet.CreateBuilder<ISymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (6)
65internal static long GetLinesOfCode(ImmutableArray<SyntaxReference> declarations, ISymbol symbol, CodeMetricsAnalysisContext context) 179internal static SyntaxNode GetTopmostSyntaxNodeForDeclaration(SyntaxReference declaration, ISymbol declaredSymbol, CodeMetricsAnalysisContext context) 196ISymbol symbol, 249var declaredSymbol = model.GetDeclaredSymbol(node, context.CancellationToken); 402internal static void RemoveContainingTypes(ISymbol symbol, ImmutableHashSet<INamedTypeSymbol>.Builder coupledTypesBuilder) 412internal static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol member)
src\RoslynAnalyzers\Utilities\Compiler\DiagnosticHelpers.cs (1)
65public static string GetMemberName(ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (2)
79this ISymbol symbol, 87this ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (5)
135/// "qualifying member" (<see cref="IsQualifyingMember(ISymbol)"/>) and no 136/// "disqualifying members" (<see cref="IsDisqualifyingMember(ISymbol)"/>). 165foreach (var member in symbol.GetMembers()) 195private static bool IsQualifyingMember(ISymbol member) 243private static bool IsDisqualifyingMember(ISymbol member)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (6)
503public static PooledHashSet<ISymbol> GetCaptures(this IOperation operation, IMethodSymbol lambdaOrLocalFunction) 510var builder = PooledHashSet<ISymbol>.GetInstance(); 543void ProcessLocalOrParameter(ISymbol symbol) 656public static ISymbol? GetReferencedMemberOrLocalOrParameter(this IOperation? operation) 912public static ValueUsageInfo GetValueUsageInfo(this IOperation operation, ISymbol containingSymbol) 1117public static RefKind GetRefKind(this IReturnOperation operation, ISymbol containingSymbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (59)
20public static bool IsType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 25public static bool IsAccessorMethod([NotNullWhen(returnValue: true)] this ISymbol? symbol) 31public static IEnumerable<IMethodSymbol> GetAccessors(this ISymbol symbol) 70public static bool IsDefaultConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 75public static bool IsPublic(this ISymbol symbol) 80public static bool IsProtected(this ISymbol symbol) 85public static bool IsPrivate(this ISymbol symbol) 90public static bool IsErrorType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 97public static bool IsConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 102public static bool IsDestructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 107public static bool IsIndexer([NotNullWhen(returnValue: true)] this ISymbol? symbol) 112public static bool IsPropertyWithBackingField([NotNullWhen(returnValue: true)] this ISymbol? symbol, [NotNullWhen(true)] out IFieldSymbol? backingField) 116foreach (ISymbol member in propertySymbol.ContainingType.GetMembers()) 139[NotNullWhen(returnValue: true)] this ISymbol? symbol, 156public static bool IsUserDefinedOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 161public static bool IsConversionOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 166public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol? symbol) 179public static bool IsExternallyVisible(this ISymbol symbol) => 182public static SymbolVisibility GetResultantVisibility(this ISymbol symbol) 229public static bool MatchMemberDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 239public static bool MatchMethodByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 244public static bool MatchPropertyDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 249public static bool MatchMemberByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 254public static bool MatchPropertyByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 259public static bool MatchFieldByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 283public static string FormatMemberName(this ISymbol member) 419public static bool IsFromMscorlib(this ISymbol symbol, Compilation compilation) 460public static bool IsImplementationOfAnyInterfaceMember(this ISymbol symbol) 465public static bool IsImplementationOfAnyImplicitInterfaceMember(this ISymbol symbol) 467return IsImplementationOfAnyImplicitInterfaceMember<ISymbol>(symbol); 473public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol) 474where TSymbol : ISymbol 496public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol, out TSymbol interfaceMember) 497where TSymbol : ISymbol 518public static bool IsImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 527public static bool IsOverrideOrImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 546/// <remarks>Requires that <see cref="ISymbol.IsOverride"/> is true for the given <paramref name="symbol"/>.</remarks> 547public static ISymbol GetOverriddenMember(this ISymbol symbol) 566public static bool IsImplementationOfAnyExplicitInterfaceMember([NotNullWhen(returnValue: true)] this ISymbol? symbol) 586public static ITypeSymbol? GetMemberOrLocalOrParameterType(this ISymbol symbol) 598public static ITypeSymbol? GetMemberType(this ISymbol? symbol) 614public static bool IsReadOnlyFieldOrProperty([NotNullWhen(returnValue: true)] this ISymbol? symbol) 626public static AttributeData? GetAttribute(this ISymbol symbol, [NotNullWhen(true)] INamedTypeSymbol? attributeType) 631public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, IEnumerable<INamedTypeSymbol?> attributesToMatch) 649public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 655public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1) 666public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1, INamedTypeSymbol? attributeTypeToMatch2) 679public static bool HasAnyAttribute(this ISymbol symbol, IEnumerable<INamedTypeSymbol> attributesToMatch) 684public static bool HasAnyAttribute(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 707public static bool HasAnyAttribute(this ISymbol symbol, [NotNullWhen(returnValue: true)] INamedTypeSymbol? attribute) 806public static bool[] HasAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributes) 826public static bool IsInSource(this ISymbol symbol) 831public static bool IsLambdaOrLocalFunction([NotNullWhen(returnValue: true)] this ISymbol? symbol) 839public static bool IsSymbolWithSpecialDiscardName([NotNullWhen(returnValue: true)] this ISymbol? symbol) 843public static bool IsConst([NotNullWhen(returnValue: true)] this ISymbol? symbol) 855public static bool IsReadOnly([NotNullWhen(returnValue: true)] this ISymbol? symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\UriExtensions.cs (2)
32public static bool SymbolNameContainsUriWordSubstring(this ISymbol symbol, CancellationToken cancellationToken) 58public static bool SymbolNameContainsUriWords(this ISymbol symbol, CancellationToken cancellationToken)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
55where TSymbol : ISymbol 99where TSymbol : ISymbol
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (18)
29private static bool TryGetSyntaxTreeForOption(ISymbol symbol, [NotNullWhen(returnValue: true)] out SyntaxTree? tree) 48ISymbol symbol, 66ISymbol symbol, 84ISymbol symbol, 117ISymbol symbol, 189ISymbol symbol, 254ISymbol symbol, 261ISymbol symbol, 262ISymbol containingContextSymbol, 298ISymbol symbol, 307ISymbol symbol, 317ISymbol symbol, 331ISymbol symbol, 380ISymbol symbol, 578ISymbol symbol, 593ISymbol symbol, 594ISymbol containingContextSymbol, 612ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolModifiers.cs (1)
38public static SymbolModifiers GetSymbolModifiers(this ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (15)
31private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 58private readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> _wildcardMatchResult = new(); 60private readonly ConcurrentDictionary<ISymbol, string> _symbolToDeclarationId = new(); 62private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 75_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 90var symbolsBuilder = PooledDictionary<ISymbol, TValue>.GetInstance(); 189static void ProcessSymbolName(NameParts parts, Compilation compilation, string? optionalPrefix, PooledDictionary<ISymbol, TValue> symbolsBuilder) 201foreach (var symbol in DocumentationCommentId.GetSymbolsForDeclarationId(nameWithPrefix, compilation)) 230public bool Contains(ISymbol symbol) 236public bool TryGetValue(ISymbol symbol, [MaybeNullWhen(false)] out TValue value) 266private bool TryGetFirstWildcardMatch(ISymbol symbol, [NotNullWhen(true)] out string? firstMatchName, [MaybeNullWhen(false)] out TValue firstMatchValue) 344static string GetDeclarationId(ISymbol symbol) 374internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 378internal ref readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> WildcardMatchResult => ref _symbolNamesWithValueOption._wildcardMatchResult; 380internal ref readonly ConcurrentDictionary<ISymbol, string> SymbolToDeclarationId => ref _symbolNamesWithValueOption._symbolToDeclarationId;
src\RoslynAnalyzers\Utilities\Compiler\SymbolDisplayStringCache.cs (2)
29private readonly ConcurrentDictionary<ISymbol, string> SymbolToDisplayNames = new(); 65public string GetDisplayString(ISymbol symbol)
Microsoft.CodeAnalysis.Analyzers.UnitTests (17)
MetaAnalyzers\CompareSymbolsCorrectlyTests.cs (15)
204[InlineData(nameof(ISymbol))] 232[InlineData(nameof(ISymbol))] 257[InlineData(nameof(ISymbol))] 299[InlineData(nameof(ISymbol))] 328[InlineData(nameof(ISymbol))] 359[CombinatorialValues(nameof(ISymbol), nameof(INamedTypeSymbol))] string symbolType, 380[InlineData(nameof(ISymbol))] 397[InlineData(nameof(ISymbol))] 426[InlineData(nameof(ISymbol))] 452[InlineData(nameof(ISymbol))] 472[CombinatorialValues("Symbol", nameof(ISymbol), nameof(INamedTypeSymbol))] string symbolType, 497[CombinatorialValues(nameof(ISymbol), nameof(INamedTypeSymbol))] string symbolType, 519[CombinatorialValues(nameof(ISymbol), nameof(INamedTypeSymbol))] string symbolType, 550[CombinatorialValues(nameof(ISymbol), nameof(INamedTypeSymbol))] string symbolType, 805[InlineData(nameof(ISymbol))]
MetaAnalyzers\DoNotStorePerCompilationDataOntoFieldsRuleTests.cs (2)
71GetCSharpExpectedDiagnostic(24, 29, violatingTypeName: typeof(ISymbol).FullName), 124GetBasicExpectedDiagnostic(24, 35, violatingTypeName: typeof(ISymbol).FullName),
Microsoft.CodeAnalysis.AnalyzerUtilities (227)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (8)
28ISymbol symbol, 65public ISymbol Symbol { get; } 228public static Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, Compilation compilation, CancellationToken cancellationToken) 246public static Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, CodeMetricsAnalysisContext context) 265static async Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, CodeMetricsAnalysisContext context) 291public static CodeAnalysisMetricData ComputeSynchronously(ISymbol symbol, CodeMetricsAnalysisContext context) 325internal static async Task<ImmutableArray<CodeAnalysisMetricData>> ComputeAsync(IEnumerable<ISymbol> children, CodeMetricsAnalysisContext context) 333internal static ImmutableArray<CodeAnalysisMetricData> ComputeSynchronously(IEnumerable<ISymbol> children, CodeMetricsAnalysisContext context)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
51private static IEnumerable<ISymbol> GetMembers(INamedTypeSymbol namedType, CodeMetricsAnalysisContext context)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\ComputationalComplexityMetrics.cs (8)
28ImmutableHashSet<BinaryOperatorKind>.Empty, ImmutableHashSet<UnaryOperatorKind>.Empty, ImmutableHashSet<CaseKind>.Empty, ImmutableHashSet<ISymbol>.Empty, ImmutableHashSet<object>.Empty); 36private readonly ImmutableHashSet<ISymbol> _distinctReferencedSymbols; 49ImmutableHashSet<ISymbol> distinctReferencedSymbols, 75ImmutableHashSet<ISymbol> distinctReferencedSymbols, 101ImmutableHashSet<ISymbol>.Builder? distinctReferencedSymbolsBuilder = null; 296distinctReferencedSymbolsBuilder != null ? distinctReferencedSymbolsBuilder.ToImmutable() : ImmutableHashSet<ISymbol>.Empty, 341void countOperand(ISymbol? symbol) 347distinctReferencedSymbolsBuilder ??= ImmutableHashSet.CreateBuilder<ISymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (6)
65internal static long GetLinesOfCode(ImmutableArray<SyntaxReference> declarations, ISymbol symbol, CodeMetricsAnalysisContext context) 179internal static SyntaxNode GetTopmostSyntaxNodeForDeclaration(SyntaxReference declaration, ISymbol declaredSymbol, CodeMetricsAnalysisContext context) 196ISymbol symbol, 249var declaredSymbol = model.GetDeclaredSymbol(node, context.CancellationToken); 402internal static void RemoveContainingTypes(ISymbol symbol, ImmutableHashSet<INamedTypeSymbol>.Builder coupledTypesBuilder) 412internal static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol member)
src\RoslynAnalyzers\Utilities\Compiler\DiagnosticHelpers.cs (1)
65public static string GetMemberName(ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (2)
79this ISymbol symbol, 87this ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (5)
135/// "qualifying member" (<see cref="IsQualifyingMember(ISymbol)"/>) and no 136/// "disqualifying members" (<see cref="IsDisqualifyingMember(ISymbol)"/>). 165foreach (var member in symbol.GetMembers()) 195private static bool IsQualifyingMember(ISymbol member) 243private static bool IsDisqualifyingMember(ISymbol member)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (6)
503public static PooledHashSet<ISymbol> GetCaptures(this IOperation operation, IMethodSymbol lambdaOrLocalFunction) 510var builder = PooledHashSet<ISymbol>.GetInstance(); 543void ProcessLocalOrParameter(ISymbol symbol) 656public static ISymbol? GetReferencedMemberOrLocalOrParameter(this IOperation? operation) 912public static ValueUsageInfo GetValueUsageInfo(this IOperation operation, ISymbol containingSymbol) 1117public static RefKind GetRefKind(this IReturnOperation operation, ISymbol containingSymbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (59)
20public static bool IsType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 25public static bool IsAccessorMethod([NotNullWhen(returnValue: true)] this ISymbol? symbol) 31public static IEnumerable<IMethodSymbol> GetAccessors(this ISymbol symbol) 70public static bool IsDefaultConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 75public static bool IsPublic(this ISymbol symbol) 80public static bool IsProtected(this ISymbol symbol) 85public static bool IsPrivate(this ISymbol symbol) 90public static bool IsErrorType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 97public static bool IsConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 102public static bool IsDestructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 107public static bool IsIndexer([NotNullWhen(returnValue: true)] this ISymbol? symbol) 112public static bool IsPropertyWithBackingField([NotNullWhen(returnValue: true)] this ISymbol? symbol, [NotNullWhen(true)] out IFieldSymbol? backingField) 116foreach (ISymbol member in propertySymbol.ContainingType.GetMembers()) 139[NotNullWhen(returnValue: true)] this ISymbol? symbol, 156public static bool IsUserDefinedOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 161public static bool IsConversionOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 166public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol? symbol) 179public static bool IsExternallyVisible(this ISymbol symbol) => 182public static SymbolVisibility GetResultantVisibility(this ISymbol symbol) 229public static bool MatchMemberDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 239public static bool MatchMethodByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 244public static bool MatchPropertyDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 249public static bool MatchMemberByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 254public static bool MatchPropertyByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 259public static bool MatchFieldByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 283public static string FormatMemberName(this ISymbol member) 419public static bool IsFromMscorlib(this ISymbol symbol, Compilation compilation) 460public static bool IsImplementationOfAnyInterfaceMember(this ISymbol symbol) 465public static bool IsImplementationOfAnyImplicitInterfaceMember(this ISymbol symbol) 467return IsImplementationOfAnyImplicitInterfaceMember<ISymbol>(symbol); 473public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol) 474where TSymbol : ISymbol 496public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol, out TSymbol interfaceMember) 497where TSymbol : ISymbol 518public static bool IsImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 527public static bool IsOverrideOrImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 546/// <remarks>Requires that <see cref="ISymbol.IsOverride"/> is true for the given <paramref name="symbol"/>.</remarks> 547public static ISymbol GetOverriddenMember(this ISymbol symbol) 566public static bool IsImplementationOfAnyExplicitInterfaceMember([NotNullWhen(returnValue: true)] this ISymbol? symbol) 586public static ITypeSymbol? GetMemberOrLocalOrParameterType(this ISymbol symbol) 598public static ITypeSymbol? GetMemberType(this ISymbol? symbol) 614public static bool IsReadOnlyFieldOrProperty([NotNullWhen(returnValue: true)] this ISymbol? symbol) 626public static AttributeData? GetAttribute(this ISymbol symbol, [NotNullWhen(true)] INamedTypeSymbol? attributeType) 631public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, IEnumerable<INamedTypeSymbol?> attributesToMatch) 649public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 655public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1) 666public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1, INamedTypeSymbol? attributeTypeToMatch2) 679public static bool HasAnyAttribute(this ISymbol symbol, IEnumerable<INamedTypeSymbol> attributesToMatch) 684public static bool HasAnyAttribute(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 707public static bool HasAnyAttribute(this ISymbol symbol, [NotNullWhen(returnValue: true)] INamedTypeSymbol? attribute) 806public static bool[] HasAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributes) 826public static bool IsInSource(this ISymbol symbol) 831public static bool IsLambdaOrLocalFunction([NotNullWhen(returnValue: true)] this ISymbol? symbol) 839public static bool IsSymbolWithSpecialDiscardName([NotNullWhen(returnValue: true)] this ISymbol? symbol) 843public static bool IsConst([NotNullWhen(returnValue: true)] this ISymbol? symbol) 855public static bool IsReadOnly([NotNullWhen(returnValue: true)] this ISymbol? symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\UriExtensions.cs (2)
32public static bool SymbolNameContainsUriWordSubstring(this ISymbol symbol, CancellationToken cancellationToken) 58public static bool SymbolNameContainsUriWords(this ISymbol symbol, CancellationToken cancellationToken)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
55where TSymbol : ISymbol 99where TSymbol : ISymbol
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (18)
29private static bool TryGetSyntaxTreeForOption(ISymbol symbol, [NotNullWhen(returnValue: true)] out SyntaxTree? tree) 48ISymbol symbol, 66ISymbol symbol, 84ISymbol symbol, 117ISymbol symbol, 189ISymbol symbol, 254ISymbol symbol, 261ISymbol symbol, 262ISymbol containingContextSymbol, 298ISymbol symbol, 307ISymbol symbol, 317ISymbol symbol, 331ISymbol symbol, 380ISymbol symbol, 578ISymbol symbol, 593ISymbol symbol, 594ISymbol containingContextSymbol, 612ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolModifiers.cs (1)
38public static SymbolModifiers GetSymbolModifiers(this ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (15)
31private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 58private readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> _wildcardMatchResult = new(); 60private readonly ConcurrentDictionary<ISymbol, string> _symbolToDeclarationId = new(); 62private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 75_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 90var symbolsBuilder = PooledDictionary<ISymbol, TValue>.GetInstance(); 189static void ProcessSymbolName(NameParts parts, Compilation compilation, string? optionalPrefix, PooledDictionary<ISymbol, TValue> symbolsBuilder) 201foreach (var symbol in DocumentationCommentId.GetSymbolsForDeclarationId(nameWithPrefix, compilation)) 230public bool Contains(ISymbol symbol) 236public bool TryGetValue(ISymbol symbol, [MaybeNullWhen(false)] out TValue value) 266private bool TryGetFirstWildcardMatch(ISymbol symbol, [NotNullWhen(true)] out string? firstMatchName, [MaybeNullWhen(false)] out TValue firstMatchValue) 344static string GetDeclarationId(ISymbol symbol) 374internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 378internal ref readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> WildcardMatchResult => ref _symbolNamesWithValueOption._wildcardMatchResult; 380internal ref readonly ConcurrentDictionary<ISymbol, string> SymbolToDeclarationId => ref _symbolNamesWithValueOption._symbolToDeclarationId;
src\RoslynAnalyzers\Utilities\Compiler\SymbolDisplayStringCache.cs (2)
29private readonly ConcurrentDictionary<ISymbol, string> SymbolToDisplayNames = new(); 65public string GetDisplayString(ISymbol symbol)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysis.cs (1)
30ISymbol owningSymbol,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysisContext.cs (2)
26ISymbol owningSymbol, 46ISymbol owningSymbol,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysis.cs (2)
38ISymbol owningSymbol, 84ISymbol owningSymbol,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysisContext.cs (2)
30ISymbol owningSymbol, 68ISymbol owningSymbol,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\GlobalFlowStateAnalysis\GlobalFlowStateAnalysis.cs (2)
59ISymbol owningSymbol, 89ISymbol owningSymbol,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\GlobalFlowStateAnalysis\GlobalFlowStateAnalysisContext.cs (2)
29ISymbol owningSymbol, 57ISymbol owningSymbol,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\GlobalFlowStateAnalysis\GlobalFlowStateDataFlowOperationVisitor.cs (1)
50ISymbol owningSymbol;
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ParameterValidationAnalysis\ParameterValidationAnalysis.cs (3)
33ISymbol owningSymbol, 61ISymbol owningSymbol, 87ISymbol owningSymbol,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ParameterValidationAnalysis\ParameterValidationAnalysis.ParameterValidationDataFlowOperationVisitor.cs (1)
69ISymbol GetBottomOfStackOwningSymbol()
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ParameterValidationAnalysis\ParameterValidationAnalysisContext.cs (2)
29ISymbol owningSymbol, 53ISymbol owningSymbol,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysis.cs (2)
32ISymbol owningSymbol, 49ISymbol owningSymbol,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysis.PointsToDataFlowOperationVisitor.cs (1)
1014private static bool IsSpecialEmptyMember(ISymbol symbol)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysisContext.cs (2)
27ISymbol owningSymbol, 53ISymbol owningSymbol,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysis.cs (5)
52ISymbol owningSymbol, 154IEnumerable<(IOperation Operation, ISymbol ContainingSymbol)> rootOperationsNeedingAnalysis, 190IEnumerable<(IOperation Operation, ISymbol ContainingSymbol)> rootOperationsNeedingAnalysis, 200foreach ((IOperation Operation, ISymbol ContainingSymbol) in rootOperationsNeedingAnalysis) 245PropertySetAnalysisResult? InvokeDfaAndAccumulateResults(ControlFlowGraph cfg, ISymbol owningSymbol)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysisContext.cs (2)
32ISymbol owningSymbol, 75ISymbol owningSymbol,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\SymbolAccess.cs (6)
17public SymbolAccess(ISymbol symbol, SyntaxNode syntaxNode, ISymbol accessingMethod) 29public SymbolAccess(ISymbol symbol, Location location, ISymbol accessingMethod) 39public ISymbol Symbol { get; } 49public ISymbol AccessingMethod { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataAbstractValue.cs (2)
58internal static TaintedDataAbstractValue CreateTainted(ISymbol taintedSymbol, SyntaxNode accessingSyntax, ISymbol accessingMethod)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataAnalysis.cs (2)
31ISymbol containingMethod, 47ISymbol containingMethod,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataAnalysis.TaintedDataOperationVisitor.cs (1)
530ISymbol sinkSymbol,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataAnalysisContext.cs (2)
27ISymbol owningSymbol, 69ISymbol owningSymbol,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataSymbolMapExtensions.cs (1)
135ISymbol containingSymbol = parameterSymbol.ContainingSymbol;
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ValueContentAnalysis\ValueContentAnalysis.cs (3)
31ISymbol owningSymbol, 45ISymbol owningSymbol, 80ISymbol owningSymbol,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ValueContentAnalysis\ValueContentAnalysisContext.cs (2)
28ISymbol owningSymbol, 56ISymbol owningSymbol,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AbstractDataFlowAnalysisContext.cs (2)
32ISymbol owningSymbol, 79public ISymbol OwningSymbol { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AbstractLocation.cs (5)
24/// 3. Location created for certain symbols which do not have a declaration in executable code, i.e. no <see cref="IOperation"/> for declaration (such as parameter symbols, member symbols, etc. - <see cref="CreateSymbolLocation(ISymbol, ImmutableStack{IOperation})"/>/>). 35private AbstractLocation(IOperation? creation, ImmutableStack<IOperation>? creationCallStack, AnalysisEntity? analysisEntity, ISymbol? symbol, InterproceduralCaptureId? captureId, ITypeSymbol? locationType, bool isSpecialSingleton) 48private static AbstractLocation Create(IOperation? creation, ImmutableStack<IOperation>? creationCallStack, AnalysisEntity? analysisEntity, ISymbol? symbol, InterproceduralCaptureId? captureId, ITypeSymbol? locationType) 64public static AbstractLocation CreateSymbolLocation(ISymbol symbol, ImmutableStack<IOperation>? creationCallStack) 87public ISymbol? Symbol { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntity.cs (5)
21/// 1. An <see cref="ISymbol"/>. 39ISymbol? symbol, 69private AnalysisEntity(ISymbol? symbol, ImmutableArray<AbstractIndex> indices, PointsToAbstractValue location, ITypeSymbol type, AnalysisEntity? parent, AnalysisEntity? entityForInstanceLocation) 94public static AnalysisEntity Create(ISymbol? symbol, ImmutableArray<AbstractIndex> indices, 196public ISymbol? Symbol { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityFactory.cs (11)
33private readonly Dictionary<ISymbol, PointsToAbstractValue> _instanceLocationsForSymbols; 40private readonly Func<ISymbol, ImmutableStack<IOperation>?> _getInterproceduralCallStackForOwningSymbol; 52ImmutableDictionary<ISymbol, PointsToAbstractValue>? interproceduralCapturedVariablesMap, 54Func<ISymbol, ImmutableStack<IOperation>?> getInterproceduralCallStackForOwningSymbol) 71_instanceLocationsForSymbols = new Dictionary<ISymbol, PointsToAbstractValue>(); 132ISymbol? symbol = null; 270private static void GetSymbolAndIndicesForMemberReference(IMemberReferenceOperation memberReference, ref ISymbol? symbol, ref ImmutableArray<AbstractIndex> indices) 310public bool TryCreateForSymbolDeclaration(ISymbol symbol, [NotNullWhen(returnValue: true)] out AnalysisEntity? analysisEntity) 438private bool TryCreate(ISymbol? symbol, ImmutableArray<AbstractIndex> indices, 514private PointsToAbstractValue? EnsureLocation(PointsToAbstractValue? instanceLocation, ISymbol? symbol, AnalysisEntity? parent) 553private AnalysisEntity Create(ISymbol? symbol, ImmutableArray<AbstractIndex> indices, ITypeSymbol type, PointsToAbstractValue? instanceLocation, AnalysisEntity? parent, AnalysisEntity? entityForInstanceLocation)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (8)
163protected ISymbol OwningSymbol => DataFlowAnalysisContext.OwningSymbol; 401var owningSymbol = analysisContext.OwningSymbol; 2592private ImmutableDictionary<ISymbol, PointsToAbstractValue> GetCapturedVariablesMap( 2601return ImmutableDictionary<ISymbol, PointsToAbstractValue>.Empty; 2607return ImmutableDictionary<ISymbol, PointsToAbstractValue>.Empty; 2611var builder = ImmutableDictionary.CreateBuilder<ISymbol, PointsToAbstractValue>(); 2612foreach (var capturedVariable in capturedVariables) 3564private ImmutableStack<IOperation>? GetInterproceduralCallStackForOwningSymbol(ISymbol forOwningSymbol)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\IDataFlowAnalysisContext.cs (1)
14ISymbol OwningSymbol { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\InterproceduralAnalysisData.cs (4)
34ImmutableDictionary<ISymbol, PointsToAbstractValue> capturedVariablesMap, 41Func<ISymbol, ImmutableStack<IOperation>?> getInterproceduralCallStackForOwningSymbol) 61public ImmutableDictionary<ISymbol, PointsToAbstractValue> CapturedVariablesMap { get; } 68public Func<ISymbol, ImmutableStack<IOperation>?> GetInterproceduralCallStackForOwningSymbol { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\Options\AnalyzerOptionsExtensions_FlowAnalysis.cs (6)
17ISymbol symbol, 35ISymbol symbol, 53ISymbol symbol, 71ISymbol symbol, 89ISymbol symbol, 107ISymbol symbol,
Microsoft.CodeAnalysis.BannedApiAnalyzers (157)
DocumentationCommentIdParser.cs (2)
8/// Stripped down port of the code in roslyn. Responsible only for determining the <see cref="ISymbol.Name"/> and 9/// name of the <see cref="ISymbol.ContainingSymbol"/> for a given xml doc comment symbol id.
RestrictedInternalsVisibleToAnalyzer.cs (3)
88var symbol = context.Operation switch 186ISymbol? symbol, 204ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (8)
28ISymbol symbol, 65public ISymbol Symbol { get; } 228public static Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, Compilation compilation, CancellationToken cancellationToken) 246public static Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, CodeMetricsAnalysisContext context) 265static async Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, CodeMetricsAnalysisContext context) 291public static CodeAnalysisMetricData ComputeSynchronously(ISymbol symbol, CodeMetricsAnalysisContext context) 325internal static async Task<ImmutableArray<CodeAnalysisMetricData>> ComputeAsync(IEnumerable<ISymbol> children, CodeMetricsAnalysisContext context) 333internal static ImmutableArray<CodeAnalysisMetricData> ComputeSynchronously(IEnumerable<ISymbol> children, CodeMetricsAnalysisContext context)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
51private static IEnumerable<ISymbol> GetMembers(INamedTypeSymbol namedType, CodeMetricsAnalysisContext context)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\ComputationalComplexityMetrics.cs (8)
28ImmutableHashSet<BinaryOperatorKind>.Empty, ImmutableHashSet<UnaryOperatorKind>.Empty, ImmutableHashSet<CaseKind>.Empty, ImmutableHashSet<ISymbol>.Empty, ImmutableHashSet<object>.Empty); 36private readonly ImmutableHashSet<ISymbol> _distinctReferencedSymbols; 49ImmutableHashSet<ISymbol> distinctReferencedSymbols, 75ImmutableHashSet<ISymbol> distinctReferencedSymbols, 101ImmutableHashSet<ISymbol>.Builder? distinctReferencedSymbolsBuilder = null; 296distinctReferencedSymbolsBuilder != null ? distinctReferencedSymbolsBuilder.ToImmutable() : ImmutableHashSet<ISymbol>.Empty, 341void countOperand(ISymbol? symbol) 347distinctReferencedSymbolsBuilder ??= ImmutableHashSet.CreateBuilder<ISymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (6)
65internal static long GetLinesOfCode(ImmutableArray<SyntaxReference> declarations, ISymbol symbol, CodeMetricsAnalysisContext context) 179internal static SyntaxNode GetTopmostSyntaxNodeForDeclaration(SyntaxReference declaration, ISymbol declaredSymbol, CodeMetricsAnalysisContext context) 196ISymbol symbol, 249var declaredSymbol = model.GetDeclaredSymbol(node, context.CancellationToken); 402internal static void RemoveContainingTypes(ISymbol symbol, ImmutableHashSet<INamedTypeSymbol>.Builder coupledTypesBuilder) 412internal static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol member)
src\RoslynAnalyzers\Utilities\Compiler\DiagnosticHelpers.cs (1)
65public static string GetMemberName(ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (2)
79this ISymbol symbol, 87this ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (5)
135/// "qualifying member" (<see cref="IsQualifyingMember(ISymbol)"/>) and no 136/// "disqualifying members" (<see cref="IsDisqualifyingMember(ISymbol)"/>). 165foreach (var member in symbol.GetMembers()) 195private static bool IsQualifyingMember(ISymbol member) 243private static bool IsDisqualifyingMember(ISymbol member)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (6)
503public static PooledHashSet<ISymbol> GetCaptures(this IOperation operation, IMethodSymbol lambdaOrLocalFunction) 510var builder = PooledHashSet<ISymbol>.GetInstance(); 543void ProcessLocalOrParameter(ISymbol symbol) 656public static ISymbol? GetReferencedMemberOrLocalOrParameter(this IOperation? operation) 912public static ValueUsageInfo GetValueUsageInfo(this IOperation operation, ISymbol containingSymbol) 1117public static RefKind GetRefKind(this IReturnOperation operation, ISymbol containingSymbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (59)
20public static bool IsType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 25public static bool IsAccessorMethod([NotNullWhen(returnValue: true)] this ISymbol? symbol) 31public static IEnumerable<IMethodSymbol> GetAccessors(this ISymbol symbol) 70public static bool IsDefaultConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 75public static bool IsPublic(this ISymbol symbol) 80public static bool IsProtected(this ISymbol symbol) 85public static bool IsPrivate(this ISymbol symbol) 90public static bool IsErrorType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 97public static bool IsConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 102public static bool IsDestructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 107public static bool IsIndexer([NotNullWhen(returnValue: true)] this ISymbol? symbol) 112public static bool IsPropertyWithBackingField([NotNullWhen(returnValue: true)] this ISymbol? symbol, [NotNullWhen(true)] out IFieldSymbol? backingField) 116foreach (ISymbol member in propertySymbol.ContainingType.GetMembers()) 139[NotNullWhen(returnValue: true)] this ISymbol? symbol, 156public static bool IsUserDefinedOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 161public static bool IsConversionOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 166public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol? symbol) 179public static bool IsExternallyVisible(this ISymbol symbol) => 182public static SymbolVisibility GetResultantVisibility(this ISymbol symbol) 229public static bool MatchMemberDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 239public static bool MatchMethodByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 244public static bool MatchPropertyDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 249public static bool MatchMemberByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 254public static bool MatchPropertyByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 259public static bool MatchFieldByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 283public static string FormatMemberName(this ISymbol member) 419public static bool IsFromMscorlib(this ISymbol symbol, Compilation compilation) 460public static bool IsImplementationOfAnyInterfaceMember(this ISymbol symbol) 465public static bool IsImplementationOfAnyImplicitInterfaceMember(this ISymbol symbol) 467return IsImplementationOfAnyImplicitInterfaceMember<ISymbol>(symbol); 473public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol) 474where TSymbol : ISymbol 496public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol, out TSymbol interfaceMember) 497where TSymbol : ISymbol 518public static bool IsImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 527public static bool IsOverrideOrImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 546/// <remarks>Requires that <see cref="ISymbol.IsOverride"/> is true for the given <paramref name="symbol"/>.</remarks> 547public static ISymbol GetOverriddenMember(this ISymbol symbol) 566public static bool IsImplementationOfAnyExplicitInterfaceMember([NotNullWhen(returnValue: true)] this ISymbol? symbol) 586public static ITypeSymbol? GetMemberOrLocalOrParameterType(this ISymbol symbol) 598public static ITypeSymbol? GetMemberType(this ISymbol? symbol) 614public static bool IsReadOnlyFieldOrProperty([NotNullWhen(returnValue: true)] this ISymbol? symbol) 626public static AttributeData? GetAttribute(this ISymbol symbol, [NotNullWhen(true)] INamedTypeSymbol? attributeType) 631public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, IEnumerable<INamedTypeSymbol?> attributesToMatch) 649public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 655public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1) 666public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1, INamedTypeSymbol? attributeTypeToMatch2) 679public static bool HasAnyAttribute(this ISymbol symbol, IEnumerable<INamedTypeSymbol> attributesToMatch) 684public static bool HasAnyAttribute(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 707public static bool HasAnyAttribute(this ISymbol symbol, [NotNullWhen(returnValue: true)] INamedTypeSymbol? attribute) 806public static bool[] HasAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributes) 826public static bool IsInSource(this ISymbol symbol) 831public static bool IsLambdaOrLocalFunction([NotNullWhen(returnValue: true)] this ISymbol? symbol) 839public static bool IsSymbolWithSpecialDiscardName([NotNullWhen(returnValue: true)] this ISymbol? symbol) 843public static bool IsConst([NotNullWhen(returnValue: true)] this ISymbol? symbol) 855public static bool IsReadOnly([NotNullWhen(returnValue: true)] this ISymbol? symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\UriExtensions.cs (2)
32public static bool SymbolNameContainsUriWordSubstring(this ISymbol symbol, CancellationToken cancellationToken) 58public static bool SymbolNameContainsUriWords(this ISymbol symbol, CancellationToken cancellationToken)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
55where TSymbol : ISymbol 99where TSymbol : ISymbol
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (18)
29private static bool TryGetSyntaxTreeForOption(ISymbol symbol, [NotNullWhen(returnValue: true)] out SyntaxTree? tree) 48ISymbol symbol, 66ISymbol symbol, 84ISymbol symbol, 117ISymbol symbol, 189ISymbol symbol, 254ISymbol symbol, 261ISymbol symbol, 262ISymbol containingContextSymbol, 298ISymbol symbol, 307ISymbol symbol, 317ISymbol symbol, 331ISymbol symbol, 380ISymbol symbol, 578ISymbol symbol, 593ISymbol symbol, 594ISymbol containingContextSymbol, 612ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolModifiers.cs (1)
38public static SymbolModifiers GetSymbolModifiers(this ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (15)
31private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 58private readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> _wildcardMatchResult = new(); 60private readonly ConcurrentDictionary<ISymbol, string> _symbolToDeclarationId = new(); 62private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 75_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 90var symbolsBuilder = PooledDictionary<ISymbol, TValue>.GetInstance(); 189static void ProcessSymbolName(NameParts parts, Compilation compilation, string? optionalPrefix, PooledDictionary<ISymbol, TValue> symbolsBuilder) 201foreach (var symbol in DocumentationCommentId.GetSymbolsForDeclarationId(nameWithPrefix, compilation)) 230public bool Contains(ISymbol symbol) 236public bool TryGetValue(ISymbol symbol, [MaybeNullWhen(false)] out TValue value) 266private bool TryGetFirstWildcardMatch(ISymbol symbol, [NotNullWhen(true)] out string? firstMatchName, [MaybeNullWhen(false)] out TValue firstMatchValue) 344static string GetDeclarationId(ISymbol symbol) 374internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 378internal ref readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> WildcardMatchResult => ref _symbolNamesWithValueOption._wildcardMatchResult; 380internal ref readonly ConcurrentDictionary<ISymbol, string> SymbolToDeclarationId => ref _symbolNamesWithValueOption._symbolToDeclarationId;
src\RoslynAnalyzers\Utilities\Compiler\SymbolDisplayStringCache.cs (2)
29private readonly ConcurrentDictionary<ISymbol, string> SymbolToDisplayNames = new(); 65public string GetDisplayString(ISymbol symbol)
SymbolIsBannedAnalyzerBase.cs (16)
164bool IsBannedSymbol([NotNullWhen(true)] ISymbol? symbol, [NotNullWhen(true)] out BanFileEntry? entry) 171foreach (var bannedSymbol in bannedFileEntry.Symbols) 211bool ContainsAttributeSymbol(ISymbol symbol) 295static IEnumerable<INamespaceSymbol> GetContainingNamespaces(ISymbol symbol) 344void VerifySymbol(Action<Diagnostic> reportDiagnostic, ISymbol symbol, SyntaxNode syntaxNode) 346foreach (var currentSymbol in GetSymbolAndOverridenSymbols(symbol)) 359static IEnumerable<ISymbol> GetSymbolAndOverridenSymbols(ISymbol symbol) 361ISymbol? currentSymbol = symbol.OriginalDefinition; 378var symbol = context.SemanticModel.GetSymbolInfo(syntaxNode, context.CancellationToken).Symbol; 394var symbol = context.SemanticModel.GetSymbolInfo(typeSyntaxNode, context.CancellationToken).Symbol; 412private readonly Lazy<ImmutableArray<ISymbol>> _lazySymbols; 413public ImmutableArray<ISymbol> Symbols => _lazySymbols.Value; 440_lazySymbols = new Lazy<ImmutableArray<ISymbol>>( 444static IEnumerable<ISymbol> ExpandConstituentNamespaces(ISymbol symbol)
Microsoft.CodeAnalysis.CodeStyle (553)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (4)
58public (bool accessesBase, ImmutableArray<ISymbol> members, ImmutableArray<IOperation> statements) GetHashedMembers(ISymbol? owningSymbol, IOperation? operation) 89private (bool accessesBase, ImmutableArray<ISymbol> members)? MatchTuplePattern( 112private (bool accessesBase, ImmutableArray<ISymbol> members)? MatchAccumulatorPattern(
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.OperationDeconstructor.cs (6)
28private readonly ArrayBuilder<ISymbol> _hashedSymbols = ArrayBuilder<ISymbol>.GetInstance(); 34public readonly (bool accessesBase, ImmutableArray<ISymbol> hashedSymbol) GetResult() 144if (TryGetFieldOrProperty(value, out var fieldOrProp) && 168private static bool TryGetFieldOrProperty(IOperation operation, [NotNullWhen(true)] out ISymbol? symbol) 188private readonly bool TryAddSymbol(ISymbol member)
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (4)
118foreach (var member in members) 142foreach (var member in namedType.GetMembers()) 237private static bool IsWrittenTo(IOperation? operation, ISymbol owningSymbol) 253private static bool IsFieldWrite(IFieldReferenceOperation fieldReference, ISymbol owningSymbol)
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (2)
71var symbol = context.SemanticModel.GetDeclaredSymbol(namespaceDecl); 179var symbol = semanticModel.GetDeclaredSymbol(typeDecl);
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (3)
40protected abstract bool ShouldIgnore(ISymbol symbol); 85var symbol = syntaxContext.SemanticModel.GetDeclaredSymbol(syntaxContext.Node, syntaxContext.CancellationToken); 111ISymbol symbol,
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
35protected abstract ICollection<ISymbol> GetMissingEnumMembers(TSwitchOperation operation);
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchExpressionDiagnosticAnalyzer.cs (1)
29protected sealed override ICollection<ISymbol> GetMissingEnumMembers(ISwitchExpressionOperation operation)
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchStatementDiagnosticAnalyzer.cs (1)
29protected sealed override ICollection<ISymbol> GetMissingEnumMembers(ISwitchOperation operation)
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchExpressionHelpers.cs (5)
16public static ICollection<ISymbol> GetMissingEnumMembers(ISwitchExpressionOperation operation) 29var enumMembers = new Dictionary<long, ISymbol>(); 52ISwitchExpressionOperation operation, Dictionary<long, ISymbol> enumMembers) 64internal static void HandleBinaryPattern(IBinaryPatternOperation? binaryPattern, Dictionary<long, ISymbol> enumMembers) 76private static void RemoveIfConstantPatternHasValue(IOperation operation, Dictionary<long, ISymbol> enumMembers)
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchStatementHelpers.cs (5)
55public static ICollection<ISymbol> GetMissingEnumMembers(ISwitchOperation switchStatement) 60var enumMembers = new Dictionary<long, ISymbol>(); 97private static bool TryRemoveExistingEnumMembers(ISwitchOperation switchStatement, Dictionary<long, ISymbol> enumValues) 153Dictionary<long, ISymbol> enumValues) 155foreach (var member in enumType.GetMembers())
src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (2)
42protected abstract bool CanMemberAccessBeQualified(ISymbol containingSymbol, SyntaxNode node); 144static bool IsStaticMemberOrIsLocalFunctionHelper(ISymbol symbol)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
752using var _2 = PooledHashSet<ISymbol>.GetInstance(out var processedPartialSymbols);
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\SuppressMessageAttributeState.cs (1)
95out ImmutableArray<ISymbol> resolvedSymbols)
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (26)
89protected virtual void HandleNamedTypeSymbolStart(SymbolStartAnalysisContext context, Action<ISymbol, ValueUsageInfo> onSymbolUsageFound) 99internal sealed class OriginalDefinitionSymbolEqualityComparer : IEqualityComparer<ISymbol> 107bool IEqualityComparer<ISymbol>.Equals(ISymbol? x, ISymbol? y) 110int IEqualityComparer<ISymbol>.GetHashCode(ISymbol obj) 118private static readonly ObjectPool<HashSet<ISymbol>> s_originalDefinitionSymbolHashSetPool = new(() => new(OriginalDefinitionSymbolEqualityComparer.Instance)); 123private readonly Dictionary<ISymbol, ValueUsageInfo> _symbolValueUsageStateMap_doNotAccessDirectly = new(OriginalDefinitionSymbolEqualityComparer.Instance); 165private static Location GetDiagnosticLocation(ISymbol symbol) 230Action<ISymbol, ValueUsageInfo> onSymbolUsageFound = OnSymbolUsage; 283foreach (var member in namedType.GetMembers()) 302var symbol = symbolContext.Symbol; 315private void AddSymbolUsage(ISymbol? symbol, ValueUsageInfo info) 326private void UpdateSymbolUsage(ISymbol? symbol, ValueUsageInfo info) 340private bool TryGetAndRemoveSymbolUsage(ISymbol memberSymbol, out ValueUsageInfo valueUsageInfo) 380private void OnSymbolUsage(ISymbol? memberSymbol, ValueUsageInfo usageInfo) 391var memberSymbol = memberReference.Member; 490foreach (var symbol in symbolInfo.GetAllSymbols()) 526foreach (var member in namedType.GetMembers()) 625ISymbol member, 667HashSet<ISymbol> builder, 687var symbol = lazyModel.GetSymbolInfo(node, cancellationToken).Symbol; 749foreach (var member in namedTypeSymbol.GetMembers()) 764private void AddDebuggerDisplayAttributeArgumentsCore(ISymbol symbol, ArrayBuilder<string> builder) 790private bool IsCandidateSymbol([NotNullWhen(true)] ISymbol? memberSymbol)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (2)
273public bool IsComputingUnusedParams(ISymbol symbol) 278ISymbol symbol,
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (7)
32/// We use this value in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/> to determine whether to bail from analysis or not. 45/// We use this value in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/> to determine whether to bail from analysis or not. 51/// We use this value in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/> to determine whether to bail from analysis or not. 253/// delegate escape, and corresponding bail out from flow analysis in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/>. 301/// delegate escape, and corresponding bail out from flow analysis in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/>. 366private bool ShouldAnalyze(IOperation operationBlock, ISymbol owningSymbol, ref bool hasUnknownOperationNoneDescendant) 589ISymbol symbol,
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
120foreach (var member in namedType.GetMembers())
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
176var symbol = semanticModel.GetSymbolInfo(identifier, cancellationToken).GetAnySymbol();
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractObjectCreationExpressionAnalyzer.cs (2)
141var initializedSymbol = semanticModel.GetDeclaredSymbol(valuePattern.GetRequiredParent(), cancellationToken); 176var initializedSymbol = semanticModel.GetSymbolInfo(left, cancellationToken).GetAnySymbol();
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (2)
56public readonly ISymbol? InitializedSymbol; 63ISymbol? initializedSymbol)
src\Analyzers\Core\Analyzers\UseCompoundAssignment\UseCompoundAssignmentUtilities.cs (1)
109var symbol = symbolInfo.Symbol;
src\Analyzers\Core\Analyzers\UseConditionalExpression\AbstractUseConditionalExpressionDiagnosticAnalyzer.cs (1)
31IConditionalOperation ifOperation, ISymbol containingSymbol, CancellationToken cancellationToken);
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentDiagnosticAnalyzer.cs (1)
25IConditionalOperation ifOperation, ISymbol containingSymbol, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnDiagnosticAnalyzer.cs (1)
25IConditionalOperation ifOperation, ISymbol containingSymbol, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\UseConditionalExpressionForReturnHelpers.cs (1)
17ISymbol containingSymbol,
src\Analyzers\Core\Analyzers\UseExplicitTupleName\UseExplicitTupleNameDiagnosticAnalyzer.cs (1)
79foreach (var member in containingType.GetMembers())
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
101var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (3)
22public static bool IsSystemNullableValueProperty([NotNullWhen(true)] ISymbol? symbol) 177var memberSymbol = semanticModel.GetSymbolInfo(whenPartToCheck, cancellationToken).GetAnySymbol(); 320var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (1)
79var memberSymbol = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).GetAnySymbol();
src\Analyzers\Core\Analyzers\UseObjectInitializer\UseNamedMemberInitializerAnalyzer.cs (4)
117var leftSymbol = this.SemanticModel.GetSymbolInfo(leftMemberAccess, cancellationToken).GetAnySymbol(); 128if (IsExplicitlyImplemented(type, leftSymbol, out var typeMember)) 178ISymbol? member, 179[NotNullWhen(true)] out ISymbol? typeMember)
src\Analyzers\Core\Analyzers\UseSystemHashCode\UseSystemHashCodeDiagnosticAnalyzer.cs (1)
45var owningSymbol = context.OwningSymbol;
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (6)
106if (!TryDecomposeIfCondition(ifOperation, out var localOrParameter)) 138private static bool ValueIsAccessed(SemanticModel semanticModel, IConditionalOperation ifOperation, IBlockOperation containingBlock, ISymbol localOrParameter, IExpressionStatementOperation expressionStatement, IAssignmentOperation assignmentExpression) 167IBlockOperation containingBlock, IConditionalOperation ifOperation, ISymbol localOrParameter, 189if (!TryGetLocalOrParameterSymbol(assignmentExpression.Value, out var assignmentValue)) 209[NotNullWhen(true)] out ISymbol? localOrParameter) 241[NotNullWhen(true)] out ISymbol? localOrParameter)
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (17)
65public ImmutableArray<ISymbol> Resolve(out bool resolvedWithDocCommentIdFormat) 70return ImmutableArray<ISymbol>.Empty; 82var results = ArrayBuilder<ISymbol>.GetInstance(); 198ISymbol singleResult; 377private TypeInfo? ParseType(ISymbol bindingContext) 491private TypeInfo? ParseIndexedTypeParameter(ISymbol bindingContext) 540private TypeInfo? ParseNamedTypeParameter(ISymbol bindingContext) 574private TypeInfo? ParseNamedType(ISymbol bindingContext) 655private TypeInfo[] ParseTypeArgumentList(ISymbol bindingContext) 724private ISymbol GetFirstMatchingIndexer(ImmutableArray<ISymbol> candidateMembers, ParameterInfo[] parameters) 726foreach (var symbol in candidateMembers) 738private ImmutableArray<IMethodSymbol> GetMatchingMethods(ImmutableArray<ISymbol> candidateMembers, int? arity, ParameterInfo[] parameters, TypeInfo? returnType) 742foreach (var symbol in candidateMembers) 806private ITypeSymbol BindParameterOrReturnType(ISymbol bindingContext, TypeInfo type) 821private static INamedTypeSymbol GetFirstMatchingNamedType(ImmutableArray<ISymbol> candidateMembers, int arity) 828private static INamespaceOrTypeSymbol GetFirstMatchingNamespaceOrType(ImmutableArray<ISymbol> candidateMembers)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
19ISymbol symbol, INamedTypeSymbol generatedCodeAttribute)
src\Workspaces\Core\Portable\Editing\DeclarationModifiers.cs (1)
63public static DeclarationModifiers From(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\CompilationExtensions.cs (1)
77foreach (var candidateMember in candidateTopLevelType.GetMembers(WellKnownMemberNames.TopLevelStatementsEntryPointMethodName))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (63)
67public static ISymbol? FindImplementationForAbstractMember(this INamedTypeSymbol? type, ISymbol symbol) 78private static bool ImplementationExists(INamedTypeSymbol classOrStructType, ISymbol member) 83ISymbol member, 84Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation, 152ISymbol member, 153Func<INamedTypeSymbol, ISymbol, bool> isValid, 156var implementation = classOrStructType.FindImplementationForInterfaceMember(member); 176public static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedMembers( 194static ImmutableArray<ISymbol> GetImplicitlyImplementableMembers(INamedTypeSymbol type, ISymbol within) 209static bool IsPropertyWithNonPublicImplementableAccessor(ISymbol member) 226static bool IsImplicitlyImplementable(ISymbol member, ISymbol within) 243private static bool IsImplementable(ISymbol m) 246public static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedMembersInThis( 256var implementation = classOrStructType.FindImplementationForInterfaceMember(m); 264public static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedMembersInThis( 267Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter, 275var implementation = classOrStructType.FindImplementationForInterfaceMember(m); 283public static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedExplicitMembers( 297private static ImmutableArray<ISymbol> GetExplicitlyImplementableMembers(INamedTypeSymbol type, ISymbol within) 309private static bool IsPropertyWithInaccessibleImplementableAccessor(ISymbol member, ISymbol within) 321private static bool IsInaccessibleImplementableAccessor(IMethodSymbol? accessor, ISymbol within) 324private static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedMembers( 327Func<INamedTypeSymbol, ISymbol, Func<INamedTypeSymbol, ISymbol, bool>, CancellationToken, bool> isImplemented, 328Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation, 329Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter, 399private static ImmutableArray<ISymbol> GetUnimplementedMembers( 402Func<INamedTypeSymbol, ISymbol, Func<INamedTypeSymbol, ISymbol, bool>, CancellationToken, bool> isImplemented, 403Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation, 404Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter, 407using var _ = ArrayBuilder<ISymbol>.GetInstance(out var results); 409foreach (var member in interfaceMemberGetter(interfaceType, classOrStructType)) 438void AddIfNotImplemented(ISymbol member) 445public static IEnumerable<ISymbol> GetAttributeNamedParameters( 448ISymbol within) 461foreach (var member in type.GetMembers()) 463var namedParameter = IsAttributeNamedParameter(member, within ?? compilation.Assembly); 472private static ISymbol? IsAttributeNamedParameter( 473ISymbol symbol, 474ISymbol within) 514private static ImmutableArray<ISymbol> GetMembers(INamedTypeSymbol type, ISymbol within) 527public static ImmutableArray<ISymbol> GetOverridableMembers( 533using var _ = PooledDictionary<ISymbol, int>.GetInstance(out var result); 566Dictionary<ISymbol, int> result, INamedTypeSymbol containingType, CancellationToken cancellationToken) 568foreach (var member in containingType.GetMembers()) 579var overriddenMember = member.GetOverriddenMember(); 587Dictionary<ISymbol, int> result, INamedTypeSymbol containingType, CancellationToken cancellationToken) 591foreach (var member in containingType.GetMembers()) 609Dictionary<ISymbol, int> result, INamedTypeSymbol containingType, 612foreach (var member in type.GetMembers()) 623private static bool IsOverridable(ISymbol member, INamedTypeSymbol containingType) 643private static bool IsEqualsObjectOverride(ISymbol? member) 654private static bool IsEqualsObject(ISymbol member)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IParameterSymbolExtensions.cs (1)
42foreach (var member in containingType.GetMembers(parameter.Name))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (94)
20public static string ToNameDisplayString(this ISymbol symbol) 23public static string ToSignatureDisplayString(this ISymbol symbol) 26public static bool HasPublicResultantVisibility(this ISymbol symbol) 29public static SymbolVisibility GetResultantVisibility(this ISymbol symbol) 76public static ISymbol? GetOverriddenMember(this ISymbol? symbol, bool allowLooseMatch = false) 81ISymbol? exactMatch = symbol switch 97if (TryFindLooseMatch(symbol, baseType, out var looseMatch)) 104bool TryFindLooseMatch(ISymbol symbol, INamedTypeSymbol baseType, [NotNullWhen(true)] out ISymbol? looseMatch) 109foreach (var member in baseType.GetMembers(symbol.Name)) 137public static ImmutableArray<ISymbol> ExplicitInterfaceImplementations(this ISymbol symbol) 140IEventSymbol @event => ImmutableArray<ISymbol>.CastUp(@event.ExplicitInterfaceImplementations), 141IMethodSymbol method => ImmutableArray<ISymbol>.CastUp(method.ExplicitInterfaceImplementations), 142IPropertySymbol property => ImmutableArray<ISymbol>.CastUp(property.ExplicitInterfaceImplementations), 146public static ImmutableArray<ISymbol> ExplicitOrImplicitInterfaceImplementations(this ISymbol symbol) 151using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 155foreach (var interfaceMember in iface.GetMembers()) 157var impl = symbol.ContainingType.FindImplementationForInterfaceMember(interfaceMember); 171public static ImmutableArray<ISymbol> ImplicitInterfaceImplementations(this ISymbol symbol) 174public static bool IsOverridable([NotNullWhen(true)] this ISymbol? symbol) 181public static bool IsImplementableMember([NotNullWhen(true)] this ISymbol? symbol) 213public static INamedTypeSymbol? GetContainingTypeOrThis(this ISymbol symbol) 223public static bool IsErrorType([NotNullWhen(true)] this ISymbol? symbol) 226public static bool IsModuleType([NotNullWhen(true)] this ISymbol? symbol) 229public static bool IsInterfaceType([NotNullWhen(true)] this ISymbol? symbol) 232public static bool IsArrayType([NotNullWhen(true)] this ISymbol? symbol) 235public static bool IsTupleType([NotNullWhen(true)] this ISymbol? symbol) 238public static bool IsAnonymousFunction([NotNullWhen(true)] this ISymbol? symbol) 241public static bool IsKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind) 244public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind) 247public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind1, SymbolKind kind2) 253public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind1, SymbolKind kind2, SymbolKind kind3) 259public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, params SymbolKind[] kinds) 265public static bool IsReducedExtension([NotNullWhen(true)] this ISymbol? symbol) 268public static bool IsEnumMember([NotNullWhen(true)] this ISymbol? symbol) 271public static bool IsExtensionMethod(this ISymbol symbol) 274public static bool IsLocalFunction([NotNullWhen(true)] this ISymbol? symbol) 277public static bool IsAnonymousOrLocalFunction([NotNullWhen(true)] this ISymbol? symbol) 280public static bool IsModuleMember([NotNullWhen(true)] this ISymbol? symbol) 283public static bool IsConstructor([NotNullWhen(true)] this ISymbol? symbol) 286public static bool IsStaticConstructor([NotNullWhen(true)] this ISymbol? symbol) 289public static bool IsDestructor([NotNullWhen(true)] this ISymbol? symbol) 292public static bool IsUserDefinedOperator([NotNullWhen(true)] this ISymbol? symbol) 295public static bool IsConversion([NotNullWhen(true)] this ISymbol? symbol) 298public static bool IsOrdinaryMethod([NotNullWhen(true)] this ISymbol? symbol) 301public static bool IsOrdinaryMethodOrLocalFunction([NotNullWhen(true)] this ISymbol? symbol) 304public static bool IsDelegateType([NotNullWhen(true)] this ISymbol? symbol) 307public static bool IsAnonymousType([NotNullWhen(true)] this ISymbol? symbol) 310public static bool IsNormalAnonymousType([NotNullWhen(true)] this ISymbol? symbol) 313public static bool IsAnonymousDelegateType([NotNullWhen(true)] this ISymbol? symbol) 316public static bool IsAnonymousTypeProperty([NotNullWhen(true)] this ISymbol? symbol) 319public static bool IsTupleField([NotNullWhen(true)] this ISymbol? symbol) 322public static bool IsIndexer([NotNullWhen(true)] this ISymbol? symbol) 325public static bool IsWriteableFieldOrProperty([NotNullWhen(true)] this ISymbol? symbol) 333public static bool IsRequired([NotNullWhen(true)] this ISymbol? symbol) 336public static ITypeSymbol? GetMemberType(this ISymbol? symbol) 348public static int GetArity(this ISymbol symbol) 357public static ISymbol? GetOriginalUnreducedDefinition(this ISymbol? symbol) 400public static bool IsFunctionValue([NotNullWhen(true)] this ISymbol? symbol) 403public static bool IsThisParameter([NotNullWhen(true)] this ISymbol? symbol) 407public static ISymbol? ConvertThisParameterToType(this ISymbol? symbol) 417public static bool IsParams([NotNullWhen(true)] this ISymbol? symbol) 420public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol? symbol) 428public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 436public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 449public static ImmutableArray<ITypeSymbol> GetTypeArguments(this ISymbol? symbol) 457public static ImmutableArray<ITypeSymbol> GetAllTypeArguments(this ISymbol symbol) 472public static bool IsAttribute([NotNullWhen(true)] this ISymbol? symbol) 481public static bool RequiresUnsafeModifier([NotNullWhen(true)] this ISymbol? member) 488this ISymbol? symbol, 531public static bool IsStaticType([NotNullWhen(true)] this ISymbol? symbol) 535[NotNullWhen(true)] this ISymbol? symbol, ISymbol withinType, IAssemblySymbol withinAssembly, CancellationToken cancellationToken) 555public static IEnumerable<IPropertySymbol> GetValidAnonymousTypeProperties(this ISymbol symbol) 561public static Accessibility ComputeResultantAccessibility(this ISymbol? symbol, ITypeSymbol finalDestination) 587public static bool IsInaccessibleLocal(this ISymbol symbol, int position) 605public static bool IsAccessor([NotNullWhen(true)] this ISymbol? symbol) 608public static bool IsPropertyAccessor([NotNullWhen(true)] this ISymbol? symbol) 611public static bool IsEventAccessor([NotNullWhen(true)] this ISymbol? symbol) 614public static bool IsFromSource(this ISymbol symbol) 617public static bool IsNonImplicitAndFromSource(this ISymbol symbol) 620public static ITypeSymbol? GetSymbolType(this ISymbol? symbol) 636public static bool IsAwaitableNonDynamic([NotNullWhen(true)] this ISymbol? symbol, SemanticModel semanticModel, int position) 775public static bool IsKind<TSymbol>(this ISymbol symbol, SymbolKind kind, [NotNullWhen(true)] out TSymbol? result) where TSymbol : class, ISymbol 792public static bool IsSymbolWithSpecialDiscardName(this ISymbol symbol) 801public static bool IsObsolete(this ISymbol symbol) 808public static bool HasAttribute([NotNullWhen(true)] this ISymbol? symbol, [NotNullWhen(true)] INamedTypeSymbol? attributeClass)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (2)
20private readonly HashSet<ISymbol> _visited = []; 22public override bool DefaultVisit(ISymbol node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (11)
16this ISymbol symbol, 17ISymbol within, 38this ISymbol symbol, 50this ISymbol symbol, 63ISymbol symbol, 82ISymbol symbol, 83ISymbol within, // must be assembly or named type symbol 173private static bool IsNamedTypeAccessible(INamedTypeSymbol type, ISymbol within) 211ISymbol within) 246ISymbol within, 406ISymbol within,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
16public override ITypeSymbol DefaultVisit(ISymbol node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (3)
16private readonly PooledHashSet<ISymbol> _visited = PooledHashSet<ISymbol>.GetInstance(); 23public override void DefaultVisit(ISymbol node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (13)
404public static bool CanSupportCollectionInitializer(this ITypeSymbol typeSymbol, ISymbol within) 435public static IEnumerable<T> GetAccessibleMembersInBaseTypes<T>(this ITypeSymbol containingType, ISymbol within) where T : class, ISymbol 444public static ImmutableArray<T> GetAccessibleMembersInThisAndBaseTypes<T>(this ITypeSymbol? containingType, ISymbol within) where T : class, ISymbol 454public static ImmutableArray<T> GetAccessibleMembersInThisAndBaseTypes<T>(this ITypeSymbol? containingType, string memberName, ISymbol within) where T : class, ISymbol 499public static IEnumerable<T> SelectAccessibleMembers<T>(this IEnumerable<ITypeSymbol>? types, ISymbol within) where T : class, ISymbol 509private static IEnumerable<T> SelectAccessibleMembers<T>(this IEnumerable<ITypeSymbol>? types, string memberName, ISymbol within) where T : class, ISymbol 694foreach (var member in type.GetMembers()) 755public static bool IsReadOnlySpan([NotNullWhen(true)] this ISymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
15public override Accessibility DefaultVisit(ISymbol node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
31public override ITypeSymbol DefaultVisit(ISymbol node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
17public override ITypeSymbol DefaultVisit(ISymbol node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
16public override ITypeSymbol DefaultVisit(ISymbol node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (2)
34public static ValueUsageInfo GetValueUsageInfo(this IOperation operation, ISymbol containingSymbol) 233public static RefKind GetRefKind(this IReturnOperation? operation, ISymbol containingSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (1)
135? EqualityComparer<ISymbol?>.Default.Equals(info1.Symbol, info2.Symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (9)
48public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 60public static ISymbol GetRequiredEnclosingSymbol(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 67where TSymbol : class, ISymbol 69for (var symbol = semanticModel.GetEnclosingSymbol(position, cancellationToken); 82public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 85(ISymbol)semanticModel.Compilation.Assembly; 107public static HashSet<ISymbol> GetAllDeclaredSymbols( 110var symbols = new HashSet<ISymbol>(); 117var symbol = semanticModel.GetDeclaredSymbol(current, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolInfoExtensions.cs (6)
15public static ImmutableArray<ISymbol> GetAllSymbols(this SymbolInfo info) 18private static ImmutableArray<ISymbol> GetAllSymbolsWorker(this SymbolInfo info) 21public static ISymbol? GetAnySymbol(this SymbolInfo info) 24public static ImmutableArray<ISymbol> GetBestOrAllSymbols(this SymbolInfo info) 31using var result = TemporaryArray<ISymbol>.Empty; 32foreach (var symbol in info.CandidateSymbols)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (14)
35private readonly PooledHashSet<ISymbol> _referenceTakenSymbolsBuilder; 40_referenceTakenSymbolsBuilder = PooledHashSet<ISymbol>.GetInstance(); 61protected abstract PooledDictionary<(ISymbol symbol, IOperation operation), bool> SymbolsWriteBuilder { get; } 66protected abstract PooledHashSet<ISymbol> SymbolsReadBuilder { get; } 132public abstract void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId); 137public abstract void SetTargetsFromSymbolForDelegate(IOperation write, ISymbol symbol); 143protected static PooledDictionary<(ISymbol Symbol, IOperation Write), bool> CreateSymbolsWriteMap( 146var symbolsWriteMap = PooledDictionary<(ISymbol Symbol, IOperation Write), bool>.GetInstance(); 150protected static PooledDictionary<(ISymbol Symbol, IOperation Write), bool> UpdateSymbolsWriteMap( 151PooledDictionary<(ISymbol Symbol, IOperation Write), bool> symbolsWriteMap, 158(ISymbol, IOperation) key = (parameter, null); 178public void OnReadReferenceFound(ISymbol symbol) 201public void OnWriteReferenceFound(ISymbol symbol, IOperation operation, bool maybeWritten, bool isRef) 237foreach (var symbol in SymbolsWriteBuilder.Keys.Select(d => d.symbol).ToArray())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (7)
28private readonly Dictionary<ISymbol, PooledHashSet<IOperation>> _reachingWrites; 62public void Clear(ISymbol symbol) 74public void ForEachCurrentWrite<TArg>(ISymbol symbol, Action<IOperation, TArg> action, TArg arg) 86public bool ForEachCurrentWrite<TArg>(ISymbol symbol, Func<IOperation, TArg, bool> action, TArg arg) 104public void OnWriteReferenceFound(ISymbol symbol, IOperation operation, bool maybeWritten) 130foreach (var key in _reachingWrites.Keys) 223private static void AddEntries(Dictionary<ISymbol, PooledHashSet<IOperation>> result, BasicBlockAnalysisData source)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.cs (2)
25public static SymbolUsageResult Run(ControlFlowGraph cfg, ISymbol owningSymbol, CancellationToken cancellationToken) 32public static SymbolUsageResult Run(IOperation rootOperation, ISymbol owningSymbol, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (2)
25private DataFlowAnalyzer(ControlFlowGraph cfg, ISymbol owningSymbol) 40public static SymbolUsageResult RunAnalysis(ControlFlowGraph cfg, ISymbol owningSymbol, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (17)
41private readonly PooledDictionary<CaptureId, PooledHashSet<(ISymbol, IOperation)>> _lValueFlowCapturesMap; 69private readonly PooledDictionary<(int firstBlockOrdinal, int lastBlockOrdinal), PooledHashSet<(ISymbol, IOperation)>> _symbolWritesInsideBlockRangeMap; 73ISymbol owningSymbol, 77PooledDictionary<(ISymbol symbol, IOperation operation), bool> symbolsWriteMap, 78PooledHashSet<ISymbol> symbolsRead, 99_lValueFlowCapturesMap = PooledDictionary<CaptureId, PooledHashSet<(ISymbol, IOperation)>>.GetInstance(); 103_symbolWritesInsideBlockRangeMap = PooledDictionary<(int firstBlockOrdinal, int lastBlockOrdinal), PooledHashSet<(ISymbol, IOperation)>>.GetInstance(); 106public ISymbol OwningSymbol { get; } 108protected override PooledHashSet<ISymbol> SymbolsReadBuilder { get; } 110protected override PooledDictionary<(ISymbol symbol, IOperation operation), bool> SymbolsWriteBuilder { get; } 118ISymbol owningSymbol, 131symbolsRead: PooledHashSet<ISymbol>.GetInstance(), 215private PooledHashSet<(ISymbol, IOperation)> GetOrCreateSymbolWritesInBlockRange(int firstBlockOrdinal, int lastBlockOrdinal, CancellationToken cancellationToken) 224writesInBlockRange = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 462public override void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId) 466captures = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 514public override void SetTargetsFromSymbolForDelegate(IOperation write, ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.OperationTreeAnalysisData.cs (8)
21PooledDictionary<(ISymbol symbol, IOperation operation), bool> symbolsWriteMap, 22PooledHashSet<ISymbol> symbolsRead, 32protected override PooledHashSet<ISymbol> SymbolsReadBuilder { get; } 34protected override PooledDictionary<(ISymbol symbol, IOperation operation), bool> SymbolsWriteBuilder { get; } 39ISymbol owningSymbol, 44symbolsRead: PooledHashSet<ISymbol>.GetInstance(), 63public override void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId) 75public override void SetTargetsFromSymbolForDelegate(IOperation write, ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (13)
26private ISymbol _currentContainingSymbol; 29private PooledDictionary<IAssignmentOperation, PooledHashSet<(ISymbol, IOperation)>> _pendingWritesMap; 35ISymbol containingSymbol, 51private void Visit(ISymbol containingSymbol, IEnumerable<IOperation> operations, AnalysisData analysisData, CancellationToken cancellationToken) 58_pendingWritesMap = PooledDictionary<IAssignmentOperation, PooledHashSet<(ISymbol, IOperation)>>.GetInstance(); 90private void OnReadReferenceFound(ISymbol symbol) 93private void OnWriteReferenceFound(ISymbol symbol, IOperation operation, ValueUsageInfo valueUsageInfo) 101private void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId) 107private void OnReferenceFound(ISymbol symbol, IOperation operation) 159private bool MakePendingWrite(IOperation operation, ISymbol symbolOpt) 166var set = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 175set = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 407private void ProcessPossibleDelegateCreationAssignment(ISymbol symbol, IOperation write)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (6)
13ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 14ImmutableHashSet<ISymbol> symbolsRead) 33public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } = symbolWritesMap; 38public ImmutableHashSet<ISymbol> SymbolsRead { get; } = symbolsRead; 47public IEnumerable<(ISymbol Symbol, IOperation WriteOperation)> GetUnreadSymbolWrites() 71public int GetSymbolWriteCount(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (2)
19public static IdentifierNameParts CreateIdentifierNameParts(ISymbol symbol, ImmutableArray<NamingRule> rules) 35private static string RemovePrefixesAndSuffixes(ISymbol symbol, ImmutableArray<NamingRule> rules, string baseName)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (5)
18internal bool TryGetApplicableRule(ISymbol symbol, out NamingRule applicableRule) 37private bool IsSymbolNameAnalyzable(ISymbol symbol) 58private static bool DoesSymbolImplementAnotherSymbol(ISymbol symbol) 80private static bool IsInterfaceImplementation(ISymbol symbol) 93foreach (var implementedInterfaceMember in implementedInterfaceMembersWithSameName)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (5)
96public bool AppliesTo(ISymbol symbol) 158private static Accessibility GetAccessibility(ISymbol symbol) 160for (var currentSymbol = symbol; currentSymbol != null; currentSymbol = currentSymbol.ContainingSymbol) 363public bool MatchesSymbol(ISymbol symbol) 503public bool MatchesSymbol(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (6)
65ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 90IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken); 95ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 96ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 98ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken); 105ImmutableArray<IMethodSymbol> GetLocalFunctionSymbols(Compilation compilation, ISymbol symbol, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (2)
100foreach (var symbol in symbolInfo.CandidateSymbols) 111private static bool IsUserDefinedOperator([NotNullWhen(returnValue: true)] ISymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Simplification\SymbolAnnotation.cs (3)
17public static SyntaxAnnotation Create(ISymbol symbol) 20public static ISymbol? GetSymbol(SyntaxAnnotation annotation, Compilation compilation) 23public static ImmutableArray<ISymbol> GetSymbols(SyntaxAnnotation annotation, Compilation compilation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AbstractSymbolKey.cs (1)
10where TSymbol : class, ISymbol
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (3)
41var target = targetResolution.GetAnySymbol(); 59SemanticModel semanticModel, SyntaxNode syntaxNode, string name, ISymbol target, 66var symbol = semanticModel.GetDeclaredSymbol(syntaxNode, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (2)
21public static void Create(ISymbol symbol, SymbolKeyWriter visitor) 57var symbol = semanticModel.GetSymbolInfo(node, reader.CancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (7)
19public static ImmutableArray<Location?> GetBodyLevelSourceLocations(ISymbol symbol, CancellationToken cancellationToken) 38public static void Create(ISymbol symbol, SymbolKeyWriter visitor) 69var container = symbol.ContainingSymbol; 100private static SyntaxNode? TryGetContainerDeclaration(ISymbol container, SyntaxTree? syntaxTree, CancellationToken cancellationToken) 230var symbol = resolution.GetAnySymbol(); 254private static IEnumerable<(ISymbol symbol, int ordinal)> EnumerateSymbols( 263var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (31)
29/// the "same" <see cref="ISymbol.ContainingType"/> and 30/// equal <see cref="ISymbol.MetadataName"/>.</item> 32/// the "same" <see cref="ISymbol.ContainingType"/>, 33/// equal <see cref="ISymbol.MetadataName"/>, 39/// the "same" <see cref="ISymbol.ContainingAssembly"/>. 40/// <see cref="ISymbol.MetadataName"/> is not used because module identity is not important in practice.</item> 42/// the "same" <see cref="ISymbol.ContainingSymbol"/>, 43/// equal <see cref="ISymbol.MetadataName"/>, 47/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 48/// equal <see cref="ISymbol.MetadataName"/>. 53/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 54/// equal <see cref="ISymbol.MetadataName"/>.</item> 58/// the "same" the "same" <see cref="ISymbol.ContainingType"/>, 59/// the "same" <see cref="ISymbol.MetadataName"/>, and have 63/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 64/// the "same" <see cref="ISymbol.MetadataName"/>.</item> 66/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 67/// the "same" <see cref="ISymbol.MetadataName"/>.</item> 69/// the "same" <see cref="ISymbol.Name"/>.</item> 76/// cref="SyntaxTree"/> is enumerated to list all the symbols with the same <see cref="ISymbol.Name"/> and <see 77/// cref="ISymbol.Kind"/> as the original symbol. The symbol with the same index in the destination tree as the 127public static SymbolKey Create(ISymbol? symbol, CancellationToken cancellationToken = default) 146public static bool CanCreate(ISymbol symbol, CancellationToken cancellationToken) 200public static string CreateString(ISymbol? symbol, CancellationToken cancellationToken = default) 204internal static string CreateStringWorker(int version, ISymbol? symbol, CancellationToken cancellationToken = default) 231/// to the corresponding <see cref="ISymbol"/> in a future <see cref="Compilation"/>. 243where TSymbol : class, ISymbol 259ImmutableArray<ISymbol>.CastUp(symbols.Builder.ToImmutableAndClear()), 296string? metadataName) where TSymbol : ISymbol 305foreach (var member in members) 315public static bool IsBodyLevelSymbol(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (2)
63var containingContextualSymbol = containerKind switch 683 => (ISymbol?)null,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (13)
332private readonly Stack<ISymbol?> _contextualSymbolStack = new(); 385where TOwningSymbol : ISymbol 425public ContextualSymbolPopper PushContextualSymbol(ISymbol? contextualSymbol) 431private void PopContextualSymbol(ISymbol? contextualSymbol) 438public ISymbol? CurrentContextualSymbol 447public readonly ref struct ContextualSymbolPopper(SymbolKeyReader reader, ISymbol? contextualSymbol) 468public SymbolKeyResolution ReadSymbolKey(ISymbol? contextualSymbol, out string? failureReason) 539Func<TContextualSymbol, int, ISymbol?>? getContextualSymbol, 558var nextContextualSymbol = contextualSymbol is null ? null : getContextualSymbol?.Invoke(contextualSymbol, i); 591Func<TContextualSymbol, int, ISymbol?>? getContextualSymbol, 593where TContextualSymbol : ISymbol 594where TSymbol : ISymbol 729var symbol = semanticModel.GetDeclaredSymbol(node, CancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (5)
57private readonly Action<ISymbol> _writeSymbolKey; 64private readonly Dictionary<ISymbol, int> _symbolToId = []; 128internal void WriteSymbolKey(ISymbol? symbol) 278where TSymbol : ISymbol 493public bool ShouldWriteTypeParameterOrdinal(ISymbol symbol, out int methodIndex)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
39using var _3 = ArrayBuilder<ISymbol>.GetInstance(out var elementTypes);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKeyExtensions.cs (1)
11public static SymbolKey GetSymbolKey(this ISymbol? symbol, CancellationToken cancellationToken = default)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKeyResolution.cs (8)
11/// single <see cref="ISymbol"/> then that will be returned in <see cref="Symbol"/>. Otherwise, if the key resolves 20private readonly ImmutableArray<ISymbol> _candidateSymbols; 22internal SymbolKeyResolution(ISymbol? symbol) 29internal SymbolKeyResolution(ImmutableArray<ISymbol> candidateSymbols, CandidateReason candidateReason) 38public ISymbol? Symbol { get; } 40public ImmutableArray<ISymbol> CandidateSymbols => _candidateSymbols.NullToEmpty(); 42public Enumerator<ISymbol> GetEnumerator() 45internal Enumerable<TSymbol> OfType<TSymbol>() where TSymbol : ISymbol
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKeyResolution.Enumeration.cs (2)
9public readonly struct Enumerable<TSymbol> where TSymbol : ISymbol 20public struct Enumerator<TSymbol> where TSymbol : ISymbol
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKeyResolutionExtensions.cs (1)
9internal static ISymbol? GetAnySymbol(this SymbolKeyResolution resolution)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (26)
357protected bool SymbolsAreCompatible(ISymbol? symbol, ISymbol? newSymbol, bool requireNonNullSymbols = false) 361ISymbol? symbol, 362ISymbol? newSymbol, 445private static bool CompareAcrossSemanticModels(ISymbol symbol, ISymbol newSymbol) 696private static bool IsStaticAccess(ISymbol? symbol) 734var originalExpressionSymbol = this.OriginalSemanticModel.GetSymbolInfo(currentOriginalNode).Symbol; 735var replacedExpressionSymbol = this.SpeculativeSemanticModel.GetSymbolInfo(currentReplacedNode).Symbol; 754private static bool IsSymbolSystemObjectInstanceMethod([NotNullWhen(true)] ISymbol? symbol) 765var attributeSym = this.OriginalSemanticModel.GetSymbolInfo(attribute).Symbol; 766var newAttributeSym = this.SpeculativeSemanticModel.GetSymbolInfo(newAttribute).Symbol; 828var implementationMember = expressionType.FindImplementationForInterfaceMember(getEnumerator); 859var symbol = this.OriginalSemanticModel.GetSymbolInfo(type).Symbol; 861ISymbol? newSymbol; 875private static bool IsDelegateInvoke(ISymbol symbol) 878private static bool IsAnonymousDelegateInvoke(ISymbol symbol) 894var symbol = originalSymbolInfo.Symbol; 895var newSymbol = newSymbolInfo.Symbol; 921for (var overriddenMember = newSymbol.GetOverriddenMember(); overriddenMember != null; overriddenMember = overriddenMember.GetOverriddenMember()) 972ISymbol symbol, 973ISymbol newSymbol, 1003var implementationMember = newSymbolContainingType.FindImplementationForInterfaceMember(symbol); 1050var receiverSymbol = semanticModel.GetSymbolInfo(receiver).GetAnySymbol(); 1060private bool SymbolsHaveCompatibleParameterLists(ISymbol originalSymbol, ISymbol newSymbol, TExpressionSyntax originalInvocation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (6)
28public bool HaveSameSignature(ISymbol symbol1, ISymbol symbol2, bool caseSensitive) 134public bool HaveSameSignatureAndConstraintsAndReturnTypeAndAccessors(ISymbol symbol1, ISymbol symbol2, bool caseSensitive) 149public bool HaveSameSignatureAndConstraintsAndReturnType(ISymbol symbol1, ISymbol symbol2, bool caseSensitive)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.cs (13)
38internal sealed partial class SymbolEquivalenceComparer : IEqualityComparer<ISymbol?> 152public bool Equals(ISymbol? x, ISymbol? y) 161public bool Equals(ISymbol? x, ISymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 167private bool EqualsCore(ISymbol? x, ISymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 170public int GetHashCode(ISymbol? x) 173private static ISymbol UnwrapAlias(ISymbol symbol) 176private static SymbolKind GetKindAndUnwrapAlias(ref ISymbol symbol) 194private static bool IsObjectType(ISymbol symbol) 219foreach (var candidate in errorType.CandidateSymbols)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (6)
20public bool AreEquivalent(ISymbol? x, ISymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 110private bool AreEquivalentWorker(ISymbol x, ISymbol y, SymbolKind k, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 270private static bool HaveSameLocation(ISymbol x, ISymbol y)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (4)
21private readonly Func<int, ISymbol, int> _symbolAggregator; 33public int GetHashCode(ISymbol? x, int currentHash) 56private int GetHashCodeWorker(ISymbol x, int currentHash) 149foreach (var candidate in errorType.CandidateSymbols)
Microsoft.CodeAnalysis.CodeStyle.Fixes (223)
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
52var symbol = semanticModel.GetDeclaredSymbol(declarator, cancellationToken);
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AddAccessibilityModifiersHelpers.cs (2)
13SyntaxEditor editor, ISymbol symbol, SyntaxNode declaration) 39private static Accessibility GetPreferredAccessibility(ISymbol symbol)
src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (1)
50using var _ = ArrayBuilder<ISymbol>.GetInstance(out var candidateSymbols);
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
112for (ISymbol current = symbol; current != null; current = current.ContainingSymbol)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
123protected static bool IsSymbolAccessible(ISymbol? symbol, SemanticDocument document)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (3)
55private ImmutableDictionary<string, ISymbol>? _parameterToExistingMemberMap; 403var definition = SymbolFinderInternal.FindSourceDefinition(original, _document.Project.Solution, cancellationToken); 461private async Task<(ImmutableArray<ISymbol>, ImmutableArray<SyntaxNode>)> GenerateMembersAndAssignmentsAsync(
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (9)
50private static bool IsSymbolAccessible(Compilation compilation, ISymbol symbol) 132ImmutableDictionary<string, ISymbol> parameterToExistingMemberMap, 149var parameterToExistingMemberMap = ImmutableDictionary.CreateBuilder<string, ISymbol>(); 186var symbol = TryFindMatchingMember(parameterName); 239ISymbol? TryFindMatchingMember(ParameterName parameterName) 245var symbol = TryFindMemberWithRule(fieldNamingRule, parameterNameParts); 261ISymbol? TryFindMemberWithRule(NamingRule rule, IdentifierNameParts parameterNameParts) 311private static bool IsSymbolAccessible(ISymbol? symbol, SemanticDocument document) 347ISymbol symbol,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
24protected abstract bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (6)
344var previousAssignedSymbol = TryGetAssignedSymbol(symbolKind, children, statementindex - 1, cancellationToken); 345var nextAssignedSymbol = TryGetAssignedSymbol(symbolKind, children, statementindex + 1, cancellationToken); 360private ISymbol TryGetAssignedSymbol( 377var symbol = _document.SemanticModel.GetSymbolInfo(left, cancellationToken).Symbol; 392var symbol = semanticModel.GetEnclosingSymbol(position, cancellationToken); 406private static bool FieldIsReadOnly(ISymbol symbol)
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (19)
35ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> unimplementedMembers) 41private readonly ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> _unimplementedMembers = unimplementedMembers; 89ISymbol? throughMember, bool? canDelegateAllMembers, CancellationToken cancellationToken) 126private ImmutableArray<ISymbol> GenerateMembers( 127Compilation compilation, ISymbol? throughMember, 137private ISymbol? GenerateMember( 138Compilation compilation, ISymbol member, ISymbol? throughMember, 151private ISymbol? GenerateMember( 152Compilation compilation, ISymbol member, ISymbol? throughMember, bool addUnsafe, 175private ISymbol GenerateMethod( 176Compilation compilation, IMethodSymbol method, ISymbol? throughMember, 197ISymbol? throughMember, 238IEventSymbol @event, ISymbol? throughMember, Accessibility accessibility, DeclarationModifiers modifiers) 248IEventSymbol @event, IMethodSymbol? accessor, ISymbol? throughMember, 269public ImmutableArray<(ISymbol symbol, bool canDelegateAllMembers)> GetDelegatableMembers(CancellationToken cancellationToken) 277using var _ = ArrayBuilder<(ISymbol symbol, bool canDelegateAllMembers)>.GetInstance(out var result); 284foreach (var member in members)
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (2)
156foreach (var member in delegatableMembers) 200private static ImmutableArray<ISymbol> GetDelegatableMembers(
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.cs (2)
102public ImmutableArray<ISymbol> ImplementInterfaceMember( 108ISymbol interfaceMember)
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.State.cs (3)
36public ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> MembersWithoutExplicitOrImplicitImplementationWhichCanBeImplicitlyImplemented => Info.MembersWithoutExplicitOrImplicitImplementationWhichCanBeImplicitlyImplemented; 37public ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> MembersWithoutExplicitOrImplicitImplementation => Info.MembersWithoutExplicitOrImplicitImplementation; 40public ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> MembersWithoutExplicitImplementation => Info.MembersWithoutExplicitImplementation;
src\Analyzers\Core\CodeFixes\ImplementInterface\IImplementInterfaceService.cs (3)
19public ISymbol? ThroughMember { get; init; } 40ImmutableArray<ISymbol> ImplementInterfaceMember( 46ISymbol interfaceMember);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (3)
18public static ImmutableArray<ISymbol> GetDelegatableMembers( 120ISymbol? first, INamedTypeSymbol second, bool supportsImplicitImplementationOfNonPublicInterfaceMembers) 254foreach (var member in idisposable.GetMembers(nameof(IDisposable.Dispose)))
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (29)
46private ISymbol? ThroughMember => Configuration.ThroughMember; 76ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> unimplementedMembers, 77ImmutableArray<ISymbol> extraMembers, 106private ImmutableArray<ISymbol> GenerateMembers( 109ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> unimplementedMembers, 126using var _1 = ArrayBuilder<ISymbol>.GetInstance(out var implementedVisibleMembers); 127using var _2 = ArrayBuilder<ISymbol>.GetInstance(out var implementedMembers); 131foreach (var unimplementedInterfaceMember in unimplementedInterfaceMembers) 160private string DetermineMemberName(ISymbol member, ArrayBuilder<ISymbol> implementedVisibleMembers, out ISymbol? conflictingMember) 167var memberNames = State.ClassOrStructType.GetAccessibleMembersInThisAndBaseTypes<ISymbol>(State.ClassOrStructType).Select(m => m.Name); 179private IEnumerable<ISymbol?> GenerateMembers( 182ISymbol member, 183ArrayBuilder<ISymbol> implementedVisibleMembers, 200var memberName = DetermineMemberName(member, implementedVisibleMembers, out var conflictingMember); 229ParseOptions options, ISymbol member, string memberName, bool supportsImplementingLessAccessibleMember) 257private bool HasUnexpressibleConstraint(ParseOptions options, ISymbol member) 284public ImmutableArray<ISymbol> GenerateMembers( 286ISymbol member, 287ISymbol? conflictingMember, 312private ISymbol GenerateEvent(Compilation compilation, string memberName, bool generateInvisibly, SyntaxGenerator factory, DeclarationModifiers modifiers, bool useExplicitInterfaceSymbol, Accessibility accessibility, IEventSymbol @event) 350ISymbol member, 364private static bool HasNameConflict(ISymbol member, ISymbol baseMember) 387private bool HasMatchingMember(ArrayBuilder<ISymbol> implementedVisibleMembers, ISymbol member) 412private bool MembersMatch(ISymbol existingMember, ISymbol memberToAdd)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Conflicts.cs (6)
25private bool HasConflictingMember(ISymbol member, ArrayBuilder<ISymbol> implementedVisibleMembers, [NotNullWhen(true)] out ISymbol? conflictingMember) 31var allMembers = State.ClassOrStructType.GetAccessibleMembersInThisAndBaseTypes<ISymbol>(State.ClassOrStructType).Concat(implementedVisibleMembers); 37private bool HasConflict(ISymbol member1, ISymbol member2)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (3)
46ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> unimplementedMembers, 117private (ImmutableArray<ISymbol>, SyntaxNode) CreateDisposableMethods( 132return (ImmutableArray.Create<ISymbol>(disposeImplMethod, disposeInterfaceMethod), finalizer);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Method.cs (1)
24private ISymbol GenerateMethod(
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Property.cs (2)
28private ImmutableArray<ISymbol> GeneratePropertyMembers( 56using var result = TemporaryArray<ISymbol>.Empty;
src\Analyzers\Core\CodeFixes\MakeTypePartial\AbstractMakeTypePartialCodeFixProvider.cs (1)
37var symbol = semanticModel.GetDeclaredSymbol(declaration, cancellationToken);
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (2)
74var symbol = model.GetDeclaredSymbol(node, context.CancellationToken); 104Document document, ISymbol symbol, string fixedName, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
39protected abstract ICollection<ISymbol> GetMissingEnumMembers(TSwitchOperation switchOperation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
45protected sealed override ICollection<ISymbol> GetMissingEnumMembers(ISwitchExpressionOperation switchOperation)
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
62protected sealed override ICollection<ISymbol> GetMissingEnumMembers(ISwitchOperation switchOperation)
src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (1)
56var symbol = semanticModel.GetDeclaredSymbol(diagnosticNode, cancellationToken);
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
42var definition = SymbolFinderInternal.FindSourceDefinition(
src\Analyzers\Core\CodeFixes\UseSystemHashCode\UseSystemHashCodeCodeFixProvider.cs (1)
59var method = semanticModel.GetDeclaredSymbol(methodDecl, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (12)
65public TDeclarationNode AddMembers<TDeclarationNode>(TDeclarationNode destination, IEnumerable<ISymbol> members, CodeGenerationContextInfo info, CancellationToken cancellationToken) 115public TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 140public abstract TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 271IEnumerable<ISymbol> members, 294IEnumerable<ISymbol> members, 301foreach (var member in members) 325IEnumerable<ISymbol> members, 333foreach (var member in members) 342private SyntaxNode? GetNewMember(TCodeGenerationContextInfo info, CodeGenerationDestination codeGenerationDestination, ISymbol member, CancellationToken cancellationToken) 358ISymbol member, 373private static bool GeneratingEnum(IEnumerable<ISymbol> members) 455public Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
25public bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (3)
38public static TSyntaxNode? AddAnnotationsTo<TSyntaxNode>(ISymbol symbol, TSyntaxNode? syntax) where TSyntaxNode : SyntaxNode 116ISymbol symbol, string commentToken, [NotNullWhen(true)] out string? comment, CancellationToken cancellationToken = default) 150public static IEnumerable<ISymbol> GetMembers(INamedTypeSymbol namedType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (4)
27public static bool IsCodeGenerationSymbol(this ISymbol symbol) 428ImmutableArray<ISymbol> members = default, 447ImmutableArray<ISymbol> members = default, 508public static INamespaceSymbol CreateNamespaceSymbol(string name, IList<ISymbol>? imports = null, IList<INamespaceOrTypeSymbol>? members = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (2)
85public static Task<Document> AddMemberDeclarationsAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken) 91public static bool CanAdd(Solution solution, ISymbol destination, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (4)
83TDeclarationNode AddMembers<TDeclarationNode>(TDeclarationNode destination, IEnumerable<ISymbol> members, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 123TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 173Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken); 178bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
91public override ISymbol ContainingSymbol => this.ContainingType; 101public virtual ISymbol AssociatedSymbol => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
114public ISymbol AssociatedSymbol { get; internal set; }
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationFieldSymbol.cs (1)
96public ISymbol AssociatedSymbol => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (4)
25private readonly ImmutableArray<ISymbol> _members; 41ImmutableArray<ISymbol> members, 119public static ImmutableArray<ISymbol> CandidateSymbols 162public override ImmutableArray<ISymbol> GetMembers()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceInfo.cs (6)
17private readonly IList<ISymbol> _imports; 19private CodeGenerationNamespaceInfo(IList<ISymbol> imports) 24IList<ISymbol> imports) 26var info = new CodeGenerationNamespaceInfo(imports ?? SpecializedCollections.EmptyList<ISymbol>()); 36public static IList<ISymbol> GetImports(INamespaceSymbol @namespace) 39private static IList<ISymbol> GetImports(CodeGenerationNamespaceInfo info)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceOrTypeSymbol.cs (2)
28public virtual ImmutableArray<ISymbol> GetMembers() 31public ImmutableArray<ISymbol> GetMembers(string name)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (4)
82public virtual ISymbol ContainingSymbol => null; 173public ISymbol OriginalDefinition 222public bool Equals(ISymbol other) 225public bool Equals(ISymbol other, SymbolEqualityComparer equalityComparer)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (2)
60public ISymbol FindImplementationForInterfaceMember(ISymbol interfaceMember) => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\SyntaxAnnotationExtensions.cs (1)
15where TSymbol : ISymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (2)
142this IMethodSymbol method, ISymbol accessibleWithin, 172static bool shouldRemoveAttribute(AttributeData a, (INamedTypeSymbol[] removeAttributeTypes, ISymbol accessibleWithin) arg)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IPropertySymbolExtensions.cs (2)
41this IPropertySymbol property, ISymbol accessibleWithin, params INamedTypeSymbol[] attributesToRemove) 69static bool ShouldRemoveAttribute(AttributeData a, (INamedTypeSymbol[] attributesToRemove, ISymbol accessibleWithin) arg)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISymbolExtensions.cs (1)
15public static DeclarationModifiers GetSymbolModifiers(this ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (14)
86private static ITypeSymbol GetType(Compilation compilation, ISymbol symbol) 101this SyntaxGenerator generator, IMethodSymbol method, ISymbol throughMember) 116this SyntaxGenerator generator, ISymbol member, ISymbol throughMember) 180static SyntaxNode GenerateContainerName(SyntaxGenerator factory, ISymbol throughMember) 194ISymbol? throughMember, 233ISymbol? throughMember, 277private static bool TryGetValue(IDictionary<string, ISymbol>? dictionary, string key, [NotNullWhen(true)] out string? value) 280if (dictionary != null && dictionary.TryGetValue(key, out var symbol)) 289public static ImmutableArray<ISymbol> CreateFieldsForParameters( 292using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 311public static ImmutableArray<ISymbol> CreatePropertiesForParameters( 314using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 346IDictionary<string, ISymbol>? parameterToExistingFieldMap,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (9)
38ImmutableArray<ISymbol> symbols, 69ImmutableArray<ISymbol> symbols, 115ImmutableArray<ISymbol> members, 220ImmutableArray<ISymbol> members, SyntaxNode localNameExpression, 229foreach (var member in members) 277ImmutableArray<ISymbol> members) 456public static ImmutableArray<ISymbol> CreateMemberDelegatingConstructor( 464ImmutableDictionary<string, ISymbol>? parameterToExistingMemberMap, 496IDictionary<string, ISymbol>? parameterToExistingFieldMap)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (5)
22ImmutableArray<ISymbol> members, 33foreach (var member in members) 84ImmutableArray<ISymbol> members, 104foreach (var symbol in members) 221ISymbol member,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\FindSymbols\LinkedFileReferenceLocationEqualityComparer.cs (1)
11/// Helper comparer to enable consumers of <see cref="SymbolFinder.FindReferencesAsync(ISymbol, Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (5)
29protected abstract bool TryUpdateTupleAssignment(IBlockOperation? blockStatement, IParameterSymbol parameter, ISymbol fieldOrProperty, SyntaxEditor editor); 31Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken); 85ISymbol fieldOrProperty, 114ISymbol fieldOrProperty, 138ISymbol fieldOrProperty,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
22Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\InitializeParameterHelpersCore.cs (3)
80IParameterSymbol parameter, IBlockOperation? blockStatement, out ISymbol? fieldOrProperty) 147[NotNullWhen(true)] out ISymbol? fieldOrProperty) 169[NotNullWhen(true)] out ISymbol? fieldOrProperty)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (10)
32private static readonly Func<ISymbol, bool> s_LocalNameFilter = s => 75string baseName, Func<ISymbol, bool> filter, 92protected virtual IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode container, CancellationToken cancellationToken) 115var impl = type.FindImplementationForInterfaceMember(disposeMethodToLookFor); 198public ISymbol GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 228public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 237public ISymbol FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 240public ISymbol FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 243public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode node, SyntaxToken token, CancellationToken cancellationToken) 249public ImmutableArray<IMethodSymbol> GetLocalFunctionSymbols(Compilation compilation, ISymbol symbol, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\ISemanticFactsService.cs (1)
35Func<ISymbol, bool> filter, IEnumerable<string> usedNames, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SymbolDeclarationService\ISymbolDeclarationService.cs (1)
17ImmutableArray<SyntaxReference> GetDeclarations(ISymbol symbol);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
116protected static bool IsEnumHasFlag(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (3)
63public static ISymbol? GetOriginalSymbolInfo(SemanticModel semanticModel, SyntaxNode expression) 93public static bool IsValidSymbolInfo([NotNullWhen(true)] ISymbol? symbol) 114internal static bool ShouldSimplifyThisOrMeMemberAccessExpression(SimplifierOptions options, ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (5)
17internal static ISymbol? FindSourceDefinition( 18ISymbol? symbol, Solution solution, CancellationToken cancellationToken) 41private static ISymbol? FindSourceDefinitionWorker( 42ISymbol symbol, 91static bool InSource([NotNullWhen(true)] ISymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\AsyncSymbolVisitor`1.cs (2)
14public override ValueTask<TResult> Visit(ISymbol? symbol) 17public override ValueTask<TResult> DefaultVisit(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (1)
55ISymbol symbol,
Microsoft.CodeAnalysis.CSharp (317)
Compilation\CSharpCompilation.cs (9)
1207internal override TSymbol? GetSymbolInternal<TSymbol>(ISymbol? symbol) where TSymbol : class 2397ISymbol symbol, 2398ISymbol within, 2413ISymbol symbol, 2414ISymbol within, 3777Func<ISymbol, bool> isAddedSymbol, 4017protected override ISymbol? CommonGetAssemblyOrModuleSymbol(MetadataReference reference) 4621public override IEnumerable<ISymbol> GetSymbolsWithName(Func<string, bool> predicate, SymbolFilter filter = SymbolFilter.TypeAndMember, CancellationToken cancellationToken = default) 4663public override IEnumerable<ISymbol> GetSymbolsWithName(string name, SymbolFilter filter = SymbolFilter.TypeAndMember, CancellationToken cancellationToken = default)
Compilation\CSharpSemanticModel.cs (54)
564var symbol = GetDeclaredSymbol((SingleVariableDesignationSyntax)declaration.Designation, cancellationToken); 591var variable = GetDeclaredSymbol(variableDesignation, cancellationToken); 1084public ImmutableArray<ISymbol> GetMemberGroup(ExpressionSyntax expression, CancellationToken cancellationToken = default(CancellationToken)) 1090: ImmutableArray<ISymbol>.Empty; 1098public ImmutableArray<ISymbol> GetMemberGroup(AttributeSyntax attribute, CancellationToken cancellationToken = default(CancellationToken)) 1104: ImmutableArray<ISymbol>.Empty; 1112public ImmutableArray<ISymbol> GetMemberGroup(ConstructorInitializerSyntax initializer, CancellationToken cancellationToken = default(CancellationToken)) 1118: ImmutableArray<ISymbol>.Empty; 1413public ImmutableArray<ISymbol> LookupSymbols( 1458public new ImmutableArray<ISymbol> LookupBaseMembers( 1483public ImmutableArray<ISymbol> LookupStaticMembers( 1509public ImmutableArray<ISymbol> LookupNamespacesAndTypes( 1531public new ImmutableArray<ISymbol> LookupLabels( 1558private ImmutableArray<ISymbol> LookupSymbolsInternal( 1585return ImmutableArray<ISymbol>.Empty; 1597return ImmutableArray<ISymbol>.Empty; 1636var results = ArrayBuilder<ISymbol>.GetInstance(info.Count); 1695private void AppendSymbolsWithName(ArrayBuilder<ISymbol> results, string name, Binder binder, NamespaceOrTypeSymbol container, LookupOptions options, LookupSymbolsInfo info) 1729ArrayBuilder<ISymbol> results, 2942public abstract ISymbol GetDeclaredSymbol(MemberDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)); 3024public abstract ISymbol GetDeclaredSymbol(BasePropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)); 3142public abstract ISymbol GetDeclaredSymbol(ArgumentSyntax declaratorSyntax, CancellationToken cancellationToken = default(CancellationToken)); 3167public abstract ISymbol GetDeclaredSymbol(VariableDeclaratorSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)); 3175public abstract ISymbol GetDeclaredSymbol(SingleVariableDesignationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)); 3229internal abstract ImmutableArray<ISymbol> GetDeclaredSymbols(BaseFieldDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)); 4102var symbols = ArrayBuilder<ISymbol>.GetInstance(); 4117private static ImmutableArray<IPropertySymbol> FilterOverriddenOrHiddenIndexers(ArrayBuilder<ISymbol> symbols) 4120foreach (ISymbol iSymbol in symbols) 4506var tupleElement = GetDeclaredSymbol(tupleArgument, cancellationToken); 4525var symbols = ArrayBuilder<ISymbol>.GetInstance(); 4527foreach (ISymbol invocationSym in containingInvocationInfo.CandidateSymbols) 4908public ISymbol GetEnclosingSymbol(int position) 4999private ImmutableArray<ISymbol> GetMemberGroupFromNode(SyntaxNode node, CancellationToken cancellationToken) 5013return ImmutableArray<ISymbol>.Empty; 5016protected sealed override ImmutableArray<ISymbol> GetMemberGroupCore(SyntaxNode node, CancellationToken cancellationToken) 5019return StaticCast<ISymbol>.From(methodGroup); 5077protected sealed override ISymbol GetDeclaredSymbolCore(SyntaxNode node, CancellationToken cancellationToken) 5153public ISymbol GetDeclaredSymbol(TupleElementSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 5165protected sealed override ImmutableArray<ISymbol> GetDeclaredSymbolsCore(SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)) 5184? ImmutableArray.Create<ISymbol>(namedType) 5185: ImmutableArray.Create<ISymbol>(namedType, primaryConstructor.GetPublicSymbol()); 5188var symbol = GetDeclaredSymbolCore(declaration, cancellationToken); 5191: ImmutableArray<ISymbol>.Empty; 5254internal override void ComputeDeclarationsInNode(SyntaxNode node, ISymbol associatedSymbol, bool getSymbol, ArrayBuilder<DeclarationInfo> builder, CancellationToken cancellationToken, int? levelsToCompute = null) 5259internal abstract override Func<SyntaxNode, bool> GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol); 5260internal abstract override bool ShouldSkipSyntaxNodeAnalysis(SyntaxNode node, ISymbol containingSymbol); 5262protected internal override SyntaxNode GetTopmostNodeForDiagnosticAnalysis(ISymbol symbol, SyntaxNode declaringSyntax) 5280protected sealed override ImmutableArray<ISymbol> LookupSymbolsCore(int position, INamespaceOrTypeSymbol container, string name, bool includeReducedExtensionMethods) 5285protected sealed override ImmutableArray<ISymbol> LookupBaseMembersCore(int position, string name) 5290protected sealed override ImmutableArray<ISymbol> LookupStaticMembersCore(int position, INamespaceOrTypeSymbol container, string name) 5295protected sealed override ImmutableArray<ISymbol> LookupNamespacesAndTypesCore(int position, INamespaceOrTypeSymbol container, string name) 5300protected sealed override ImmutableArray<ISymbol> LookupLabelsCore(int position, string name) 5401protected sealed override ISymbol GetEnclosingSymbolCore(int position, CancellationToken cancellationToken) 5430protected sealed override bool IsAccessibleCore(int position, ISymbol symbol)
Compilation\MemberSemanticModel.cs (9)
627public override ISymbol GetDeclaredSymbol(MemberDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 644public override ISymbol GetDeclaredSymbol(BasePropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 680public override ISymbol GetDeclaredSymbol(VariableDeclaratorSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 686public override ISymbol GetDeclaredSymbol(SingleVariableDesignationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 822internal override ImmutableArray<ISymbol> GetDeclaredSymbols(BaseFieldDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 825return ImmutableArray.Create<ISymbol>(); 1112public override ISymbol GetDeclaredSymbol(ArgumentSyntax declaratorSyntax, CancellationToken cancellationToken = default(CancellationToken)) 2361internal sealed override Func<SyntaxNode, bool> GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol) 2366internal sealed override bool ShouldSkipSyntaxNodeAnalysis(SyntaxNode node, ISymbol containingSymbol)
Compilation\SpeculativeSemanticModelWithMemberModel.cs (8)
285public override ISymbol GetDeclaredSymbol(MemberDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 300public override ISymbol GetDeclaredSymbol(BasePropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 330public override ISymbol GetDeclaredSymbol(VariableDeclaratorSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 335public override ISymbol GetDeclaredSymbol(SingleVariableDesignationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 370internal override ImmutableArray<ISymbol> GetDeclaredSymbols(BaseFieldDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 440public override ISymbol GetDeclaredSymbol(ArgumentSyntax declaratorSyntax, CancellationToken cancellationToken = default(CancellationToken)) 505internal sealed override Func<SyntaxNode, bool> GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol) 510internal override bool ShouldSkipSyntaxNodeAnalysis(SyntaxNode node, ISymbol containingSymbol)
Compilation\SymbolInfoFactory.cs (2)
52static ImmutableArray<ISymbol> getPublicSymbols(OneOrMany<Symbol> symbols) 54var result = ArrayBuilder<ISymbol>.GetInstance(symbols.Count);
Compilation\SyntaxTreeSemanticModel.cs (15)
238result = new SymbolInfo(ImmutableArray.Create<ISymbol>(info.Symbol), CandidateReason.NotATypeOrNamespace); 466public override ISymbol GetDeclaredSymbol(ArgumentSyntax declaratorSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1262var declaredSymbol = GetDeclaredSymbol(variableDecl); 1470public override ISymbol GetDeclaredSymbol(MemberDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1549public override ISymbol GetDeclaredSymbol(BasePropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1857public override ISymbol GetDeclaredSymbol(VariableDeclaratorSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1878public override ISymbol GetDeclaredSymbol(SingleVariableDesignationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1882ISymbol local = memberModel?.GetDeclaredSymbol(declarationSyntax, cancellationToken); 2012internal override ImmutableArray<ISymbol> GetDeclaredSymbols(BaseFieldDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 2016var builder = new ArrayBuilder<ISymbol>(); 2020var field = this.GetDeclaredSymbol(declarator, cancellationToken) as ISymbol; 2204ISymbol parameterizedSymbol = null; 2461internal override Func<SyntaxNode, bool> GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol) 2571internal override bool ShouldSkipSyntaxNodeAnalysis(SyntaxNode node, ISymbol containingSymbol)
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>
CSharpExtensions.cs (12)
940public static ImmutableArray<ISymbol> GetMemberGroup(this SemanticModel? semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken = default(CancellationToken)) 949return ImmutableArray.Create<ISymbol>(); 953public static ImmutableArray<ISymbol> GetMemberGroup(this SemanticModel? semanticModel, AttributeSyntax attribute, CancellationToken cancellationToken = default(CancellationToken)) 962return ImmutableArray.Create<ISymbol>(); 966public static ImmutableArray<ISymbol> GetMemberGroup(this SemanticModel? semanticModel, ConstructorInitializerSyntax initializer, CancellationToken cancellationToken = default(CancellationToken)) 975return ImmutableArray.Create<ISymbol>(); 1342public static ISymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, MemberDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1418public static ISymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, BasePropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1481public static ISymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, ArgumentSyntax declaratorSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1499public static ISymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, SingleVariableDesignationSyntax designationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1508public static ISymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, VariableDeclaratorSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1517public static ISymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, TupleElementSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken))
Emitter\EditAndContinue\CSharpDefinitionMap.cs (1)
40protected override ISymbolInternal? GetISymbolInternalOrNull(ISymbol symbol)
Emitter\EditAndContinue\CSharpSymbolChanges.cs (2)
14public CSharpSymbolChanges(DefinitionMap definitionMap, IEnumerable<SemanticEdit> edits, Func<ISymbol, bool> isAddedSymbol) 18protected override ISymbolInternal? GetISymbolInternalOrNull(ISymbol symbol)
Emitter\EditAndContinue\EmitHelpers.cs (1)
27Func<ISymbol, bool> isAddedSymbol,
Emitter\Model\ExpandedVarargsMethodReference.cs (1)
211Debug.Assert(!(value is ISymbol));
Errors\MessageProvider.cs (1)
98public override string GetErrorDisplayString(ISymbol symbol)
FlowAnalysis\CSharpDataFlowAnalysis.cs (37)
28private ImmutableArray<ISymbol> _variablesDeclared; 30private ImmutableArray<ISymbol> _dataFlowsIn; 31private ImmutableArray<ISymbol> _dataFlowsOut; 32private ImmutableArray<ISymbol> _definitelyAssignedOnEntry; 33private ImmutableArray<ISymbol> _definitelyAssignedOnExit; 34private ImmutableArray<ISymbol> _alwaysAssigned; 35private ImmutableArray<ISymbol> _readInside; 36private ImmutableArray<ISymbol> _writtenInside; 37private ImmutableArray<ISymbol> _readOutside; 38private ImmutableArray<ISymbol> _writtenOutside; 39private ImmutableArray<ISymbol> _captured; 41private ImmutableArray<ISymbol> _capturedInside; 42private ImmutableArray<ISymbol> _capturedOutside; 43private ImmutableArray<ISymbol> _unsafeAddressTaken; 57public override ImmutableArray<ISymbol> VariablesDeclared 68: ImmutableArray<ISymbol>.Empty; 95public override ImmutableArray<ISymbol> DataFlowsIn 102var result = _context.Failed ? ImmutableArray<ISymbol>.Empty : 115public override ImmutableArray<ISymbol> DefinitelyAssignedOnEntry 122public override ImmutableArray<ISymbol> DefinitelyAssignedOnExit 125private (ImmutableArray<ISymbol> onEntry, ImmutableArray<ISymbol> onExit) ComputeDefinitelyAssignedValues() 132var entryResult = ImmutableArray<ISymbol>.Empty; 133var exitResult = ImmutableArray<ISymbol>.Empty; 152public override ImmutableArray<ISymbol> DataFlowsOut 161: ImmutableArray<ISymbol>.Empty; 172public override ImmutableArray<ISymbol> AlwaysAssigned 180: ImmutableArray<ISymbol>.Empty; 191public override ImmutableArray<ISymbol> ReadInside 207public override ImmutableArray<ISymbol> WrittenInside 223public override ImmutableArray<ISymbol> ReadOutside 239public override ImmutableArray<ISymbol> WrittenOutside 285public override ImmutableArray<ISymbol> Captured 298public override ImmutableArray<ISymbol> CapturedInside 311public override ImmutableArray<ISymbol> CapturedOutside 331public override ImmutableArray<ISymbol> UnsafeAddressTaken 390private static ImmutableArray<ISymbol> Normalize(IEnumerable<Symbol> data)
FlowAnalysis\DataFlowsOutWalker.cs (4)
25private readonly ImmutableArray<ISymbol> _dataFlowsIn; 27private DataFlowsOutWalker(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion, HashSet<Symbol> unassignedVariables, ImmutableArray<ISymbol> dataFlowsIn) 33internal static HashSet<Symbol> Analyze(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion, HashSet<Symbol> unassignedVariables, ImmutableArray<ISymbol> dataFlowsIn) 78foreach (ISymbol variable in _dataFlowsIn)
Operations\CSharpOperationFactory.cs (2)
1649var indexerSymbol = Binder.GetIndexerOrImplicitIndexerSymbol(boundIndexerAccess).GetPublicSymbol(); 2538ISymbol? variable = boundDeclarationPattern.Variable.GetPublicSymbol();
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (2)
36ISymbol associatedSymbol, 58ISymbol associatedSymbol,
SymbolDisplay\SymbolDisplay.cs (7)
31ISymbol symbol, 60ISymbol symbol, 92ISymbol symbol, 136ISymbol symbol, 183ISymbol symbol, 229ISymbol symbol, 244ISymbol symbol,
SymbolDisplay\SymbolDisplayVisitor.cs (6)
94internal SymbolDisplayPart CreatePart(SymbolDisplayPartKind kind, ISymbol? symbol, string text) 366private void AddAccessibilityIfNeeded(ISymbol symbol) 381private static bool IsLocalFunction(ISymbol symbol) 391private void AddAccessibility(ISymbol symbol) 424private bool ShouldVisitNamespace(ISymbol containingSymbol) 462private static bool IsEnumMember(ISymbol symbol)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (2)
927private void AddMemberModifiersIfNeeded(ISymbol symbol) 1052private void AddExplicitInterfaceIfNeeded<T>(ImmutableArray<T> implementedMembers) where T : ISymbol
SymbolDisplay\SymbolDisplayVisitor.Types.cs (2)
275var containingSymbol = symbol.ContainingSymbol; 817private void AddTypeArguments(ISymbol owner, ImmutableArray<ImmutableArray<CustomModifier>> modifiers)
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (1)
80var firstSymbol = symbols.OfType<ISymbol>().FirstOrDefault();
Symbols\AliasSymbol.cs (1)
270protected override ISymbol CreateISymbol()
Symbols\ArrayTypeSymbol.cs (1)
474protected sealed override ISymbol CreateISymbol()
Symbols\AssemblySymbol.cs (1)
1081protected override ISymbol CreateISymbol()
Symbols\DiscardSymbol.cs (1)
41protected override ISymbol CreateISymbol()
Symbols\DynamicTypeSymbol.cs (1)
239protected override ISymbol CreateISymbol()
Symbols\ErrorTypeSymbol.cs (1)
554protected sealed override ISymbol CreateISymbol()
Symbols\EventSymbol.cs (1)
327protected sealed override ISymbol CreateISymbol()
Symbols\FieldSymbol.cs (1)
508protected override ISymbol CreateISymbol()
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (1)
120protected override ISymbol CreateISymbol()
Symbols\FunctionTypeSymbol.cs (1)
146protected override ISymbol CreateISymbol() => throw ExceptionUtilities.Unreachable();
Symbols\LabelSymbol.cs (1)
172protected sealed override ISymbol CreateISymbol()
Symbols\LocalSymbol.cs (1)
385protected sealed override ISymbol CreateISymbol()
Symbols\MethodSymbol.cs (1)
1243protected sealed override ISymbol CreateISymbol()
Symbols\ModuleSymbol.cs (1)
407protected override ISymbol CreateISymbol()
Symbols\NamedTypeSymbol.cs (1)
1705protected override ISymbol CreateISymbol()
Symbols\NamespaceSymbol.cs (1)
383protected sealed override ISymbol CreateISymbol()
Symbols\ParameterSymbol.cs (1)
449protected override ISymbol CreateISymbol()
Symbols\PointerTypeSymbol.cs (1)
301protected override ISymbol CreateISymbol()
Symbols\PropertySymbol.cs (1)
446protected sealed override ISymbol CreateISymbol()
Symbols\PublicModel\ErrorTypeSymbol.cs (1)
34ImmutableArray<ISymbol> IErrorTypeSymbol.CandidateSymbols => _underlying.CandidateSymbols.SelectAsArray(s => s.GetPublicSymbol());
Symbols\PublicModel\FieldSymbol.cs (1)
26ISymbol IFieldSymbol.AssociatedSymbol
Symbols\PublicModel\MethodSymbol.cs (1)
218ISymbol IMethodSymbol.AssociatedSymbol
Symbols\PublicModel\NamedTypeSymbol.cs (1)
146ISymbol INamedTypeSymbol.AssociatedSymbol
Symbols\PublicModel\NamespaceOrTypeSymbol.cs (2)
13ImmutableArray<ISymbol> INamespaceOrTypeSymbol.GetMembers() 18ImmutableArray<ISymbol> INamespaceOrTypeSymbol.GetMembers(string name)
Symbols\PublicModel\PreprocessingSymbol.cs (40)
21ISymbol ISymbol.OriginalDefinition => this; 23ISymbol? ISymbol.ContainingSymbol => null; 25INamedTypeSymbol? ISymbol.ContainingType => null; 50bool IEquatable<ISymbol?>.Equals(ISymbol? other) 55bool ISymbol.Equals(ISymbol? other, CodeAnalysis.SymbolEqualityComparer equalityComparer) 60ImmutableArray<Location> ISymbol.Locations => ImmutableArray<Location>.Empty; 62ImmutableArray<SyntaxReference> ISymbol.DeclaringSyntaxReferences => ImmutableArray<SyntaxReference>.Empty; 64ImmutableArray<AttributeData> ISymbol.GetAttributes() => ImmutableArray<AttributeData>.Empty; 66Accessibility ISymbol.DeclaredAccessibility => Accessibility.NotApplicable; 68void ISymbol.Accept(SymbolVisitor visitor) => visitor.VisitPreprocessing(this); 70TResult ISymbol.Accept<TResult>(SymbolVisitor<TResult> visitor) => visitor.VisitPreprocessing(this)!; 72TResult ISymbol.Accept<TArgument, TResult>(SymbolVisitor<TArgument, TResult> visitor, TArgument argument) => visitor.VisitPreprocessing(this, argument); 74string? ISymbol.GetDocumentationCommentId() => null; 76string? ISymbol.GetDocumentationCommentXml(CultureInfo? preferredCulture, bool expandIncludes, CancellationToken cancellationToken) => null; 78string ISymbol.ToDisplayString(SymbolDisplayFormat? format) 83ImmutableArray<SymbolDisplayPart> ISymbol.ToDisplayParts(SymbolDisplayFormat? format) 88string ISymbol.ToMinimalDisplayString(SemanticModel semanticModel, int position, SymbolDisplayFormat? format) 93ImmutableArray<SymbolDisplayPart> ISymbol.ToMinimalDisplayParts(SemanticModel semanticModel, int position, SymbolDisplayFormat? format) 98SymbolKind ISymbol.Kind => SymbolKind.Preprocessing; 100string ISymbol.Language => LanguageNames.CSharp; 102string ISymbol.Name => _name; 104string ISymbol.MetadataName => _name; 106int ISymbol.MetadataToken => 0; 108IAssemblySymbol? ISymbol.ContainingAssembly => null; 110IModuleSymbol? ISymbol.ContainingModule => null; 112INamespaceSymbol? ISymbol.ContainingNamespace => null; 114bool ISymbol.IsDefinition => true; 116bool ISymbol.IsStatic => false; 118bool ISymbol.IsVirtual => false; 120bool ISymbol.IsOverride => false; 122bool ISymbol.IsAbstract => false; 124bool ISymbol.IsSealed => false; 126bool ISymbol.IsExtern => false; 128bool ISymbol.IsImplicitlyDeclared => false; 130bool ISymbol.CanBeReferencedByName => SyntaxFacts.IsValidIdentifier(_name) && !SyntaxFacts.ContainsDroppedIdentifierCharacters(_name); 132bool ISymbol.HasUnsupportedMetadata => false;
Symbols\PublicModel\Symbol.cs (40)
55ISymbol ISymbol.OriginalDefinition 63ISymbol ISymbol.ContainingSymbol 71INamedTypeSymbol ISymbol.ContainingType 89bool IEquatable<ISymbol>.Equals(ISymbol other) 94bool ISymbol.Equals(ISymbol other, CodeAnalysis.SymbolEqualityComparer equalityComparer) 104ImmutableArray<Location> ISymbol.Locations 112ImmutableArray<SyntaxReference> ISymbol.DeclaringSyntaxReferences 120ImmutableArray<AttributeData> ISymbol.GetAttributes() 125Accessibility ISymbol.DeclaredAccessibility 133void ISymbol.Accept(SymbolVisitor visitor) 140TResult ISymbol.Accept<TResult>(SymbolVisitor<TResult> visitor) 147TResult ISymbol.Accept<TArgument, TResult>(SymbolVisitor<TArgument, TResult> visitor, TArgument argument) 154string ISymbol.GetDocumentationCommentId() 159string ISymbol.GetDocumentationCommentXml(CultureInfo preferredCulture, bool expandIncludes, CancellationToken cancellationToken) 164string ISymbol.ToDisplayString(SymbolDisplayFormat format) 169ImmutableArray<SymbolDisplayPart> ISymbol.ToDisplayParts(SymbolDisplayFormat format) 174string ISymbol.ToMinimalDisplayString(SemanticModel semanticModel, int position, SymbolDisplayFormat format) 179ImmutableArray<SymbolDisplayPart> ISymbol.ToMinimalDisplayParts(SemanticModel semanticModel, int position, SymbolDisplayFormat format) 195SymbolKind ISymbol.Kind => UnderlyingSymbol.Kind; 197string ISymbol.Language => LanguageNames.CSharp; 199string ISymbol.Name => UnderlyingSymbol.Name; 201string ISymbol.MetadataName => UnderlyingSymbol.MetadataName; 203int ISymbol.MetadataToken => UnderlyingSymbol.MetadataToken; 205IAssemblySymbol ISymbol.ContainingAssembly => UnderlyingSymbol.ContainingAssembly.GetPublicSymbol(); 207IModuleSymbol ISymbol.ContainingModule => UnderlyingSymbol.ContainingModule.GetPublicSymbol(); 209INamespaceSymbol ISymbol.ContainingNamespace => UnderlyingSymbol.ContainingNamespace.GetPublicSymbol(); 211bool ISymbol.IsDefinition => UnderlyingSymbol.IsDefinition; 213bool ISymbol.IsStatic 218bool ISymbol.IsVirtual 223bool ISymbol.IsOverride 228bool ISymbol.IsAbstract 236bool ISymbol.IsSealed 244bool ISymbol.IsExtern => UnderlyingSymbol.IsExtern; 246bool ISymbol.IsImplicitlyDeclared => UnderlyingSymbol.IsImplicitlyDeclared; 248bool ISymbol.CanBeReferencedByName => UnderlyingSymbol.CanBeReferencedByName; 250bool ISymbol.HasUnsupportedMetadata => UnderlyingSymbol.HasUnsupportedMetadata;
Symbols\PublicModel\TypeSymbol.cs (6)
46bool ISymbol.IsDefinition 50return (object)this == ((ISymbol)this).OriginalDefinition; 54bool ISymbol.Equals(ISymbol other, CodeAnalysis.SymbolEqualityComparer equalityComparer) 115ISymbol ITypeSymbol.FindImplementationForInterfaceMember(ISymbol interfaceMember)
Symbols\RangeVariableSymbol.cs (1)
182protected override ISymbol CreateISymbol()
Symbols\Source\SourceAssemblySymbol.cs (1)
2944protected override ISymbol CreateISymbol()
Symbols\Symbol.cs (4)
33private ISymbol _lazyISymbol; 330ISymbol ISymbolInternal.GetISymbol() => this.ISymbol; 1811protected abstract ISymbol CreateISymbol(); 1813internal ISymbol ISymbol
Symbols\SymbolExtensions.cs (18)
371internal static Symbol? EnsureCSharpSymbolOrNull(this ISymbol? symbol, string paramName) 391return (AssemblySymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 397return (NamespaceOrTypeSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 403return (NamespaceSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 409return (TypeSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 415return (NamedTypeSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 421return (TypeParameterSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 427return (EventSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 544where TISymbol : class, ISymbol 550internal static ISymbol? GetPublicSymbol(this Symbol? symbol) 552return symbol.GetPublicSymbol<ISymbol>(); 675internal static IEnumerable<ISymbol?> GetPublicSymbols(this IEnumerable<Symbol?> symbols) 677return symbols.Select(p => p.GetPublicSymbol<ISymbol>()); 681where TISymbol : class, ISymbol 691internal static ImmutableArray<ISymbol> GetPublicSymbols(this ImmutableArray<Symbol> symbols) 693return GetPublicSymbols<ISymbol>(symbols); 752internal static TSymbol? GetSymbol<TSymbol>(this ISymbol? symbol) 759internal static Symbol? GetSymbol(this ISymbol? symbol)
Symbols\TypedConstantExtensions.cs (2)
83foreach (var member in members) 162foreach (var member in members)
Symbols\TypeParameterSymbol.cs (1)
704protected sealed override ISymbol CreateISymbol()
Microsoft.CodeAnalysis.CSharp.CodeStyle (90)
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (2)
82private (VariableDeclaratorSyntax, ISymbol)? TryGetVariableDeclaratorAndSymbol(SemanticModel semanticModel) 89var symbol = semanticModel.GetSymbolInfo(_assignmentTargetOpt).Symbol;
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (2)
329ISymbol outSymbol, 364var symbol = semanticModel.GetSymbolInfo(identifierName, cancellationToken).Symbol;
src\Analyzers\CSharp\Analyzers\MakeLocalFunctionStatic\MakeLocalFunctionStaticHelper.cs (2)
30static bool IsChildOrSelf(LocalFunctionStatementSyntax containingLocalFunction, ISymbol calledLocationFunction) 43public static bool CanMakeLocalFunctionStaticByRefactoringCaptures(LocalFunctionStatementSyntax localFunction, SemanticModel semanticModel, out ImmutableArray<ISymbol> captures)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
80foreach (var member in structType.GetMembers())
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
101foreach (var member in typeSymbol.GetMembers())
src\Analyzers\CSharp\Analyzers\NamingStyle\CSharpNamingStyleDiagnosticAnalyzer.cs (1)
28protected override bool ShouldIgnore(ISymbol symbol)
src\Analyzers\CSharp\Analyzers\QualifyMemberAccess\CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (2)
30protected override bool CanMemberAccessBeQualified(ISymbol containingSymbol, SyntaxNode node) 53private static bool IsInPropertyOrFieldInitialization(ISymbol containingSymbol, SyntaxNode node)
src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastDiagnosticAnalyzer.cs (2)
208var castOrSelectSymbol = semanticModel.GetSymbolInfo(invocationExpression, cancellationToken).Symbol; 209var whereSymbol = semanticModel.GetSymbolInfo(whereInvocation, cancellationToken).Symbol;
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (2)
133foreach (var symbol in symbolInfo.CandidateSymbols) 138ISymbol? symbol,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (1)
125var createSymbol = semanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
389var member = state.SemanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
54var symbol = semanticModel.GetSymbolInfo(objectCreationExpression, cancellationToken).Symbol;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (9)
474var symbol = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol; 485var methodOrProperty = semanticModel.GetSymbolInfo(elementAccess, cancellationToken).Symbol; 509var leftSymbol = semanticModel.GetSymbolInfo(assignment.Left, cancellationToken).Symbol; 557var symbol = semanticModel.GetSymbolInfo(identifier, cancellationToken).Symbol; 795var localSymbol = semanticModel.GetRequiredDeclaredSymbol(variableDeclarator, cancellationToken); 1109var expressionSymbol = semanticModel.GetSymbolInfo(memberAccess.Expression, cancellationToken).Symbol; 1113var emptySymbol = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol; 1141var expressionSymbol = semanticModel.GetSymbolInfo(memberAccess.Expression, cancellationToken).Symbol; 1145var emptySymbol = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol;
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
184var symbol = semanticModel.GetSymbolInfo(binaryExpression, cancellationToken).Symbol; 201var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
287private static HashSet<ISymbol> GetExistingSymbols(
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (1)
36public static bool IsPublicInstance(ISymbol symbol)
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (3)
110var local = semanticModel.GetDeclaredSymbol(localDeclaration.Declaration.Variables[0], cancellationToken); 237SemanticModel semanticModel, INamedTypeSymbol? expressionTypeOpt, ISymbol local, BlockSyntax block, 401var localEnclosingSymbol = semanticModel.GetEnclosingSymbol(localDeclaration.SpanStart, cancellationToken);
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
165var asOperand = semanticModel.GetSymbolInfo(asExpression.Left, cancellationToken).Symbol;
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (13)
64private static readonly ObjectPool<ConcurrentSet<ISymbol>> s_concurrentSetPool = new(() => []); 86[NotNullWhen(true)] ISymbol? member, 144PooledDictionary<ISymbol, IParameterSymbol> candidateMembersToRemove, 153private readonly PooledDictionary<ISymbol, IParameterSymbol> _candidateMembersToRemove = candidateMembersToRemove; 160private readonly ConcurrentSet<ISymbol> _membersThatCannotBeRemoved = s_concurrentSetPool.Allocate(); 323var candidateMembersToRemove = PooledDictionary<ISymbol, IParameterSymbol>.GetInstance(); 387Dictionary<ISymbol, IParameterSymbol> candidateMembersToRemove) 409Dictionary<ISymbol, IParameterSymbol> candidateMembersToRemove) 415using var _1 = PooledHashSet<ISymbol>.GetInstance(out var assignedMembers); 422namedType, semanticModel, assignmentExpression, candidateMembersToRemove, orderedParameterAssignments, out var member)) 466Dictionary<ISymbol, IParameterSymbol> candidateMembersToRemove, 468[NotNullWhen(true)] out ISymbol? member) 555var member = operation.Member.OriginalDefinition;
src\Analyzers\CSharp\Analyzers\UseSimpleUsingStatement\UseSimpleUsingStatementDiagnosticAnalyzer.cs (2)
138using var _ = PooledDictionary<string, ArrayBuilder<ISymbol>>.GetInstance(out var symbolNameToExistingSymbol); 169private static bool DeclaredLocalCausesCollision(Dictionary<string, ArrayBuilder<ISymbol>> symbolNameToExistingSymbol, ImmutableArray<ILocalSymbol> locals)
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
88foreach (var member in namedType.GetMembers())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (3)
369var symbol = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol; 436private static bool CanReplace(ISymbol symbol) 977var symbol = semanticModel.GetSymbolInfo(current, cancellationToken).Symbol ?? semanticModel.GetDeclaredSymbol(current, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
328var exprSymbol = semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (6)
39public static ImmutableArray<ISymbol> LookupName( 102public static ImmutableArray<ISymbol> LookupName( 288var symbol = semanticModel.GetDeclaredSymbol(type.Parent.Parent.Parent, cancellationToken); 300var symbol = semanticModel.GetDeclaredSymbol(variableDeclaration.Variables[0], cancellationToken); 496public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, VariableDeclaratorSyntax syntax, CancellationToken cancellationToken) 502public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SingleVariableDesignationSyntax syntax, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (10)
58public ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 245public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 262public ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 265public ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 270public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken) 277AssignmentExpressionSyntax _ when token.Kind() == SyntaxKind.EqualsToken => GetDeconstructionAssignmentMethods(semanticModel, node).As<ISymbol>(), 278ForEachVariableStatementSyntax _ when token.Kind() == SyntaxKind.InKeyword => GetDeconstructionForEachMethods(semanticModel, node).As<ISymbol>(), 283static ImmutableArray<ISymbol> GetCallingConventionSymbols(SemanticModel model, FunctionPointerUnmanagedCallingConventionSyntax syntax) 296private ImmutableArray<ISymbol> GetSymbolInfo(SemanticModel semanticModel, SyntaxNode node, SyntaxToken token, CancellationToken cancellationToken) 371public ImmutableArray<IMethodSymbol> GetLocalFunctionSymbols(Compilation compilation, ISymbol symbol, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (14)
995foreach (var sym in type.GetMembers(opName)) 1134var symbol = semanticModel.GetDeclaredSymbol(variableDeclarator, cancellationToken); 1236var oldSymbolInfo = originalSemanticModel.GetSymbolInfo(currentOld, cancellationToken).Symbol; 1237var newSymbolInfo = rewrittenSemanticModel.GetSymbolInfo(currentNew, cancellationToken).Symbol; 1289var originalMemberSymbol = originalSemanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol; 1294var rewrittenMemberSymbol = rewrittenSemanticModel.GetSymbolInfo(rewrittenMemberAccessExpression, cancellationToken).Symbol; 1360var implementationMember = rewrittenContainingType.FindImplementationForInterfaceMember(originalMemberSymbol); 1374for (var current = rewrittenMemberSymbol; current != null; current = current.GetOverriddenMember()) 1398var originalMemberSymbol = originalSemanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol; 1403var rewrittenMemberSymbol = rewrittenSemanticModel.GetSymbolInfo(rewrittenMemberAccessExpression, cancellationToken).Symbol; 1410private static bool IsComplementaryDelegateInvoke(ISymbol originalMemberSymbol, ISymbol rewrittenMemberSymbol) 1473ISymbol originalMemberSymbol, ISymbol rewrittenMemberSymbol, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (4)
567var originalSymbol = this.OriginalSemanticModel.GetSymbolInfo(ctorInitializer, CancellationToken).Symbol; 568var newSymbol = this.SpeculativeSemanticModel.GetSymbolInfo(newCtorInitializer, CancellationToken).Symbol; 574var originalSymbol = this.OriginalSemanticModel.GetCollectionInitializerSymbolInfo(originalInitializer, CancellationToken).Symbol; 575var newSymbol = this.SpeculativeSemanticModel.GetCollectionInitializerSymbolInfo(newInitializer, CancellationToken).Symbol;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
106var conflict = semanticModel.GetSpeculativeSymbolInfo(typeName.SpanStart, candidateReplacementNode, SpeculativeBindingOption.BindAsTypeOrNamespace).Symbol;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (72)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (26)
314var positionalParam = param.ContainingSymbol.ContainingType.GetMembers().FirstOrDefault(member 378var dictionaryBuilder = ImmutableDictionary<ISymbol, ExpressionSyntax>.Empty.ToBuilder(); 403ImmutableDictionary<ISymbol, ExpressionSyntax> assignmentValues) 419private static ImmutableDictionary<ISymbol, T> GetAssignmentValuesForConstructor<T>( 424var dictionaryBuilder = ImmutableDictionary<ISymbol, T>.Empty.ToBuilder(); 430return ImmutableDictionary<ISymbol, T>.Empty; 445ISymbol? symbol = assignee switch 461return ImmutableDictionary<ISymbol, T>.Empty; 506ISymbol? otherC = null; 532value, successRequirement: true, type, fields, out var _2)) 569[NotNullWhen(true)] out ISymbol? assignedVariable) 609private static ISymbol? GetReferencedSymbolObject(IOperation reference) 657ISymbol otherObject) 726ISymbol currentObject, 727ISymbol otherObject, 785ISymbol currentObject, 787[NotNullWhen(true)] out ISymbol? boundVariable, 833bool TryGetBoundVariableForIsPattern(IPatternOperation isPattern, [NotNullWhen(true)] out ISymbol? boundVariable) 854DeclaredSymbol: ISymbol otherVar, 880ISymbol otherC, 918ISymbol currentObject, 919ISymbol otherObject, 922var leftObject = GetReferencedSymbolObject(memberReference1.Instance!); 923var rightObject = GetReferencedSymbolObject(memberReference2.Instance!); 960[NotNullWhen(true)] out ISymbol? otherC, 1124private static IFieldSymbol? UnwrapPropertyToField(ISymbol propertyOrField)
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
53[NotNullWhen(true)] out ISymbol? matchingMember,
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (1)
50protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (1)
35protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateMethodService.cs (1)
43protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
336var previousSymbol = semanticModel.GetSymbolInfo(nodeToReplace, cancellationToken).Symbol;
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
107var symbol = model.GetEnclosingSymbol(node.Span.Start, cancellationToken);
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (4)
29ImmutableArray<ISymbol> captures, 41ImmutableArray<ISymbol> captures, 206private static ImmutableArray<(IParameterSymbol symbol, ISymbol capture)> CreateParameterSymbols(ImmutableArray<ISymbol> captures)
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (1)
65Func<Document, LocalFunctionStatementSyntax, ImmutableArray<ISymbol>, Task> fixer,
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (2)
172var symbol = model.GetSymbolInfo(assignment.Left, cancellationToken).Symbol; 214var symbol = model.GetSymbolInfo(invocation.Expression, cancellationToken).Symbol;
src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (1)
45foreach (var symbol in memberGroup)
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
135var localSymbol = semanticModel.GetDeclaredSymbol(
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (2)
69ImmutableDictionary<ISymbol, (MemberDeclarationSyntax memberNode, SyntaxNode nodeToRemove)> removedMembers) 167ImmutableDictionary<ISymbol, (MemberDeclarationSyntax memberNode, SyntaxNode nodeToRemove)> removedMembers,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (4)
210IEnumerable<ISymbol> implementations) 212var implementation = implementations.FirstOrDefault(); 248ISymbol symbol, 269public static T? GetReuseableSyntaxNodeForSymbol<T>(ISymbol symbol, CSharpCodeGenerationContextInfo info) where T : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
196var members = new List<ISymbol>(); 907public override TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CSharpCodeGenerationContextInfo info, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (2)
104ImmutableArray<ISymbol> members, 141IList<ISymbol> newMembers,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamespaceGenerator.cs (2)
88IList<ISymbol> newMembers, 150private static UsingDirectiveSyntax? GenerateUsingDirective(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (2)
55var symbol = model.GetSymbolInfo(fullName).Symbol; 118foreach (var member in type.GetMembers())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2015var enclosingSymbol = semanticModel.GetEnclosingSymbol(position, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
113public static async Task<ISymbol?> FindApplicableAliasAsync(this ITypeSymbol type, int position, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (3)
29public override ExpressionSyntax DefaultVisit(ISymbol symbol) 32private static TExpressionSyntax AddInformationTo<TExpressionSyntax>(TExpressionSyntax syntax, ISymbol symbol) 108ISymbol symbol, ExpressionSyntax container, SimpleNameSyntax syntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (2)
35public override TypeSyntax DefaultVisit(ISymbol node) 38private static TTypeSyntax AddInformationTo<TTypeSyntax>(TTypeSyntax syntax, ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSemanticFactsService.cs (1)
36protected override IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode container, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSymbolDeclarationService.cs (1)
22public ImmutableArray<SyntaxReference> GetDeclarations(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (4)
1987var memberSymbol = GetDeclaredMemberSymbolFromOriginalSemanticModel(declaration); 2041var symbol = GetDeclaredMemberSymbolFromOriginalSemanticModel(declaration); 2050private ISymbol GetDeclaredMemberSymbolFromOriginalSemanticModel(SyntaxNode declarationInCurrentTree) 2206private ImmutableArray<TypeInferenceInfo> InferTypeBasedOnLaterUsage(ISymbol symbol, SyntaxNode afterNode)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\CSharpInitializeParameterService.cs (2)
43ISymbol fieldOrProperty, 109protected override Task<Solution> TryAddAssignmentForPrimaryConstructorAsync(Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (2)
36ISymbol fieldOrProperty, 98ISymbol fieldOrProperty,
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
321var symbol = symbolInfo.Symbol;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (61)
Diagnostics\FixAllProvider\BatchFixerTests.cs (1)
51var symbol = context.SemanticModel.GetSymbolInfo(node).Symbol;
OnTheFlyDocs\OnTheFlyDocsUtilitiesTests.cs (3)
43var methodSymbol = semanticModel!.GetDeclaredSymbol(methodDeclaration); 79var methodSymbol = semanticModel!.GetDeclaredSymbol(methodDeclaration); 125var methodSymbol = semanticModel!.GetSymbolInfo(methodInvocation).Symbol;
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (9)
40Func<Compilation, ISymbol> symbolMatcher, 80Func<Compilation, ISymbol> symbolMatcher, 102ISymbol symbol, 122ISymbol symbol, 187protected static Task<(Project, ISymbol)> CompileAndFindSymbolAsync( 192Func<Compilation, ISymbol> symbolMatcher, 202protected static async Task<(Project, ISymbol)> CompileAndFindSymbolAsync( 207Func<Compilation, ISymbol> symbolMatcher, 231var symbol = symbolMatcher(mainCompilation);
PdbSourceDocument\NullResultMetadataAsSourceFileProvider.cs (1)
40public Task<MetadataAsSourceFile?> GetGeneratedFileAsync(MetadataAsSourceWorkspace metadataWorkspace, Workspace sourceWorkspace, Project sourceProject, ISymbol symbol, bool signaturesOnly, MetadataAsSourceOptions options, string tempPath, TelemetryMessage? telemetry, CancellationToken cancellationToken)
SymbolKey\SymbolKeyCompilationsTests.cs (7)
651ISymbol sym1 = comp1.Assembly; 652ISymbol sym2 = comp2.Assembly; 680ISymbol assembly1 = compilation1.Assembly; 681ISymbol assembly2 = compilation2.Assembly; 724ISymbol sym1 = comp1.Assembly; 725ISymbol sym2 = comp2.Assembly; 729var resolved = ResolveSymbol(sym2, comp1, SymbolKeyComparison.None);
SymbolKey\SymbolKeyErrorTypeTests.cs (2)
371private static void VerifyResolution(string source, Func<Compilation, ISymbol> symbolToResolve) 374var symbol = symbolToResolve(sourceCompilation);
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (1)
262foreach (var local in df.VariablesDeclared)
SymbolKey\SymbolKeyTestBase.cs (27)
41internal static void ResolveAndVerifySymbolList(IEnumerable<ISymbol> newSymbols, IEnumerable<ISymbol> originalSymbols, CSharpCompilation originalComp) 60internal static void ResolveAndVerifySymbol(ExpressionSyntax node, ISymbol sourceSymbol, SemanticModel model, CSharpCompilation sourceComp, SymbolKeyComparison comparison = SymbolKeyComparison.None) 66internal static void ResolveAndVerifySymbol(ISymbol symbol1, ISymbol symbol2, Compilation compilation2, SymbolKeyComparison comparison = SymbolKeyComparison.None) 71var resolvedSymbol = ResolveSymbol(symbol1, compilation2, comparison); 80internal static ISymbol ResolveSymbol(ISymbol originalSymbol, Compilation targetCompilation, SymbolKeyComparison comparison) 94internal static void AssertSymbolKeysEqual(ISymbol symbol1, ISymbol symbol2, SymbolKeyComparison comparison, bool expectEqual = true) 149internal static IEnumerable<ISymbol> GetSourceSymbols(Microsoft.CodeAnalysis.CSharp.CSharpCompilation compilation, SymbolCategory category) 198internal static IList<ISymbol> GetSourceSymbols(CSharpCompilation compilation, bool includeLocal) 200var list = new List<ISymbol>(); 218private static void GetSourceMemberSymbols(INamespaceOrTypeSymbol symbol, List<ISymbol> list, LocalSymbolDumper localDumper) 220foreach (var memberSymbol in symbol.GetMembers()) 248private static void GetSourceAliasSymbols(CSharpCompilation comp, List<ISymbol> list) 259var sym = model.GetDeclaredSymbol(u); 277public void GetLocalSymbols(FieldSymbol symbol, List<ISymbol> list) 294public void GetLocalSymbols(MethodSymbol symbol, List<ISymbol> list) 336private static void GetLocalAndType(DataFlowAnalysis df, List<ISymbol> list) 338foreach (var v in df.VariablesDeclared) 348private static void GetLabelSymbols(BlockSyntax body, SemanticModel model, List<ISymbol> list) 354var sym = model.GetDeclaredSymbol(n); 365var sym = model.GetDeclaredSymbol(n); 370private static void GetAnonymousTypeOrFuncSymbols(BlockSyntax body, SemanticModel model, List<ISymbol> list) 387private static void GetAnonymousExprSymbols(ExpressionSyntax expr, SemanticModel model, List<ISymbol> list) 413foreach (var m in tinfo.Type.GetMembers())
SymbolKey\SymbolKeyTests.cs (10)
50var resolved = symbolKey.Resolve(compilation).Symbol; 89var resolved = symbolKey.Resolve(compilation).Symbol; 122var type = compilation.GlobalNamespace.GetMembers("C").Single().GetMembers("Inner").Single(); 125var resolved = symbolKey.Resolve(compilation).Symbol; 175var resolved = symbolKey.Resolve(compilation).Symbol; 272async Task<(ISymbol bodyLocalSymbol, ISymbol referenceAssemblySymbol)> GetSymbolsAsync(Compilation bodyCompilation, Compilation referenceCompilation) 275ISymbol bodyLocalSymbol, referenceAssemblySymbol; 304(ProjectId bodyLocalProjectId, ProjectId referenceAssemblyProjectId) GetOriginatingProjectIds(Solution solution, ISymbol bodyLocalSymbol, ISymbol referenceAssemblySymbol)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (61)
CodeGen\CodeGenDeconstructTests.cs (41)
3579var symbol = model.GetDeclaredSymbol(decl); 4135var symbol = model.GetDeclaredSymbol(x1); 4407var symbol = model.GetSymbolInfo(collection).Symbol; 5022var xSymbol = model.GetDeclaredSymbol(x); 5028var ySymbol = model.GetDeclaredSymbol(y); 5174var x1Symbol = model.GetDeclaredSymbol(x1); 5180var x2Symbol = model.GetDeclaredSymbol(x2); 5311var x1Symbol = model.GetDeclaredSymbol(x1); 5316var x2Symbol = model.GetDeclaredSymbol(x2); 5347var x1Symbol = model.GetDeclaredSymbol(x1); 5352var x2Symbol = model.GetDeclaredSymbol(x2); 5402var xSymbol = model.GetDeclaredSymbol(x); 5409var ySymbol = model.GetDeclaredSymbol(y); 5435var xSymbol = model.GetDeclaredSymbol(x); 5442var ySymbol = model.GetDeclaredSymbol(y); 5473var firstX1Symbol = model.GetDeclaredSymbol(firstX1); 5478var secondX1Symbol = model.GetDeclaredSymbol(secondX1); 5505var firstYSymbol = model.GetDeclaredSymbol(firstY); 5510var secondYSymbol = model.GetDeclaredSymbol(secondY); 5536var firstXSymbol = model.GetDeclaredSymbol(firstX); 5541var secondXSymbol = model.GetDeclaredSymbol(secondX); 5565var xSymbol = model.GetDeclaredSymbol(x); 5605var xSymbol = model.GetDeclaredSymbol(x); 5615var ySymbol = model.GetDeclaredSymbol(y); 5644var x1Symbol = model.GetDeclaredSymbol(x1); 5653var x2Symbol = model.GetDeclaredSymbol(x2); 5688var x1Symbol = model.GetDeclaredSymbol(x1); 5697var x2Symbol = model.GetDeclaredSymbol(x2); 5727var x1Symbol = model.GetDeclaredSymbol(x1); 5733var x3Symbol = model.GetDeclaredSymbol(x3); 5769var x1Symbol = model.GetDeclaredSymbol(x1); 5775var x3Symbol = model.GetDeclaredSymbol(x3); 5805var x1Symbol = model.GetDeclaredSymbol(x1); 5811var x3Symbol = model.GetDeclaredSymbol(x3); 5855var x1Symbol = model.GetDeclaredSymbol(x1); 5862var x3Symbol = model.GetDeclaredSymbol(x3); 6004var isymbol = (ISymbol)symbol; 6035var set = new HashSet<ISymbol>(); 6088var set = new HashSet<ISymbol>(); 6136var set = new HashSet<ISymbol>();
CodeGen\CodeGenTupleTest.cs (20)
4025var resultSymbol = model.GetDeclaredSymbol(result); 4492var stringItem1 = vt2.GetMembers("Item1")[0]; 4496var intItem2 = vt2.GetMembers("Item2")[0]; 19231var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(1).First()); 19234var x2 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(5).First()); 19293var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(2)); 19296var x2 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(3)); 19299var x3 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(4)); 19302var x4 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(5)); 19305var x5 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(6)); 19308var x6 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(7)); 19311var x7 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(8)); 19314var x8 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(9)); 19317var x9 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(10)); 19320var x6double = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(11)); 19396var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(1).First()); 19399var x2 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(2).First()); 19426var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(1).First()); 19480var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().First()); 19538var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().First());
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (4)
Emit\EditAndContinue\EditAndContinueTest.cs (2)
39protected override Func<SyntaxNode, SyntaxNode> GetEquivalentNodesMap(ISymbol left, ISymbol right)
Emit\EditAndContinue\EditAndContinueTestBase.cs (2)
141Func<Compilation, ISymbol> symbolProvider, 142Func<Compilation, ISymbol>? newSymbolProvider = null,
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (65)
Attributes\AttributeTests_RefReadOnly.cs (2)
1455var localFunctionSymbol = newModel.GetDeclaredSymbol(localfunction); 1482var localFunctionSymbol = newModel.GetDeclaredSymbol(localfunction);
Diagnostics\DiagnosticAnalyzerTests.cs (3)
2764void verifyFlowGraphs(ImmutableArray<(ControlFlowGraph Graph, ISymbol AssociatedSymbol)> flowGraphs) 2769(ControlFlowGraph actualFlowGraph, ISymbol associatedSymbol) = flowGraphs[i]; 4209var symbol = Assert.Single(analyzer.CallbackSymbols);
Diagnostics\GetDiagnosticsTests.cs (2)
475var symbol = symbolDeclaredEvent.Symbol; 1136static void analyzeNode(SyntaxNode node, ISymbol containingSymbol, Action<Diagnostic> reportDiagnostic)
FlowAnalysis\FlowTestBase.cs (1)
247protected static string GetSymbolNamesJoined<T>(IEnumerable<T> symbols, bool sort = false) where T : ISymbol
OverloadResolutionPriorityTests.cs (4)
2242var symbol = model.GetSymbolInfo(invocation).Symbol; 2314var symbol = model.GetSymbolInfo(invocation).Symbol; 2349var symbol = model.GetSymbolInfo(invocation).Symbol; 2412var symbol = model.GetSymbolInfo(invocation).Symbol;
Semantics\ExtensionTests.cs (2)
166var member = symbol.ContainingType.GetMembers().Single(); 251var member = symbol.ContainingType.GetMembers().Single();
Semantics\OutVarTests.cs (9)
965var symbol = model.GetDeclaredSymbol(variableDeclaratorSyntax); 973var other = model.LookupSymbols(decl.SpanStart, name: decl.Identifier().ValueText).Single(); 1006ISymbol expectedSymbol = null, 1088private static void VerifyDataFlow(SemanticModel model, DeclarationExpressionSyntax decl, bool isDelegateCreation, bool isExecutableCode, IdentifierNameSyntax[] references, ISymbol symbol) 1140var symbol = model.GetDeclaredSymbol(variableDesignationSyntax); 1162var symbol = model.GetSymbolInfo(reference).Symbol; 1172var symbol = model.GetSymbolInfo(reference).Symbol; 21311var y1 = model.LookupSymbols(x1Ref[0].SpanStart, name: "y1").Single(); 32732var symbol = model.GetDeclaredSymbol(variableDesignationSyntax);
Semantics\PatternMatchingTestBase.cs (11)
81var symbol = model.GetDeclaredSymbol(designation); 87var other = model.LookupSymbols(designation.SpanStart, name: designation.Identifier.ValueText).Single(); 142var symbol = model.GetDeclaredSymbol(designation); 168var symbol = model.GetDeclaredSymbol(declarator); 182var symbol = model.GetDeclaredSymbol(designation); 193var symbol = model.GetSymbolInfo(reference).Symbol; 203var symbol = model.GetSymbolInfo(reference).Symbol; 210var other = model.LookupSymbols(reference.SpanStart, name: reference.Identifier.ValueText).Single(); 244var symbol = model.GetDeclaredSymbol(designation); 384var symbol = (ISymbol)model.GetDeclaredSymbol(designation);
Semantics\PatternMatchingTests_ListPatterns.cs (3)
3645var symbol = model.GetDeclaredSymbol(designation); 3725var symbol = model.GetDeclaredSymbol(itemDesignation); 4415var symbol = model.GetDeclaredSymbol(designation);
Semantics\PatternMatchingTests_Scope.cs (1)
12158var y1 = model.LookupSymbols(x1Ref[0].SpanStart, name: "y1").Single();
Semantics\PatternMatchingTests2.cs (1)
723var symbol = model.GetDeclaredSymbol(designation);
Semantics\PrimaryConstructorTests.cs (14)
963var outVar = model.GetDeclaredSymbol(outVarSyntax); 1010var symbol = model.GetSymbolInfo(x).Symbol; 1076var symbol = model.GetSymbolInfo(x).Symbol; 1304var symbol = model.GetSymbolInfo(x).Symbol; 1533var symbol = model.GetSymbolInfo(x).Symbol; 1622var symbol = model.GetSymbolInfo(x).Symbol; 1971var symbol = model.GetSymbolInfo(x).Symbol; 2645var symbol = model.GetSymbolInfo(x).Symbol; 2683var symbol = model.GetSymbolInfo(x).Symbol; 2720var symbol = model.GetSymbolInfo(x).Symbol; 2756var symbol = model.GetSymbolInfo(x).Symbol; 7798var symbol = symbolInfo.Symbol; 8762var symbol = model.GetSymbolInfo(p1).Symbol; 9168var symbol = model.GetSymbolInfo(p1).Symbol;
Semantics\RecordTests.cs (12)
445var initializer = model.GetSymbolInfo(initializerSyntax.Value).Symbol!; 471var outVar = model.GetDeclaredSymbol(outVarSyntax)!; 2551var symbol = model.GetSymbolInfo(x).Symbol; 21252var symbol = model.GetSymbolInfo(x).Symbol; 21482var symbol = model.GetSymbolInfo(x).Symbol; 21711var symbol = model.GetSymbolInfo(x).Symbol; 21800var symbol = model.GetSymbolInfo(x).Symbol; 22187var symbol = model.GetSymbolInfo(x).Symbol; 24751var symbol = model.GetSymbolInfo(x).Symbol; 24786var symbol = model.GetSymbolInfo(x).Symbol; 24820var symbol = model.GetSymbolInfo(x).Symbol; 24855var symbol = model.GetSymbolInfo(x).Symbol;
Microsoft.CodeAnalysis.CSharp.Features (285)
AddImport\CSharpAddImportFeatureService.cs (2)
282private static bool InfoBoundSuccessfully(ISymbol operation) 523var containingNamespaceSymbol = semanticModel.GetDeclaredSymbol(namespaceToAddTo);
ChangeSignature\CSharpChangeSignatureService.cs (14)
117public override async Task<(ISymbol? symbol, int selectedIndex)> GetInvocationSymbolAsync( 167var typeSymbol = semanticModel.GetSymbolInfo(objectCreation.Type, cancellationToken).Symbol; 294ISymbol declarationSymbol, 535ISymbol declarationSymbol, 572ISymbol declarationSymbol, 714ISymbol declarationSymbol, 735ISymbol declarationSymbol, 751ISymbol declarationSymbol, 791ISymbol declarationSymbol, 810private ImmutableArray<SyntaxNode> VerifyAndPermuteParamNodes(IEnumerable<XmlElementSyntax> paramNodes, ISymbol declarationSymbol, SignatureChange updatedSignature) 870public override async Task<ImmutableArray<ISymbol>> DetermineCascadedSymbolsFromDelegateInvokeAsync( 888var convertedType = (ISymbol?)semanticModel.GetTypeInfo(node, cancellationToken).ConvertedType; 944protected override ImmutableArray<IParameterSymbol> GetParameters(ISymbol declarationSymbol)
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (4)
101ISymbol targetSymbol, 130SyntaxNode targetNode, ISymbol targetSymbol, INamedTypeSymbol suppressMessageAttribute, Diagnostic diagnostic) 152ISymbol targetSymbol, 177private static AttributeArgumentListSyntax CreateAttributeArguments(ISymbol targetSymbol, Diagnostic diagnostic, bool isAssemblyAttribute)
CodeLens\CSharpCodeLensDisplayInfoService.cs (6)
107var symbol = semanticModel.GetDeclaredSymbol(node); 122var symbol = semanticModel.GetDeclaredSymbol(node); 135var symbol = semanticModel.GetDeclaredSymbol(node); 148var symbol = semanticModel.GetDeclaredSymbol(node); 175var symbol = semanticModel.GetDeclaredSymbol(node); 194var scopeSymbol = semanticModel.GetDeclaredSymbol(scopeNode);
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (4)
283private static void AddCapturedTypeParameters(ISymbol symbol, List<ITypeParameterSymbol> typeParameters) 285var containingSymbol = symbol.ContainingSymbol; 304var symbol = semanticModel.GetSymbolInfo(id).Symbol; 314private static string GenerateUniqueMethodName(ISymbol declaredSymbol)
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (1)
234private static IEnumerable<ISymbol> GetAttributeNamedParameters(
Completion\CompletionProviders\AwaitCompletionProvider.cs (1)
154var symbol = semanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol;
Completion\CompletionProviders\CompletionUtilities.cs (2)
146ISymbol symbol, SyntaxContext context) 154public static string GetInsertionText(ISymbol symbol, SyntaxContext context)
Completion\CompletionProviders\CrefCompletionProvider.cs (11)
89protected override async Task<(SyntaxToken, SemanticModel?, ImmutableArray<ISymbol>)> GetSymbolsAsync( 164private static ImmutableArray<ISymbol> GetSymbols( 179private static ImmutableArray<ISymbol> GetUnqualifiedSymbols( 182using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 210private static ImmutableArray<ISymbol> GetQualifiedSymbols( 214var leftSymbol = semanticModel.GetSymbolInfo(parent.Container, cancellationToken).Symbol; 218using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 237SemanticModel semanticModel, ImmutableArray<ISymbol> symbols, SyntaxToken token, int position, ImmutableArray<KeyValuePair<string, string>> options) 259SemanticModel semanticModel, ISymbol symbol, SyntaxToken token, int position, StringBuilder builder, 277ISymbol symbol, 329ISymbol symbol, int position, StringBuilder builder, string sortText, ImmutableArray<KeyValuePair<string, string>> options)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (1)
40public readonly ISymbol? Symbol = symbol;
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (1)
332private static bool IsRelevantSymbolKind(ISymbol symbol)
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (3)
217foreach (var member in type.GetMembers()) 222ISymbol staticSymbol; 300var symbol = semanticModel.GetSymbolInfo(previousToken.Parent, cancellationToken).Symbol;
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (2)
36protected override async Task<ISymbol> GenerateMemberAsync( 40ISymbol member,
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.ItemGetter.cs (3)
132bool FilterInterfaceMember(ISymbol member) 160CompletionItem CreateCompletionItem(ISymbol member) 181private string ToDisplayString(ISymbol symbol, SemanticModel semanticModel)
Completion\CompletionProviders\ExplicitInterfaceTypeCompletionProvider.cs (2)
38protected override (string displayText, string suffix, string insertionText) GetDisplayAndSuffixAndInsertionText(ISymbol symbol, CSharpSyntaxContext context) 110using var _ = PooledHashSet<ISymbol>.GetInstance(out var interfaceSet);
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (2)
188protected override bool IsInitializableFieldOrProperty(ISymbol fieldOrProperty, INamedTypeSymbol containingType) 196protected override string EscapeIdentifier(ISymbol symbol)
Completion\CompletionProviders\ObjectCreationCompletionProvider.cs (1)
79protected override (string displayText, string suffix, string insertionText) GetDisplayAndSuffixAndInsertionText(ISymbol symbol, CSharpSyntaxContext context)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider.cs (2)
122CompletionContext context, int position, SemanticModel semanticModel, ImmutableArray<ISymbol> unnamedSymbols, CancellationToken cancellationToken) 132foreach (var symbol in unnamedSymbols)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Conversions.cs (5)
59private static (ImmutableArray<ISymbol> symbols, ImmutableArray<KeyValuePair<string, string>> properties) GetConversionSymbolsAndProperties( 64return (ImmutableArray.Create<ISymbol>(conversion), s_conversionProperties); 72var symbols = ImmutableArray.Create<ISymbol>(conversion.ContainingType, conversion.Parameters.First().Type, conversion.ReturnType); 134var conversion = await TryRehydrateAsync(document, item, cancellationToken).ConfigureAwait(false); 142private static async Task<ISymbol?> TryRehydrateAsync(Document document, CompletionItem item, CancellationToken cancellationToken)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Indexers.cs (1)
21private void AddIndexers(CompletionContext context, ImmutableArray<ISymbol> indexers)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Operators.cs (1)
101private void AddOperatorGroup(CompletionContext context, string opName, IEnumerable<ISymbol> operators)
Completion\CompletionProviders\OverrideCompletionProvider.cs (2)
191public override ImmutableArray<ISymbol> FilterOverrides(ImmutableArray<ISymbol> members, ITypeSymbol? returnType)
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (3)
82foreach (var member in members) 134static ImmutableArray<ISymbol> GetCandidatePropertiesAndFields(Document document, SemanticModel semanticModel, int position, ITypeSymbol? type) 144private static bool IsFieldOrReadableProperty(ISymbol symbol)
Completion\CompletionProviders\SymbolCompletionProvider.cs (3)
76protected override string GetFilterText(ISymbol symbol, string displayText, CSharpSyntaxContext context) 135protected override bool IsInstrinsic(ISymbol s) 209protected override (string displayText, string suffix, string insertionText) GetDisplayAndSuffixAndInsertionText(ISymbol symbol, CSharpSyntaxContext context)
Completion\CompletionProviders\XmlDocCommentCompletionProvider.cs (2)
91ISymbol? declaredSymbol = null; 388protected override ImmutableArray<IParameterSymbol> GetParameters(ISymbol declarationSymbol)
ConvertLinq\ConvertForEachToLinqQuery\AbstractToMethodConverter.cs (1)
106var expresisonSymbol = ForEachInfo.SemanticModel.GetSymbolInfo(_modifyingExpression, cancellationToken).Symbol;
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (1)
281var memberDeclarationSymbol = semanticModel.GetEnclosingSymbol(
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (2)
739var memberDeclarationNode = FindParentMemberDeclarationNode(returnStatement, out var declaredSymbol); 777private SyntaxNode FindParentMemberDeclarationNode(SyntaxNode node, out ISymbol declaredSymbol)
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (2)
216async Task<ImmutableHashSet<(ISymbol fieldOrProperty, EqualsValueClauseSyntax initializer)>> GetExistingAssignedFieldsOrPropertiesAsync() 234using var _2 = PooledHashSet<(ISymbol fieldOrProperty, EqualsValueClauseSyntax initializer)>.GetInstance(out var result);
Debugging\BreakpointResolver.cs (1)
22protected override IEnumerable<ISymbol> GetMembers(INamedTypeSymbol type, string name)
DecompiledSource\CSharpDecompiledSourceService.cs (2)
31public async Task<Document?> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, MetadataReference? metadataReference, string? assemblyLocation, SyntaxFormattingOptions? formattingOptions, CancellationToken cancellationToken) 70private static async Task<Document> AddAssemblyInfoRegionAsync(Document document, ISymbol symbol, IDecompilationService decompilationService, CancellationToken cancellationToken)
DocumentHighlighting\CSharpDocumentHighlightsService.cs (3)
35Document document, ISymbol symbol, CancellationToken cancellationToken) 49var originalSymbol = symbol.OriginalDefinition; 65var boundSymbol = semanticModel.GetSymbolInfo(type, cancellationToken).Symbol;
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (19)
173internal override MemberBody? TryGetDeclarationBody(SyntaxNode node, ISymbol? symbol) 176internal override bool IsDeclarationWithSharedBody(SyntaxNode declaration, ISymbol member) 182protected override IEnumerable<SyntaxNode> GetVariableUseSites(IEnumerable<SyntaxNode> roots, ISymbol localOrParameter, SemanticModel model, CancellationToken cancellationToken) 951internal override bool IsConstructorWithMemberInitializers(ISymbol symbol, CancellationToken cancellationToken) 1003protected override SyntaxNode? GetSymbolDeclarationSyntax(ISymbol symbol, Func<ImmutableArray<SyntaxReference>, SyntaxReference?> selector, CancellationToken cancellationToken) 1028protected override ISymbol? GetDeclaredSymbol(SemanticModel model, SyntaxNode declaration, CancellationToken cancellationToken) 1041protected override OneOrMany<(ISymbol? oldSymbol, ISymbol? newSymbol)> GetEditedSymbols( 1061OneOrMany<(ISymbol? oldSymbol, ISymbol? newSymbol)> AddFieldSymbolUpdates(SeparatedSyntaxList<VariableDeclaratorSyntax> oldVariables, SeparatedSyntaxList<VariableDeclaratorSyntax> newVariables) 1080? OneOrMany<(ISymbol?, ISymbol?)>.Empty 1085ref TemporaryArray<(ISymbol?, ISymbol?, EditKind)> result, 1088ISymbol? oldSymbol, 1090ISymbol? newSymbol, 1398private ISymbol? GetSymbolForEdit( 1435private ISymbol? GetParameterContainingMemberOrType(SyntaxNode? node, SyntaxNode? otherNode, SemanticModel? model, IReadOnlyDictionary<SyntaxNode, SyntaxNode> fromOtherMap, CancellationToken cancellationToken) 2528internal override void ReportInsertedMemberSymbolRudeEdits(RudeEditDiagnosticsBuilder diagnostics, ISymbol newSymbol, SyntaxNode newNode, bool insertingIntoExistingContainingType)
EditAndContinue\DeclarationBody\CopyConstructorDeclarationBody.cs (1)
46public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\CSharpLambdaBody.cs (1)
35public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\FieldWithInitializerDeclarationBody.cs (1)
34public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\OrdinaryInstanceConstructorWithExplicitInitializerDeclarationBody.cs (1)
37public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\OrdinaryInstanceConstructorWithImplicitInitializerDeclarationBody.cs (1)
31public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\PrimaryConstructorWithExplicitInitializerDeclarationBody.cs (1)
45public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\PrimaryConstructorWithImplicitInitializerDeclarationBody.cs (1)
45public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\PropertyOrIndexerAccessorDeclarationBody.cs (1)
76public sealed override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\TopLevelCodeDeclarationBody.cs (1)
30public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\SyntaxUtilities.cs (1)
21public static MemberBody? TryGetDeclarationBody(SyntaxNode node, ISymbol? symbol)
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
197var containingTypeMemberNames = containingType.GetAccessibleMembersInThisAndBaseTypes<ISymbol>(containingType).Select(m => m.Name);
ExtractInterface\CSharpExtractInterfaceService.cs (3)
57internal override bool IsExtractableMember(ISymbol m) 69IEnumerable<ISymbol> includedMembers, ImmutableDictionary<ISymbol, SyntaxAnnotation> symbolToDeclarationMap,
ExtractMethod\CSharpMethodExtractor.Analyzer.cs (2)
54protected override bool IsReadOutside(ISymbol symbol, HashSet<ISymbol> readOutsideMap)
Formatting\CSharpAccessibilityModifiersNewDocumentFormattingProvider.cs (1)
68var type = semanticModel.GetDeclaredSymbol(declaration, cancellationToken);
GenerateType\CSharpGenerateTypeService.cs (3)
200var leftSymbol = semanticModel.GetSymbolInfo(((MemberAccessExpressionSyntax)nameOrMemberAccessExpression).Expression, cancellationToken).Symbol; 248var leftSymbol = semanticModel.GetSymbolInfo(parent.Left, cancellationToken).Symbol; 440var expressionSymbol = semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol;
GoToDefinition\CSharpGoToDefinitionSymbolService.cs (3)
25protected override Task<ISymbol> FindRelatedExplicitlyDeclaredSymbolAsync(Project project, ISymbol symbol, CancellationToken cancellationToken) 62var symbol = semanticModel.GetDeclaredSymbol(foundReturnableConstruct);
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (10)
27using MemberImplementationMap = OrderedMultiDictionary<ISymbol, ISymbol>; 42protected abstract bool CheckMemberCanBeConverted(ISymbol member); 43protected abstract SyntaxNode ChangeImplementation(SyntaxGenerator generator, SyntaxNode currentDecl, ISymbol implMember, ISymbol interfaceMember); 44protected abstract Task UpdateReferencesAsync(Project project, SolutionEditor solutionEditor, ISymbol implMember, INamedTypeSymbol containingType, CancellationToken cancellationToken); 193foreach (var interfaceMember in interfaceType.GetMembers()) 195var impl = containingType.FindImplementationForInterfaceMember(interfaceMember); 229var documentToImplDeclarations = new OrderedMultiDictionary<Document, (SyntaxNode, ISymbol impl, SetWithInsertionOrder<ISymbol> interfaceMembers)>();
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (6)
36protected override bool CheckMemberCanBeConverted(ISymbol member) 41ISymbol implMember, INamedTypeSymbol interfaceType, CancellationToken cancellationToken) 143protected override SyntaxNode ChangeImplementation(SyntaxGenerator generator, SyntaxNode decl, ISymbol implMember, ISymbol interfaceMember) 152private static bool AllDefaultValuesMatch(ISymbol implMember, ISymbol interfaceMember)
ImplementInterface\CSharpImplementImplicitlyCodeRefactoringProvider.cs (4)
32protected override bool CheckMemberCanBeConverted(ISymbol member) 44protected override Task UpdateReferencesAsync(Project project, SolutionEditor solutionEditor, ISymbol implMember, INamedTypeSymbol containingType, CancellationToken cancellationToken) 47protected override SyntaxNode ChangeImplementation(SyntaxGenerator generator, SyntaxNode decl, ISymbol _1, ISymbol _2)
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (9)
74var fieldOrProperty = TryFindMatchingUninitializedFieldOrPropertySymbol(); 82ISymbol? TryFindMatchingUninitializedFieldOrPropertySymbol() 149var siblingFieldOrProperty = TryFindSiblingFieldOrProperty(); 151var field = CreateField(parameter); 152var property = CreateProperty(parameter); 179ISymbol? TryFindSiblingFieldOrProperty() 211ISymbol CreateField(IParameterSymbol parameter) 237ISymbol CreateProperty(IParameterSymbol parameter) 270private static (IOperation? initializer, ISymbol? fieldOrProperty) TryFindFieldOrPropertyInitializerValue(
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider_Update.cs (4)
27ImmutableArray<ISymbol> fieldsOrProperties, 76ISymbol fieldOrProperty, 135static (ISymbol? symbol, SyntaxNode? syntax, CodeGenerationContext context) GetAddContext<TSymbol>( 136Compilation compilation, IParameterSymbol parameter, CancellationToken cancellationToken) where TSymbol : class, ISymbol
LanguageServices\CSharpSymbolDisplayService.SymbolDescriptionBuilder.cs (6)
96ISymbol symbol) 115protected override ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(ISymbol symbol, SemanticModel semanticModel, int position, SymbolDisplayFormat format) 121protected override ImmutableArray<SymbolDisplayPart> WrapConstraints(ISymbol symbol, ImmutableArray<SymbolDisplayPart> displayParts) 166protected override string? GetNavigationHint(ISymbol? symbol) 221private async Task<T?> GetFirstDeclarationAsync<T>(ISymbol symbol) where T : SyntaxNode 252protected override void AddCaptures(ISymbol symbol)
MetadataAsSource\CSharpMetadataAsSourceService.cs (1)
37protected override async Task<Document> AddAssemblyInfoRegionAsync(Document document, Compilation symbolCompilation, ISymbol symbol, CancellationToken cancellationToken)
NavigationBar\CSharpNavigationBarItemService.cs (4)
68foreach (var member in type.GetMembers()) 169private static bool IsAccessor(ISymbol member) 182Solution solution, ISymbol member, SyntaxTree tree, CancellationToken cancellationToken) 197Solution solution, ISymbol symbol, SyntaxTree tree, CancellationToken cancellationToken)
QuickInfo\CSharpSemanticQuickInfoProvider.cs (1)
86protected override NullableFlowState GetNullabilityAnalysis(SemanticModel semanticModel, ISymbol symbol, SyntaxNode node, CancellationToken cancellationToken)
QuickInfo\OnTheFlyDocsUtilities.cs (1)
14public static ImmutableArray<OnTheFlyDocsRelevantFileInfo?> GetAdditionalOnTheFlyDocsContext(Solution solution, ISymbol symbol)
Rename\CSharpRenameIssuesService.cs (2)
25SemanticModel semanticModel, ISymbol symbol, SyntaxToken triggerToken, [NotNullWhen(true)] out string? langError) 40var symbolForVar = semanticModel.GetSpeculativeSymbolInfo(
SignatureHelp\AttributeSignatureHelpProvider.cs (3)
129ISymbol within, 160IList<ISymbol> namedParameters, 174var namedParameter = namedParameters[i];
SignatureHelp\GenericNameSignatureHelpProvider.cs (1)
169ISymbol symbol,
SignatureHelp\InvocationExpressionSignatureHelpProvider.cs (1)
124ISymbol within,
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_DelegateAndFunctionPointerInvoke.cs (1)
19InvocationExpressionSyntax invocationExpression, SemanticModel semanticModel, ISymbol within,
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (1)
38ISymbol within,
SignatureHelp\PrimaryConstructorBaseTypeSignatureHelpProvider.cs (1)
101var currentConstructor = semanticModel.GetSymbolInfo(baseTypeSyntax, cancellationToken).Symbol;
Snippets\CSharpConsoleSnippetProvider.cs (1)
37var lambdaSymbol = semanticModel.GetSymbolInfo(lambda, cancellationToken).Symbol;
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (2)
82private (VariableDeclaratorSyntax, ISymbol)? TryGetVariableDeclaratorAndSymbol(SemanticModel semanticModel) 89var symbol = semanticModel.GetSymbolInfo(_assignmentTargetOpt).Symbol;
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (2)
329ISymbol outSymbol, 364var symbol = semanticModel.GetSymbolInfo(identifierName, cancellationToken).Symbol;
src\Analyzers\CSharp\Analyzers\MakeLocalFunctionStatic\MakeLocalFunctionStaticHelper.cs (2)
30static bool IsChildOrSelf(LocalFunctionStatementSyntax containingLocalFunction, ISymbol calledLocationFunction) 43public static bool CanMakeLocalFunctionStaticByRefactoringCaptures(LocalFunctionStatementSyntax localFunction, SemanticModel semanticModel, out ImmutableArray<ISymbol> captures)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
80foreach (var member in structType.GetMembers())
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
101foreach (var member in typeSymbol.GetMembers())
src\Analyzers\CSharp\Analyzers\NamingStyle\CSharpNamingStyleDiagnosticAnalyzer.cs (1)
28protected override bool ShouldIgnore(ISymbol symbol)
src\Analyzers\CSharp\Analyzers\QualifyMemberAccess\CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (2)
30protected override bool CanMemberAccessBeQualified(ISymbol containingSymbol, SyntaxNode node) 53private static bool IsInPropertyOrFieldInitialization(ISymbol containingSymbol, SyntaxNode node)
src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastDiagnosticAnalyzer.cs (2)
208var castOrSelectSymbol = semanticModel.GetSymbolInfo(invocationExpression, cancellationToken).Symbol; 209var whereSymbol = semanticModel.GetSymbolInfo(whereInvocation, cancellationToken).Symbol;
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (2)
133foreach (var symbol in symbolInfo.CandidateSymbols) 138ISymbol? symbol,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (1)
125var createSymbol = semanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
389var member = state.SemanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
54var symbol = semanticModel.GetSymbolInfo(objectCreationExpression, cancellationToken).Symbol;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (8)
474var symbol = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol; 485var methodOrProperty = semanticModel.GetSymbolInfo(elementAccess, cancellationToken).Symbol; 509var leftSymbol = semanticModel.GetSymbolInfo(assignment.Left, cancellationToken).Symbol; 557var symbol = semanticModel.GetSymbolInfo(identifier, cancellationToken).Symbol; 1109var expressionSymbol = semanticModel.GetSymbolInfo(memberAccess.Expression, cancellationToken).Symbol; 1113var emptySymbol = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol; 1141var expressionSymbol = semanticModel.GetSymbolInfo(memberAccess.Expression, cancellationToken).Symbol; 1145var emptySymbol = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol;
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
184var symbol = semanticModel.GetSymbolInfo(binaryExpression, cancellationToken).Symbol; 201var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
287private static HashSet<ISymbol> GetExistingSymbols(
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (1)
36public static bool IsPublicInstance(ISymbol symbol)
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (3)
110var local = semanticModel.GetDeclaredSymbol(localDeclaration.Declaration.Variables[0], cancellationToken); 237SemanticModel semanticModel, INamedTypeSymbol? expressionTypeOpt, ISymbol local, BlockSyntax block, 401var localEnclosingSymbol = semanticModel.GetEnclosingSymbol(localDeclaration.SpanStart, cancellationToken);
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
165var asOperand = semanticModel.GetSymbolInfo(asExpression.Left, cancellationToken).Symbol;
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (13)
64private static readonly ObjectPool<ConcurrentSet<ISymbol>> s_concurrentSetPool = new(() => []); 86[NotNullWhen(true)] ISymbol? member, 144PooledDictionary<ISymbol, IParameterSymbol> candidateMembersToRemove, 153private readonly PooledDictionary<ISymbol, IParameterSymbol> _candidateMembersToRemove = candidateMembersToRemove; 160private readonly ConcurrentSet<ISymbol> _membersThatCannotBeRemoved = s_concurrentSetPool.Allocate(); 323var candidateMembersToRemove = PooledDictionary<ISymbol, IParameterSymbol>.GetInstance(); 387Dictionary<ISymbol, IParameterSymbol> candidateMembersToRemove) 409Dictionary<ISymbol, IParameterSymbol> candidateMembersToRemove) 415using var _1 = PooledHashSet<ISymbol>.GetInstance(out var assignedMembers); 422namedType, semanticModel, assignmentExpression, candidateMembersToRemove, orderedParameterAssignments, out var member)) 466Dictionary<ISymbol, IParameterSymbol> candidateMembersToRemove, 468[NotNullWhen(true)] out ISymbol? member) 555var member = operation.Member.OriginalDefinition;
src\Analyzers\CSharp\Analyzers\UseSimpleUsingStatement\UseSimpleUsingStatementDiagnosticAnalyzer.cs (2)
138using var _ = PooledDictionary<string, ArrayBuilder<ISymbol>>.GetInstance(out var symbolNameToExistingSymbol); 169private static bool DeclaredLocalCausesCollision(Dictionary<string, ArrayBuilder<ISymbol>> symbolNameToExistingSymbol, ImmutableArray<ILocalSymbol> locals)
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
88foreach (var member in namedType.GetMembers())
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (26)
314var positionalParam = param.ContainingSymbol.ContainingType.GetMembers().FirstOrDefault(member 378var dictionaryBuilder = ImmutableDictionary<ISymbol, ExpressionSyntax>.Empty.ToBuilder(); 403ImmutableDictionary<ISymbol, ExpressionSyntax> assignmentValues) 419private static ImmutableDictionary<ISymbol, T> GetAssignmentValuesForConstructor<T>( 424var dictionaryBuilder = ImmutableDictionary<ISymbol, T>.Empty.ToBuilder(); 430return ImmutableDictionary<ISymbol, T>.Empty; 445ISymbol? symbol = assignee switch 461return ImmutableDictionary<ISymbol, T>.Empty; 506ISymbol? otherC = null; 532value, successRequirement: true, type, fields, out var _2)) 569[NotNullWhen(true)] out ISymbol? assignedVariable) 609private static ISymbol? GetReferencedSymbolObject(IOperation reference) 657ISymbol otherObject) 726ISymbol currentObject, 727ISymbol otherObject, 785ISymbol currentObject, 787[NotNullWhen(true)] out ISymbol? boundVariable, 833bool TryGetBoundVariableForIsPattern(IPatternOperation isPattern, [NotNullWhen(true)] out ISymbol? boundVariable) 854DeclaredSymbol: ISymbol otherVar, 880ISymbol otherC, 918ISymbol currentObject, 919ISymbol otherObject, 922var leftObject = GetReferencedSymbolObject(memberReference1.Instance!); 923var rightObject = GetReferencedSymbolObject(memberReference2.Instance!); 960[NotNullWhen(true)] out ISymbol? otherC, 1124private static IFieldSymbol? UnwrapPropertyToField(ISymbol propertyOrField)
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
53[NotNullWhen(true)] out ISymbol? matchingMember,
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (1)
50protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (1)
35protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateMethodService.cs (1)
43protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
336var previousSymbol = semanticModel.GetSymbolInfo(nodeToReplace, cancellationToken).Symbol;
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
107var symbol = model.GetEnclosingSymbol(node.Span.Start, cancellationToken);
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (4)
29ImmutableArray<ISymbol> captures, 41ImmutableArray<ISymbol> captures, 206private static ImmutableArray<(IParameterSymbol symbol, ISymbol capture)> CreateParameterSymbols(ImmutableArray<ISymbol> captures)
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (1)
65Func<Document, LocalFunctionStatementSyntax, ImmutableArray<ISymbol>, Task> fixer,
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (2)
172var symbol = model.GetSymbolInfo(assignment.Left, cancellationToken).Symbol; 214var symbol = model.GetSymbolInfo(invocation.Expression, cancellationToken).Symbol;
src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (1)
45foreach (var symbol in memberGroup)
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
135var localSymbol = semanticModel.GetDeclaredSymbol(
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (2)
69ImmutableDictionary<ISymbol, (MemberDeclarationSyntax memberNode, SyntaxNode nodeToRemove)> removedMembers) 167ImmutableDictionary<ISymbol, (MemberDeclarationSyntax memberNode, SyntaxNode nodeToRemove)> removedMembers,
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (2)
36ISymbol associatedSymbol, 58ISymbol associatedSymbol,
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (7)
EditAndContinue\Helpers\CSharpEditAndContinueTestVerifier.cs (1)
21public override ImmutableArray<SyntaxNode> GetDeclarators(ISymbol method)
EditAndContinue\Helpers\EditingTestBase.cs (4)
113internal static SemanticEditDescription SemanticEdit(SemanticEditKind kind, Func<Compilation, ISymbol> symbolProvider, SyntaxMapDescription.Mapping? syntaxMap, IEnumerable<RuntimeRudeEditDescription>? rudeEdits = null, string? partialType = null) 116internal static SemanticEditDescription SemanticEdit(SemanticEditKind kind, Func<Compilation, ISymbol> symbolProvider, IEnumerable<(TextSpan, TextSpan)>? syntaxMap, IEnumerable<RuntimeRudeEditDescription>? rudeEdits = null, string? partialType = null) 119internal static SemanticEditDescription SemanticEdit(SemanticEditKind kind, Func<Compilation, ISymbol> symbolProvider, string? partialType = null, bool preserveLocalVariables = false, Func<Compilation, ISymbol>? deletedSymbolContainerProvider = null)
ExtractClass\ExtractClassTests.cs (2)
3124ImmutableArray<ISymbol> selectedMembers, 3130IEnumerable<(ISymbol member, bool makeAbstract)> selections;
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_IFieldReferenceExpression.cs (1)
709var fieldSym = classSym.GetMembers("_field").Single();
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (2)
InteractiveSessionTests.cs (2)
491var c2X = lookupMember(compilation1, "Submission#0", "X"); 509ISymbol lookupMember(Compilation c, string typeName, string memberName)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (193)
Semantics\AccessCheckTests.cs (1)
766ISymbol nullSymbol = null;
Semantics\AccessibilityTests.cs (1)
21private static readonly ISymbol s_testSymbol;
Semantics\BindingTests.cs (4)
2928var symbol1 = model.GetDeclaredSymbol(param); 2932var symbol2 = model.GetSymbolInfo(id).Symbol; 2970var symbol1 = model.GetDeclaredSymbol(param); 2974var symbol2 = model.GetSymbolInfo(id).Symbol;
Semantics\ColorColorTests.cs (1)
1250var candidate = info.CandidateSymbols.Single();
Semantics\ConstantTests.cs (1)
2951var symbol = compilation.GlobalNamespace.GetTypeMembers("c1").First().GetMembers("Z1").First();
Semantics\DeconstructionTests.cs (27)
3947var symbol = si.Symbol; 4173var x1 = model.GetDeclaredSymbol(designations[0]); 4178var x2 = model.GetDeclaredSymbol(designations[1]); 4240var a = model.GetDeclaredSymbol(designations[0]); 4244var b = model.GetDeclaredSymbol(designations[1]); 4248var c = model.GetDeclaredSymbol(designations[2]); 4252var d = model.GetDeclaredSymbol(designations[3]); 4375var a = model.GetDeclaredSymbol(designations[0]); 4379var b = model.GetDeclaredSymbol(designations[1]); 4383var c = model.GetDeclaredSymbol(designations[2]); 4387var d = model.GetDeclaredSymbol(designations[3]); 5189var a = model.GetDeclaredSymbol(designations[0]); 5193var b = model.GetDeclaredSymbol(designations[1]); 5197var c = model.GetDeclaredSymbol(designations[2]); 5201var d = model.GetDeclaredSymbol(designations[3]); 5333var a = model.GetDeclaredSymbol(designations[0]); 5337var b = model.GetDeclaredSymbol(designations[1]); 5341var c = model.GetDeclaredSymbol(designations[2]); 5345var d = model.GetDeclaredSymbol(designations[3]); 5657var a = model.GetDeclaredSymbol(designations[0]); 5661var b = model.GetDeclaredSymbol(designations[1]); 5665var c = model.GetDeclaredSymbol(designations[2]); 5669var d = model.GetDeclaredSymbol(designations[3]); 5767var a = model.GetDeclaredSymbol(designations[0]); 5771var b = model.GetDeclaredSymbol(designations[1]); 5775var c = model.GetDeclaredSymbol(designations[2]); 5779var d = model.GetDeclaredSymbol(designations[3]);
Semantics\DelegateTypeTests.cs (2)
10495var symbol = model.GetDeclaredSymbol(variable); 14497var symbol = model.GetSymbolInfo(variable).Symbol;
Semantics\ExpressionBodiedMemberTests.cs (5)
79var semanticSymbol = semanticInfo.Symbol; 208var sym = semanticInfo.Symbol; 230var semanticSymbol = semanticInfo.Symbol; 286var semanticSymbol = semanticInfo.Symbol; 319var semanticSymbol = semanticInfo.Symbol;
Semantics\ForEachTests.cs (8)
2133Assert.Equal<ISymbol>(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerable__GetEnumerator).GetPublicSymbol(), loopInfo.GetEnumeratorMethod); 2134Assert.Equal<ISymbol>(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__Current).GetPublicSymbol(), loopInfo.CurrentProperty); 2135Assert.Equal<ISymbol>(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__MoveNext).GetPublicSymbol(), loopInfo.MoveNextMethod); 2136Assert.Equal<ISymbol>(comp.GetSpecialTypeMember(SpecialMember.System_IDisposable__Dispose).GetPublicSymbol(), loopInfo.DisposeMethod); 2185Assert.Equal<ISymbol>(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerable__GetEnumerator).GetPublicSymbol(), loopInfo0.GetEnumeratorMethod); 2186Assert.Equal<ISymbol>(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__Current).GetPublicSymbol(), loopInfo0.CurrentProperty); 2187Assert.Equal<ISymbol>(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__MoveNext).GetPublicSymbol(), loopInfo0.MoveNextMethod); 2188Assert.Equal<ISymbol>(comp.GetSpecialTypeMember(SpecialMember.System_IDisposable__Dispose).GetPublicSymbol(), loopInfo0.DisposeMethod);
Semantics\InteractiveSemanticModelTests.cs (2)
127var symbol = bindInfo.Symbol; 142var symbol = bindInfo.Symbol;
Semantics\InteractiveUsingTests.cs (1)
580private static ISymbol GetSpeculativeSymbol(Compilation comp, string name)
Semantics\LambdaDiscardParametersTests.cs (5)
451var localSymbol = model.GetSymbolInfo(underscores[0]).Symbol; 455var parameterSymbol = model.GetSymbolInfo(underscores[1]).Symbol; 484var localSymbol = model.GetSymbolInfo(underscore).Symbol; 516var localSymbol = model.GetSymbolInfo(underscores[0]).Symbol; 520var parameterSymbol = model.GetSymbolInfo(underscores[1]).Symbol;
Semantics\LambdaTests.cs (9)
854var sym = model.GetSymbolInfo(expr).Symbol; 3007ISymbol symbol = model.GetSymbolInfo(b).Symbol; 3629static string getAttributesInternal(LambdaExpressionSyntax expr, ISymbol symbol) 3635static string getAttributesPublic(LambdaExpressionSyntax expr, ISymbol symbol) 3950var symbol = model.GetSymbolInfo(attributeSyntax).Symbol; 4093var symbol = model.GetSymbolInfo(expr).Symbol; 8114var constSymbol = model.GetDeclaredSymbol(decls[0].Declaration.Variables.Single()); 8120var defaultValueSymbol = model.GetSymbolInfo(defaultValue).Symbol; 8125var lhsSymbol = model.GetSymbolInfo(lhs).Symbol;
Semantics\LocalFunctionTests.cs (10)
4966var b1Symbol = model.GetSymbolInfo(b1).Symbol; 6361var symbol = model.GetSymbolInfo(expr).Symbol; 6382var symbol = model.GetSymbolInfo(expr).Symbol; 6410var symbol = model.GetSymbolInfo(expr).Symbol; 6446var symbol = model.GetSymbolInfo(exprs[0]).Symbol; 6490var symbol = model.GetSymbolInfo(exprs[0]).Symbol; 6537var symbol = model.GetSymbolInfo(exprs[0]).Symbol; 7646var symbol = model.GetSymbolInfo(tParameterUsage).Symbol; 8691var symbol = model.GetSymbolInfo(parameterUsage).Symbol; 10179var symbol = model.GetSymbolInfo(node).Symbol;
Semantics\LookupTests.cs (4)
34internal List<ISymbol> GetLookupSymbols(string testSrc, NamespaceOrTypeSymbol container = null, string name = null, int? arity = null, bool isScript = false, IEnumerable<string> globalUsings = null) 1522private void TestLookupSymbolsNestedNamespaces(List<ISymbol> actual_lookupSymbols) 2039var m = comp.GlobalNamespace.GetTypeMembers("Program").Single().GetMembers("M").Single(); 2069var m = comp.GlobalNamespace.GetTypeMembers("Program").Single().GetMembers("M").Single();
Semantics\NativeIntegerTests.cs (10)
267Assert.False(((IEquatable<ISymbol>)underlyingType).Equals(nativeIntegerType)); 311static bool includeUnderlyingMember(ISymbol underlyingMember) 343static bool includeNativeIntegerMember(ISymbol nativeIntegerMember) 514foreach (var member in allMembers) 527static void verifyMembers(INamedTypeSymbol type, ImmutableArray<ISymbol> allMembers, ImmutableArray<ISymbol> members) 529foreach (var member in members) 536static void verifyMember(INamedTypeSymbol type, ISymbol member) 654private static int SymbolComparison(ISymbol x, ISymbol y) => SymbolComparison(x.ToTestDisplayString(), y.ToTestDisplayString());
Semantics\NullableReferenceTypesTests.cs (27)
3696var symbol1 = model.GetDeclaredSymbol(param); 3700var symbol2 = model.GetSymbolInfo(id).Symbol; 4527var firstCrefSymbol = model.GetSymbolInfo(firstCref).Symbol; 4531var lastCrefSymbol = model.GetSymbolInfo(lastCref).Symbol; 4563var lastCrefSymbol = model.GetSymbolInfo(lastCref).Symbol; 4595var lastCrefSymbol = model.GetSymbolInfo(lastCref).Symbol; 65903var objectSymbol2 = model2.GetSymbolInfo(object2).Symbol; 71783var discard1 = model.GetSymbolInfo(discards[0]).Symbol; 71787var discard2 = model.GetSymbolInfo(discards[1]).Symbol; 71791var discard3 = model.GetSymbolInfo(discards[2]).Symbol; 71795var discard4 = model.GetSymbolInfo(discards[3]).Symbol; 71799var discard5 = model.GetSymbolInfo(discards[4]).Symbol; 94282var symbol = model.GetDeclaredSymbol(localDeclaration); 157583var field1 = model.GetSymbolInfo(declarators[0].Value).Symbol; 157585var field2 = model.GetSymbolInfo(declarators[1].Value).Symbol; 157587var field3 = model.GetSymbolInfo(declarators[2].Value).Symbol; 157633var method2 = model.GetSymbolInfo(invocations[0]).Symbol; 157636var method3 = model.GetSymbolInfo(invocations[1]).Symbol; 158065var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 158234var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 158274var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 158315var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item"); 158350var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item"); 158484var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Get"); 158526var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 158570var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item"); 158607var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item");
Semantics\OperatorTests.cs (8)
7544var symbol2 = semanticModel.GetSymbolInfo(node2).Symbol; 7546var symbol4 = semanticModel.GetSymbolInfo(node4).Symbol; 8114var symbol2 = semanticModel.GetSymbolInfo(node2).Symbol; 8115var symbol3 = semanticModel.GetSymbolInfo(node3).Symbol; 8116var symbol4 = semanticModel.GetSymbolInfo(node4).Symbol; 8118var symbol6 = semanticModel.GetSymbolInfo(node6).Symbol; 8119var symbol7 = semanticModel.GetSymbolInfo(node7).Symbol; 8120var symbol8 = semanticModel.GetSymbolInfo(node8).Symbol;
Semantics\OverloadResolutionTests.cs (2)
7434var symbol = model.GetSymbolInfo(syntax).Symbol; 7475var symbol = model.GetSymbolInfo(syntax).Symbol;
Semantics\QueryTests.cs (2)
2273var symbol = semanticModel.GetDeclaredSymbol(queryContinuation); 2326var symbol = semanticModel.GetDeclaredSymbol(joinInto);
Semantics\RecordStructTests.cs (6)
2669var symbol = model.GetSymbolInfo(x).Symbol; 2704var symbol = model.GetSymbolInfo(x).Symbol; 2738var symbol = model.GetSymbolInfo(x).Symbol; 2773var symbol = model.GetSymbolInfo(x).Symbol; 5928var initializer = model.GetSymbolInfo(initializerSyntax.Value).Symbol!; 5964var outVar = model.GetDeclaredSymbol(outVarSyntax)!;
Semantics\RefFieldTests.cs (4)
16599var method = model.GetSymbolInfo(anonymousMethod).Symbol; 16638var method = model.GetSymbolInfo(anonymousMethod).Symbol; 16782var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 29387var symbol = model.GetDeclaredSymbol(fieldInitializerSyntax.Parent);
Semantics\ScriptSemanticsTests.cs (4)
525var symbol1 = model.GetSymbolInfo(((GotoStatementSyntax)statements[1]).Expression).Symbol; 539var symbol0 = model.GetDeclaredSymbol(declarations[0]); 541var symbol1 = model.GetSymbolInfo(declarations[1].Initializer.Value).Symbol; 595foreach (var symbol in symbols)
Semantics\TopLevelStatementsTests.cs (30)
195var refSymbol = model1.GetSymbolInfo(localRef).Symbol; 320var refSymbol = model1.GetSymbolInfo(localRef).Symbol; 482var declSymbol = model1.GetDeclaredSymbol(localDecl); 501var refSymbol = model2.GetSymbolInfo(localRef).Symbol; 534var declSymbol = model1.GetDeclaredSymbol(localDecl); 545var refSymbol = model1.GetSymbolInfo(localRef).Symbol; 574var declSymbol = model1.GetDeclaredSymbol(localDecl); 592var refSymbol = model1.GetSymbolInfo(localRef).Symbol; 701var local = model.GetDeclaredSymbol(declarator); 871var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Single()); 877var symbol2 = model2.GetDeclaredSymbol(tree2.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Single()); 985var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First()); 989var symbol2 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Skip(1).Single()); 1040var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First()); 1408var symbol2 = model2.GetSymbolInfo(nameRef).Symbol; 1686var declSymbol = model1.GetDeclaredSymbol(localDecl); 1759void verifyModel(ISymbol declSymbol, SemanticModel model, IdentifierNameSyntax nameRef) 1859var declSymbol = model1.GetDeclaredSymbol(localDecl); 1927void verifyModel(ISymbol declSymbol, SemanticModel model2, IdentifierNameSyntax nameRef) 2140void verifyModel(ISymbol declSymbol, SemanticModel model2, IdentifierNameSyntax nameRef) 2306void verifyModel(ISymbol declSymbol, SemanticModel model2, IdentifierNameSyntax nameRef) 3957var parameter = model.GetSymbolInfo(nameRef).Symbol; 3999void verifyModel(ISymbol declSymbol, SemanticModel model, IdentifierNameSyntax nameRef) 6031var declSymbol = model1.GetDeclaredSymbol(localDecl); 6039var refSymbol = model1.GetSymbolInfo(localRef).Symbol; 6281var x = semanticModel.GetDeclaredSymbol(localDecl); 6326var xDecl = semanticModel1.GetDeclaredSymbol(localDecl); 6328var xRef = semanticModel1.GetSymbolInfo(localRef).Symbol; 6377var xDecl = semanticModel1.GetDeclaredSymbol(localDecl); 6383var xRef = semanticModel2.GetSymbolInfo(localRef).Symbol;
Semantics\UnsafeTests.cs (9)
7274var declaredSymbol = model.GetDeclaredSymbol(syntax.Ancestors().OfType<VariableDeclaratorSyntax>().First()); 7858var receiverSymbol = receiverSummary.Symbol; 7925var receiverSymbol = receiverSummary.Symbol; 8169var receiverSymbol = receiverSummary.Symbol; 8181var indexSymbol = indexSummary.Symbol; 8236var receiverSymbol = receiverSummary.Symbol; 8248var indexSymbol = indexSummary.Symbol; 8294var receiverSymbol = receiverSummary.Symbol; 8306var indexSymbol = indexSummary.Symbol;
Semantics\UsingStatementTests.cs (10)
62var declaredSymbol = model.GetDeclaredSymbol(usingStatement.Declaration.Variables.Single()); 75var lookupSymbol = model.LookupSymbols(memberAccessExpression.SpanStart, name: declaredLocal.Name).Single(); 1343var declaredSymbol = model.GetDeclaredSymbol(usingStatement.Declaration.Variables.Single()); 1378var firstDeclaredSymbol = model.GetDeclaredSymbol(usingStatement.Declaration.Variables.First()); 1382var secondDeclaredSymbol = model.GetDeclaredSymbol(usingStatement.Declaration.Variables.Last()); 1869var symbol = model.GetDeclaredSymbol(x); 1876private SymbolInfo VerifySymbolInfoForUsingStatements(CSharpCompilation compilation, ISymbol symbol, int index = 1) 1890private ISymbol VerifyLookUpSymbolForUsingStatements(CSharpCompilation compilation, ISymbol symbol, int index = 1) 1896var actualSymbol = model.LookupSymbols(usingStatements[index - 1].SpanStart, name: symbol.Name).Single();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (341)
Compilation\CompilationAPITests.cs (3)
2843var symbol = semanticModel.GetSymbolInfo(expr).Symbol; 2878var symbol = semanticModel.GetSymbolInfo(expr).Symbol; 2910var symbol = semanticModel.GetSymbolInfo(expr).Symbol;
Compilation\GetSemanticInfoTests.cs (20)
1072var baseConstructor = bindInfo.Symbol; 1091var baseConstructor = bindInfo.Symbol; 1457var candidateIndexers = ImmutableArray.Create<ISymbol>(indexerSymbol1, indexerSymbol2); 1460Assert.True(bindInfo.CandidateSymbols.SetEquals(candidateIndexers, EqualityComparer<ISymbol>.Default)); 1532var candidate = bindInfo.CandidateSymbols.Single(); 1560var symbol = bindInfo.Symbol; 1582var symbol = bindInfo.Symbol; 1610var symbol = bindInfo.Symbol; 1706var symbol = bindInfo.Symbol; 1741var symbol = bindInfo.Symbol; 1776var symbol = bindInfo.Symbol; 1812var symbol = bindInfo.Symbol; 2204private IEnumerable<ISymbol> LookupTypeParameterMembers(string types, string constraints, string memberName, out ITypeParameterSymbol typeParameter) 2539var symbol = info.Symbol; 2726var symbol = symbolInfo.Symbol; 2848Assert.True(candidates.SetEquals(conversions, EqualityComparer<ISymbol>.Default)); 2939Assert.True(candidates.SetEquals(operators, EqualityComparer<ISymbol>.Default)); 3031Assert.True(candidates.SetEquals(operators, EqualityComparer<ISymbol>.Default)); 3105Assert.True(candidates.SetEquals(operators, EqualityComparer<ISymbol>.Default)); 3179Assert.True(candidates.SetEquals(operators, EqualityComparer<ISymbol>.Default));
Compilation\QueryClauseInfoTests.cs (36)
36new SymbolInfo(ImmutableArray.Create<ISymbol>(obj, int32), CandidateReason.Inaccessible), 37new SymbolInfo(ImmutableArray.Create<ISymbol>(obj, int32), CandidateReason.Inaccessible)), 39new SymbolInfo(ImmutableArray.Create<ISymbol>(obj, int32), CandidateReason.Inaccessible), 40new SymbolInfo(ImmutableArray.Create<ISymbol>(obj, int32), CandidateReason.Inaccessible))); 52new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 53new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible)), 55new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 56new SymbolInfo(ImmutableArray.Create<ISymbol>(obj, int32), CandidateReason.Inaccessible))); 68new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 69new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible)), 71new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 72new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible))); 84new SymbolInfo(ImmutableArray.Create<ISymbol>(obj, int32), CandidateReason.Inaccessible), 85new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible)), 87new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 88new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible))); 92new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, obj), CandidateReason.Inaccessible), 93new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible)), 95new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 96new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible))); 100new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 101new SymbolInfo(ImmutableArray.Create<ISymbol>(obj, int32), CandidateReason.Inaccessible)), 103new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 104new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible))); 108new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 109new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, obj), CandidateReason.Inaccessible)), 111new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 112new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible))); 116new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Ambiguous), 117new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible)), 119new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 120new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible))); 124new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 125new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Ambiguous)), 127new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 128new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible)));
Compilation\ReferenceManagerTests.cs (2)
2188var a0 = c1.GetAssemblyOrModuleSymbol(refVectors40); 2189var a1 = c1.GetAssemblyOrModuleSymbol(refVectors41);
Compilation\SemanticModelAPITests.cs (36)
257var symbol1 = model1.GetDeclaredSymbol(vardecl); 258var symbol2 = model2.GetDeclaredSymbol(vardecl); 277var symbol1 = model1.GetDeclaredSymbol(vardecl); 278var symbol2 = model2.GetDeclaredSymbol(vardecl); 335var symbol1 = model1.GetSymbolInfo(statement.Expression).Symbol; 336var symbol2 = model2.GetSymbolInfo(statement.Expression).Symbol; 797Assert.Equal<ISymbol>(abType, xSym.Type); 823var cBaseType = model.GetSymbolInfo(cBase).Symbol; 868var pMethodSym = pTypeSym.GetMembers("PM").Single(); 1202var argsym1 = model.GetSymbolInfo(args.First().Expression).Symbol; 1203var argsym2 = model.GetSymbolInfo(args.Last().Expression).Symbol; 1366var symbol = info.Symbol; 1741var fieldSymbol = model.GetDeclaredSymbol(fieldDecl.Declaration.Variables.Single()); 1787var local = speculativeModel.GetDeclaredSymbol(declarator); 1840var local = speculativeModel.GetDeclaredSymbol(declarator); 1886var label = statModel.GetDeclaredSymbol(labeledStatement); 2082var symbol = info.Symbol; 2284var symbol = speculativeModel.GetDeclaredSymbol(declarator); 2393var local = speculativeModel.GetDeclaredSymbol(declarator); 2576var local = speculativeModel.GetDeclaredSymbol(declarator); 2610var param = speculativeModel.GetSymbolInfo(declarator.Initializer.Value).Symbol; 2647var label = speculativeModel.GetDeclaredSymbol(labeledStatement); 2713var symbol = speculativeModel.GetSymbolInfo(speculatedTypeSyntax).Symbol; 2924var symbol = model.GetSymbolInfo(cref.Type).Symbol; 2964var symbol = model.GetSymbolInfo(cref.Type).Symbol; 3009var symbol = model.GetSymbolInfo(cref.Type).Symbol; 3162var symbol = model.GetSymbolInfo(syntax).Symbol; 3646var oldSymbol = symbolInfo.Symbol; 3653var newSymbol = speculativeSymbolInfo.Symbol; 3785var firstParamType = ((ISymbol)exprInfo.CandidateSymbols.Single()).GetParameters().First().Type; 3879var symbol = model.LookupSymbols(syntax.SpanStart, name: "Alias").Single(); 3906var symbol = model.LookupSymbols(endPosition, name: "M0").Single(); 4062var discarded = model.GetEnclosingSymbol(match.Index); 4091var discarded = model.GetEnclosingSymbol(match.Index); 4116var discarded1 = model.GetEnclosingSymbol(source.LastIndexOf(" => x")); 4117var discarded2 = model.GetEnclosingSymbol(source.IndexOf(" => x"));
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (57)
62ISymbol rx = model.GetDeclaredSymbol(rxDecl.Variables.Single()); 81var symbol = model.GetDeclaredSymbol(decl); 127var symbol = model.GetDeclaredSymbol(cdns); 409var eventSymbol = model.GetDeclaredSymbol(eventDecl.Declaration.Variables[0]); 431var symbol = model.GetDeclaredSymbol(node); 453var symbol = model.GetDeclaredSymbol(node); 475var symbol = model.GetDeclaredSymbol(node); 570var symbol = model.GetDeclaredSymbol(localDecl.Declaration.Variables[0]); 592var symbol = model.GetDeclaredSymbol(localDecl.Declaration.Variables[0]); 620var symbol1 = (ISymbol)model.GetDeclaredSymbol(labeled1); 625var symbol2 = (ISymbol)model.GetDeclaredSymbol(labeled2); 691var symbol = model.GetDeclaredSymbol(node); 720var symbol = (ISymbol)model.GetDeclaredSymbol(switchLabel); 752var symbol1 = (ISymbol)model.GetDeclaredSymbol(switchLabel); 778var symbol = model.GetDeclaredSymbol(fieldDecl.Declaration.Variables[0]); 800var symbol = model.GetDeclaredSymbol(fieldDecl.Declaration.Variables[0]); 952Assert.Equal<ISymbol>(structSymbol, fSymbol.ContainingSymbol); 977Assert.Equal<ISymbol>(enumSymbol, mSymbol.ReturnType.OriginalDefinition); 985Assert.Equal<ISymbol>(structSymbol, mSymbol.Parameters[1].Type.OriginalDefinition); 1721Func<ISymbol, bool> isExtensionMethod = symbol => 1884Func<ISymbol, bool> isExtensionMethod = symbol => 2024private static void CheckSymbols(ImmutableArray<ISymbol> symbols, params string[] descriptions) 2029private static void CheckSymbolsUnordered(ImmutableArray<ISymbol> symbols, params string[] descriptions) 2167Func<int, INamespaceOrTypeSymbol, string, bool, ImmutableArray<ISymbol>> lookupAttributeTypeWithQualifier = (pos, qualifierOpt, name, isVerbatim) => 2186Func<int, string, bool, ImmutableArray<ISymbol>> lookupAttributeType = (pos, name, isVerbatim) => 2817var n1 = info.Symbol; 2976var dsyma2 = model.GetDeclaredSymbol(node1.Members[1]); 3317var symbol = model.GetDeclaredSymbol(paramNode); 3344var symbol = model.GetDeclaredSymbol(paramNode); 3370var symbol = model.GetDeclaredSymbol(paramNode); 3387var symbol = model.GetDeclaredSymbol(node); 3411var symbol = model.GetDeclaredSymbol(foreachNode); 3432var symbol = model.GetDeclaredSymbol(delegateNode); 3451var symbol = model.GetDeclaredSymbol(usingNode); 3481var symbol = model.GetDeclaredSymbol(foreachNode); 3504var symbol = model.GetDeclaredSymbol(foreachNode); 3531var symbol1 = model.GetDeclaredSymbol(foreachNode1); 3537var symbol2 = model.GetDeclaredSymbol(foreachNode2); 3568var symbol = model.GetDeclaredSymbol(catchDeclaration); 3589var symbol = model.GetDeclaredSymbol(methodDecl); 3614var symbol = model.GetDeclaredSymbol(methodDecl); 3642var symbol = model.GetDeclaredSymbol(enumMemberDecl); 3688var symbol = model.GetDeclaredSymbol(globalStmt); 3712var symbol = model.GetSemanticInfoSummary(gotoStatement.Expression).Symbol; 5130var symbol = model.GetDeclaredSymbol(node); 5309var initializedSymbol = model.GetSymbolInfo(initializers[1]).Symbol; 5361var initializedSymbol = model.GetSymbolInfo(valueInitializer).Symbol; 5404var initializedSymbol = model.GetSymbolInfo(initializers[1]).Symbol; 5452var initializedSymbol = model.GetSymbolInfo(initializers[1]).Symbol; 5495var initializedSymbol = model.GetSymbolInfo(initializers[0]).Symbol; 5547var initializedSymbol = model.GetSymbolInfo(valueInitializer).Symbol; 5590var initializedSymbol = model.GetSymbolInfo(initializers[0]).Symbol; 5638var initializedSymbol = model.GetSymbolInfo(initializers[0]).Symbol;
Compilation\SemanticModelGetSemanticInfoTests.cs (10)
338var symbol = semanticInfo.Symbol; 426var symbol = semanticInfo.Symbol; 4541var symbol = semanticInfo.Symbol; 6248var symbol = semanticInfo.Symbol; 6365var symbol = semanticInfo.Symbol; 13132var symbol = semanticInfo.CandidateSymbols[0]; 13166var symbol = semanticInfo.CandidateSymbols[0]; 13200var symbol = semanticInfo.CandidateSymbols[0]; 15372var infoSymbol = semanticModel.GetQueryClauseInfo(qc).OperationInfo.Symbol; 15376var infoSymbol2 = semanticModel.GetSymbolInfo(qe.Body.SelectOrGroup).Symbol;
Compilation\SymbolVisitorTests.cs (7)
27where T : ISymbol 31where T : ISymbol 39public override void DefaultVisit(ISymbol symbol) 195where T : ISymbol 199where T : ISymbol 207public override string DefaultVisit(ISymbol symbol) 382where T : ISymbol
DocumentationComments\CrefTests.cs (37)
915var expected = new ISymbol[] 1011var expected = new ISymbol[] 1110var expected = new ISymbol[] 2946var actualSymbol = model.GetSymbolInfo(crefSyntax).Symbol; 2970var actualTypeSymbol = model.GetSymbolInfo(crefSyntax.Container).Symbol; 2973var actualMethodSymbol1 = model.GetSymbolInfo(crefSyntax.Member).Symbol; 2976var actualMethodSymbol2 = model.GetSymbolInfo(((NameMemberCrefSyntax)crefSyntax.Member).Name).Symbol; 3017var actualTypeArgument = model.GetSymbolInfo(left.TypeArgumentList.Arguments.Single()).Symbol; 3032var actualTypeArgument = model.GetSymbolInfo(right.TypeArgumentList.Arguments.Single()).Symbol; 3075var actualIndexer = model.GetSymbolInfo(crefSyntax).Symbol; 3079var actualParameterType = model.GetSymbolInfo(crefSyntax.Parameters.Parameters.Single().Type).Symbol; 3102var actualOperator = model.GetSymbolInfo(crefSyntax).Symbol; 3106var actualParameterType = model.GetSymbolInfo(crefSyntax.Parameters.Parameters.Single().Type).Symbol; 3129var actualOperator = model.GetSymbolInfo(crefSyntax).Symbol; 3133var actualParameterType = model.GetSymbolInfo(crefSyntax.Parameters.Parameters.Single().Type).Symbol; 3137var actualReturnType = model.GetSymbolInfo(crefSyntax.Type).Symbol; 5088var expectedSymbols = new ISymbol[] { null, null, outerCtor, outerCtor }; 5598var actualSymbol = model.GetSymbolInfo(cref).Symbol; 5628var actualSymbol = model.GetSymbolInfo(cref).Symbol; 5716var symbol = model.GetSymbolInfo(cref).Symbol; 5798var typeSymbol = model.GetSymbolInfo(typeSyntax).Symbol; 5854var symbol = model.GetSymbolInfo(cref).Symbol; 5903var actualSymbol = model.GetSymbolInfo(cref).Symbol; 5927var actualSymbol = model.GetSymbolInfo(cref).Symbol; 5976var actualSymbol = model.GetSymbolInfo(cref).Symbol; 6028var actualSymbol = model.GetSymbolInfo(cref).Symbol; 6050var typeParameterSymbol = model.GetSymbolInfo(typeParameterSyntax).Symbol; 6074var methodSymbol = model.GetSymbolInfo(methodNameSyntax).Symbol; 6111var actualReturnTypeSymbol = model.GetSymbolInfo(returnTypeSyntax).Symbol; 6115var actualCrefSymbol = model.GetSymbolInfo(crefSyntax).Symbol; 6149var actualParameterTypeSymbol = model.GetSymbolInfo(parameterTypeSyntax).Symbol; 6153var actualCrefSymbol = model.GetSymbolInfo(crefSyntax).Symbol; 6191var parameterTypeSymbol = model.GetSymbolInfo(parameterTypeSyntax).Symbol; 6535var actualSymbol0 = model.GetSymbolInfo(crefs[0]).Symbol; 6538var actualSymbol1 = model.GetSymbolInfo(crefs[1]).Symbol; 6645private static ISymbol[] GetCrefOriginalDefinitions(SemanticModel model, IEnumerable<CrefSyntax> crefs) 7065var symbol = model.GetSymbolInfo(crefSyntaxes.Single()).Symbol;
DocumentationComments\DocumentationCommentIDTests.cs (2)
145var symbol = model.GetSymbolInfo(syntax).Symbol; 166var symbol = model.GetDeclaredSymbol(syntax);
SymbolDisplay\SymbolDisplayTests.cs (19)
2400var goo = a.GetMembers("_Prop").Single(); 4962var goo = a.GetMembers("Goo").Single(); 5154var type = outer.GetMembers("Inner").Single(); 5155var method = outer.GetMembers("M").Single(); 5156var property = outer.GetMembers("P").Single(); 5157var field = outer.GetMembers("F").Single(); 5158var @event = outer.GetMembers("E").Single(); 5159var @delegate = outer.GetMembers("D").Single(); 5160var error = outer.GetMembers("Error").Single(); 5803var method = type.GetMembers("F").Single(); 5804var property = type.GetMembers("P").Single(); 5805var indexer = type.GetMembers().Where(m => m.Kind == SymbolKind.Property && ((IPropertySymbol)m).IsIndexer).Single(); 6007var method = type.GetMembers("F").Single(); 6008var property = type.GetMembers("P").Single(); 6009var indexer = type.GetMembers().Where(m => m.Kind == SymbolKind.Property && ((IPropertySymbol)m).IsIndexer).Single(); 8026var symbol = model.GetSymbolInfo(variable).Symbol; 8120var symbol = model.GetSymbolInfo(constructor).Symbol; 8180var symbol = model.GetSymbolInfo(constructor).Symbol; 9047var op = model.GetSymbolInfo(binaryExpression).Symbol;
Symbols\AnonymousTypesSemanticsTests.cs (5)
589var method = info.Symbol; 657var method = info.Symbol; 678var method = info.Symbol; 699var method = info.Symbol; 1965private void AssertCannotConstruct(ISymbol type)
Symbols\AnonymousTypesSymbolTests.cs (1)
1651foreach (var m in mems)
Symbols\ConversionTests.cs (2)
2141var symbol = model.GetSymbolInfo(syntax).Symbol; 2175var symbol = model.GetSymbolInfo(syntax).Symbol;
Symbols\CovariantReturnTests.cs (2)
4024var lastReference = compilation.GetAssemblyOrModuleSymbol(compilation.References.Last()); 4262var lastReference = compilation.GetAssemblyOrModuleSymbol(compilation.References.Last());
Symbols\ExtensionMethodTests.cs (7)
2435var symbol = info.Symbol; 3144var firstInvocationSymbol = model.GetSymbolInfo(firstInvocation).Symbol; 3145var firstInvocationExpressionSymbol = model.GetSymbolInfo(firstInvocationExpression).Symbol; 3149var secondInvocationSymbol = model.GetSymbolInfo(secondInvocation).Symbol; 3150var secondInvocationExpressionSymbol = model.GetSymbolInfo(secondInvocationExpression).Symbol; 3871var setMember = model.LookupSymbols(instance.Position, baseClass, "SetMember", includeReducedExtensionMethods: true).Single(); 3963var setMember = model.LookupSymbols(instance.Position, baseClass, "SetMember", includeReducedExtensionMethods: true).Single();
Symbols\InterfaceImplementationTests.cs (1)
2497var implementation = derivedType.FindImplementationForInterfaceMember(baseType.Interfaces().Single().GetMember("GetHashCode"));
Symbols\LocalFunctionTests.cs (4)
447var symbol = model.GetSymbolInfo(invocation).Symbol; 471var symbol = model.GetSymbolInfo(invocation).Symbol; 500var symbol = model.GetSymbolInfo(invocation).Symbol; 523var symbol = model.GetSymbolInfo(invocation).Symbol;
Symbols\Metadata\PE\HasUnsupportedMetadata.cs (8)
166var f1 = c3.GetMembers("F1").Single(); 170var m1 = c3.GetMembers("M1").Single(); 178var e1 = c3.GetMembers("E1").Single(); 182var p1 = c3.GetMembers("P1").Single(); 370var f1 = c3.GetMembers("F1").Single(); 374var m1 = c3.GetMembers("M1").Single(); 382var e1 = c3.GetMembers("E1").Single(); 386var p1 = c3.GetMembers("P1").Single();
Symbols\Metadata\PE\LoadingMethods.cs (9)
1180foreach (var m in compilation.GetTypeByMetadataName("cls1").GetMembers()) 1185foreach (var m in compilation.GetTypeByMetadataName("Instance_vs_Static").GetMembers()) 1190foreach (var m in compilation.GetTypeByMetadataName("ReturnAValue1").GetMembers()) 1195foreach (var m in compilation.GetTypeByMetadataName("ReturnAValue2").GetMembers()) 1200foreach (var m in compilation.GetTypeByMetadataName("Generic1").GetMembers()) 1205foreach (var m in compilation.GetTypeByMetadataName("Generic2").GetMembers()) 1210foreach (var m in compilation.GetTypeByMetadataName("HasParameter").GetMembers()) 1215foreach (var m in compilation.GetTypeByMetadataName("Virtual").GetMembers()) 1242foreach (var m in compilation.GetTypeByMetadataName("Microsoft.FSharp.Control.IDelegateEvent`1").GetMembers())
Symbols\Retargeting\RetargetExplicitInterfaceImplementation.cs (4)
81foreach (var member in classC.GetMembers()) 389var interfaceV2Method1 = interfaceV2.GetMembers("Method1").Single(); 390var interfaceV2Property1 = interfaceV2.GetMembers("Property1").Single(); 391var interfaceV2Event1 = interfaceV2.GetMembers("Event1").Single();
Symbols\Source\DeclaringSyntaxNodeTests.cs (15)
24ISymbol symbol, 53ISymbol symbol, 78ISymbol symbol, 141var sym = model.GetDeclaredSymbol(node); 196foreach (ISymbol s in types) 208foreach (ISymbol s in c1.GetTypeMembers()) 272foreach (ISymbol memb in localA1Type.GetMembers()) 344Assert.Equal<ISymbol>(localType, symbol); 354foreach (var member in localType.GetMembers()) 377Assert.Equal<ISymbol>(member, propSymbol); 454foreach (ISymbol s in c1.TypeParameters) 521foreach (ISymbol memb in e1.GetMembers()) 532foreach (ISymbol memb in c1.GetMembers()) 555foreach (ISymbol memb in constructedC1.GetMembers()) 575foreach (ISymbol memb in c2.GetMembers())
Symbols\Source\FieldTests.cs (2)
97foreach (var g in gs) 122foreach (var f in fs)
Symbols\Source\NullablePublicAPITests.cs (16)
2839var event1 = model.GetSymbolInfo(memberAccess[2]).Symbol; 2840var event2 = model.GetSymbolInfo(memberAccess[3]).Symbol; 3112foreach (var symbol in symbolInfo.CandidateSymbols) 3538var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 3599var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 3668var o2Symbol = model.GetSymbolInfo(o2Reference).Symbol; 3855var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 3857var o2Symbol = model.GetDeclaredSymbol(o2Declaration); 3914var fieldLambdaSymbol = model.GetSymbolInfo(fieldLambda).Symbol; 3928var propertyLambdaSymbol = model.GetSymbolInfo(propertyLambda).Symbol; 3976var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 4048var o2Symbol = model.GetDeclaredSymbol(o2Decl); 4051var o1RefSymbol = model.GetSymbolInfo(o1Ref).Symbol; 4054var o2RefSymbol = model.GetSymbolInfo(o2Ref).Symbol; 4112var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 4175var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol;
Symbols\Source\PropertyTests.cs (3)
399foreach (var m in mems) 418foreach (var m in mems) 1927foreach (var x in xs)
Symbols\Source\SourcePlusMetadataTests.cs (2)
232var srcSym = classC.GetMembers("I1.Method").Single(); 237var metaSym = metaType.GetMembers("I1.Method").First();
Symbols\Source\UsingAliasTests.cs (8)
59var b2 = info2.Symbol; 65var b3 = info3.Symbol; 119var b2 = info2.Symbol; 125var b3 = info3.Symbol; 174var b2 = info2.Symbol; 180var b3 = info3.Symbol; 232var b2 = info2.Symbol; 238var b3 = info3.Symbol;
Symbols\SymbolEqualityTests.cs (14)
126var nonNullM = model.GetSymbolInfo(invocations[0]).Symbol; 127var nullM = model.GetSymbolInfo(invocations[1]).Symbol; 132var nonNullOriginal = nonNullM.OriginalDefinition; 133var nullOriginal = nullM.OriginalDefinition; 170var nonNullSubstituted = nonNullM.ContainingType.GetMembers("M").Single(); 171var nullSubstituted = nullM.ContainingType.GetMembers("M").Single(); 377ISymbol symbol2 = null; 378ISymbol symbol3 = null; 416var member1 = model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0]); 417var member2 = model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0]); 595var create1Symbol = model.GetSymbolInfo(create1Syntax).Symbol; 596var create2Symbol = model.GetSymbolInfo(create2Syntax).Symbol; 971private void VerifyEquality(ISymbol symbol1, ISymbol symbol2, bool expectedIncludeNullability)
Symbols\TypeTests.cs (9)
468var field1 = classTest.GetMembers("intAryField").Single(); 622foreach (var m in a.GetMembers()) 639var obj = a.GetMembers("field1").Single(); 647var dyn = a.GetMembers("field2").Single(); 929var memSym = typeSym.GetMembers("Main").First(); 1388var iGooGetGoo = comp.GetTypeByMetadataName("Bar+IGoo").GetMembers("GetGoo").Single(); 1506var mem = topType.GetMembers("field01").Single(); 1615var mem = topType.GetMembers("efield").Single(); 1857var symbol = info.Symbol;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Diagnostics\DiagnosticTest.cs (1)
2856public override string GetErrorDisplayString(ISymbol symbol)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (26)
CompilationTestUtils.cs (10)
30where TSymbol : ISymbol 60where TSymbol : ISymbol 67where TSymbol : ISymbol 72public static void CheckSymbol(ISymbol symbol, string description) 165Assert.Equal<ISymbol>(typeParameter.ContainingSymbol, constructedFrom); 207public ISymbol Symbol; 209public ImmutableArray<ISymbol> CandidateSymbols = ImmutableArray.Create<ISymbol>(); 218public ImmutableArray<ISymbol> MemberGroup = ImmutableArray.Create<ISymbol>();
CSharpTestBase.cs (1)
2131(ControlFlowGraph graph, ISymbol associatedSymbol) = ControlFlowGraphVerifier.GetControlFlowGraph(syntaxNode, model);
Extensions.cs (11)
168public static ISymbol GetMember(this Compilation compilation, string qualifiedName) 174public static T GetMember<T>(this Compilation compilation, string qualifiedName) where T : ISymbol 219public static ImmutableArray<T> GetMembers<T>(this Compilation compilation, string qualifiedName) where T : ISymbol 257private static ImmutableArray<ISymbol> GetMembers(INamespaceOrTypeSymbol container, string qualifiedName, out INamespaceOrTypeSymbol lastContainer) 296public static ISymbol GetMember(this INamespaceOrTypeSymbol container, string qualifiedName) 317public static T GetMember<T>(this INamespaceOrTypeSymbol symbol, string qualifiedName) where T : ISymbol 736public static ISymbol GetSpecialTypeMember(this Compilation compilation, SpecialMember specialMember) 751public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol member) 810public static ITypeSymbol GetTypeOrReturnType(this ISymbol symbol) 844public static ISymbol ConstructedFrom(this ISymbol symbol)
FunctionPointerUtilities.cs (1)
255Assert.Equal<ISymbol>(signatureType, semanticInfo.Type, SymbolEqualityComparer.Default);
SymbolUtilities.cs (3)
80public static string ListToSortedString<TSymbol>(this List<TSymbol> listOfSymbols) where TSymbol : ISymbol 116public static string[] ToTestDisplayStrings(this IEnumerable<ISymbol> symbols) 127public static string ToTestDisplayString(this ISymbol symbol, bool includeNonNullable)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
CodeGen\WinRTCollectionTests.cs (1)
7425var addMethod = model.GetSymbolInfo(add).Symbol;
Microsoft.CodeAnalysis.CSharp.Workspaces (169)
Classification\SyntaxClassification\NameSyntaxClassifier.cs (2)
100foreach (var symbol in symbolInfo.CandidateSymbols) 127[NotNullWhen(returnValue: true)] ISymbol? symbol,
CodeGeneration\CSharpSyntaxGenerator.cs (2)
1767ImmutableArray<ISymbol> explicitInterfaceImplementations, 1805private static ExplicitInterfaceSpecifierSyntax CreateExplicitInterfaceSpecifier(ImmutableArray<ISymbol> explicitInterfaceImplementations)
ExternalAccess\Pythia\Api\PythiaSymbolExtensions.cs (11)
11public static string ToNameDisplayString(this ISymbol symbol) 14public static ITypeSymbol? GetMemberType(this ISymbol symbol) 17public static ITypeSymbol? GetSymbolType(this ISymbol? symbol) 20public static ISymbol? GetAnySymbol(this SymbolInfo info) 23public static ImmutableArray<T> FilterToVisibleAndBrowsableSymbols<T>(this ImmutableArray<T> symbols, bool hideAdvancedMembers, Compilation compilation) where T : ISymbol 26public static bool IsAccessibleWithin(this ISymbol symbol, ISymbol within, ITypeSymbol? throughType = null) 32public static ISymbol? GetOriginalUnreducedDefinition(this ISymbol? symbol) 35public static bool IsAwaitableNonDynamic(this ISymbol? symbol, SemanticModel semanticModel, int position) 38public static bool IsExtensionMethod(this ISymbol symbol)
Recommendations\CSharpRecommendationServiceRunner.cs (16)
72private ImmutableArray<ISymbol> GetSymbolsForCurrentContext() 246private ImmutableArray<ISymbol> GetSymbolsForGlobalStatementContext() 267private ImmutableArray<ISymbol> GetSymbolsForTypeArgumentOfConstraintClause() 279return ImmutableArray<ISymbol>.CastUp(symbols); 297private ImmutableArray<ISymbol> GetSymbolsForLabelContext() 308private ImmutableArray<ISymbol> GetSymbolsForTypeOrNamespaceContext() 334private ImmutableArray<ISymbol> GetSymbolsForExpressionOrStatementContext() 360ImmutableArray<ISymbol> symbols; 397ISymbol symbol, 513private static ImmutableArray<ISymbol> FilterOutUncapturableParameters(ImmutableArray<ISymbol> symbols, SyntaxNode contextNode) 762ISymbol? containerSymbol = containerType; 863ISymbol symbol, 898private ImmutableArray<ISymbol> GetUnnamedSymbols(ExpressionSyntax originalExpression) 911using var _ = ArrayBuilder<ISymbol>.GetInstance(out var symbols); 927private void AddIndexers(ITypeSymbol container, ArrayBuilder<ISymbol> symbols)
Recommendations\CSharpRecommendationServiceRunner_Conversions.cs (5)
135private void AddConversions(ITypeSymbol container, ArrayBuilder<ISymbol> symbols) 153ITypeSymbol container, INamedTypeSymbol containerWithoutNullable, ArrayBuilder<ISymbol> symbols) 201ITypeSymbol container, INamedTypeSymbol containerWithoutNullable, ArrayBuilder<ISymbol> symbols) 229ITypeSymbol container, INamedTypeSymbol containerWithoutNullable, ArrayBuilder<ISymbol> symbols, ImmutableArray<SpecialType> specialTypes) 266ITypeSymbol container, INamedTypeSymbol containerWithoutNullable, ArrayBuilder<ISymbol> symbols)
Recommendations\CSharpRecommendationServiceRunner_Operators.cs (1)
19private static void AddOperators(ITypeSymbol container, ArrayBuilder<ISymbol> symbols)
Rename\CSharpRenameRewriterLanguageService.cs (22)
58private readonly ISymbol _renamedSymbol; 354var symbol = symbols[0]; 361var sourceDefinition = SymbolFinder.FindSourceDefinition(symbol, _solution, _cancellationToken); 466IEnumerable<ISymbol> symbols; 537var symbol = _speculativeModel.GetSymbolInfo(token.Parent, _cancellationToken).Symbol; 739IEnumerable<ISymbol> newReferencedSymbols) 779ISymbol renamedSymbol, 780ISymbol renameSymbol, 781IEnumerable<ISymbol> referencedSymbols, 846var properties = new List<ISymbol>(); 847foreach (var referencedSymbol in referencedSymbols) 926private static async Task<ISymbol?> GetVBPropertyFromAccessorOrAnOverrideAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken) 932var property = ((IMethodSymbol)symbol).AssociatedSymbol!; 939var originalSourceSymbol = SymbolFinder.FindSourceDefinition(symbol.GetOverriddenMember(), solution, cancellationToken); 955ArrayBuilder<Location> conflicts, IEnumerable<ISymbol> symbols, 958foreach (var symbol in symbols) 975ISymbol renameSymbol, ISymbol renamedSymbol, IEnumerable<ReferenceLocation> implicitReferenceLocations, CancellationToken cancellationToken) 1020ISymbol renamedSymbol, 1041foreach (var symbol in implicitSymbols) 1088public override void TryAddPossibleNameConflicts(ISymbol symbol, string replacementText, ICollection<string> possibleNameConflicts)
Simplification\CSharpSimplificationService.Expander.cs (16)
546var symbol = _semanticModel.GetSymbolInfo(originalSimpleName.Identifier).Symbol; 735private static ExpressionSyntax TryAddTypeArgumentToIdentifierName(ExpressionSyntax newNode, ISymbol symbol) 759private IList<ISymbol> TypeArgumentSymbolsPresentInName(SimpleNameSyntax simpleName) 761var typeArgumentSymbols = new List<ISymbol>(); 768var symbol = _semanticModel.GetSymbolInfo(typeArgument).Symbol; 805private static bool IsTypeArgumentDefinedRecursive(ISymbol symbol, IList<ISymbol> typeArgumentSymbols, bool enterContainingSymbol) 812var typeArgumentsInSymbol = new List<ISymbol>(); 815var typeArgumentsInOriginalDefinition = new List<ISymbol>(); 826private static void TypeArgumentsInAllContainingSymbol(ISymbol symbol, IList<ISymbol> typeArgumentSymbols, bool enterContainingSymbol, bool isRecursive) 887ISymbol symbol, 923var displaySymbol = replaceNode 925: (symbol.ContainingType ?? (ISymbol)symbol.ContainingNamespace); 1045var targetSymbol = SimplificationHelpers.GetOriginalSymbolInfo(_semanticModel, memberAccess.Name); 1095var newContainingType = _semanticModel.GetSpeculativeSymbolInfo(speculationPosition, containingTypeSyntax, SpeculativeBindingOption.BindAsExpression).Symbol;
Simplification\Reducers\CSharpExtensionMethodReducer.cs (2)
114var oldSymbol = semanticModel.GetSymbolInfo(node).Symbol; 115var newSymbol = semanticModel.GetSpeculativeSymbolInfo(
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (2)
74ISymbol symbol, CancellationToken cancellationToken, out IAliasSymbol aliasReplacement) 257private static bool ValidateAliasForTarget(IAliasSymbol aliasReplacement, SemanticModel semanticModel, ExpressionSyntax node, ISymbol symbol)
Simplification\Simplifiers\ExpressionSimplifier.CandidateSymbolEqualityComparer.cs (4)
16private sealed class CandidateSymbolEqualityComparer : IEqualityComparer<ISymbol> 24public bool Equals(ISymbol x, ISymbol y) 34public int GetHashCode(ISymbol obj)
Simplification\Simplifiers\ExpressionSimplifier.cs (11)
119var symbol = SimplificationHelpers.GetOriginalSymbolInfo(semanticModel, memberAccess); 126semanticModel.GetMemberGroup(memberAccess, cancellationToken) is [ISymbol member, ..] 224ISymbol actualSymbol, 225out ImmutableArray<ISymbol> speculativeSymbols, 226out ImmutableArray<ISymbol> speculativeNamespacesAndTypes) 243private static bool IsReplacementCandidate(ISymbol actualSymbol, ImmutableArray<ISymbol> speculativeSymbols, ImmutableArray<ISymbol> speculativeNamespacesAndTypes) 317ISymbol symbol, 416var leftSymbol = SimplificationHelpers.GetOriginalSymbolInfo(semanticModel, left); 419var rightSymbol = SimplificationHelpers.GetOriginalSymbolInfo(semanticModel, right);
Simplification\Simplifiers\NameSimplifier.cs (2)
72var symbol = SimplificationHelpers.GetOriginalSymbolInfo(semanticModel, name); 259var typeSymbol = semanticModel.GetSymbolInfo(name, cancellationToken).Symbol;
Simplification\Simplifiers\QualifiedCrefSimplifier.cs (3)
42var symbol = symbolInfo.Symbol; 82var oldSymbol = semanticModel.GetSymbolInfo(crefSyntax, cancellationToken).Symbol; 89var newSymbol = semanticModel.GetSpeculativeSymbolInfo(crefSyntax.SpanStart, replacement, speculativeBindingOption).Symbol;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (3)
369var symbol = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol; 436private static bool CanReplace(ISymbol symbol) 977var symbol = semanticModel.GetSymbolInfo(current, cancellationToken).Symbol ?? semanticModel.GetDeclaredSymbol(current, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
328var exprSymbol = semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (6)
39public static ImmutableArray<ISymbol> LookupName( 102public static ImmutableArray<ISymbol> LookupName( 288var symbol = semanticModel.GetDeclaredSymbol(type.Parent.Parent.Parent, cancellationToken); 300var symbol = semanticModel.GetDeclaredSymbol(variableDeclaration.Variables[0], cancellationToken); 496public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, VariableDeclaratorSyntax syntax, CancellationToken cancellationToken) 502public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SingleVariableDesignationSyntax syntax, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (11)
58public ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 245public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 262public ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 265public ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 270public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken) 277AssignmentExpressionSyntax _ when token.Kind() == SyntaxKind.EqualsToken => GetDeconstructionAssignmentMethods(semanticModel, node).As<ISymbol>(), 278ForEachVariableStatementSyntax _ when token.Kind() == SyntaxKind.InKeyword => GetDeconstructionForEachMethods(semanticModel, node).As<ISymbol>(), 283static ImmutableArray<ISymbol> GetCallingConventionSymbols(SemanticModel model, FunctionPointerUnmanagedCallingConventionSyntax syntax) 296private ImmutableArray<ISymbol> GetSymbolInfo(SemanticModel semanticModel, SyntaxNode node, SyntaxToken token, CancellationToken cancellationToken) 371public ImmutableArray<IMethodSymbol> GetLocalFunctionSymbols(Compilation compilation, ISymbol symbol, CancellationToken cancellationToken) 422public async Task<ISymbol?> GetInterceptorSymbolAsync(Document document, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (14)
995foreach (var sym in type.GetMembers(opName)) 1134var symbol = semanticModel.GetDeclaredSymbol(variableDeclarator, cancellationToken); 1236var oldSymbolInfo = originalSemanticModel.GetSymbolInfo(currentOld, cancellationToken).Symbol; 1237var newSymbolInfo = rewrittenSemanticModel.GetSymbolInfo(currentNew, cancellationToken).Symbol; 1289var originalMemberSymbol = originalSemanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol; 1294var rewrittenMemberSymbol = rewrittenSemanticModel.GetSymbolInfo(rewrittenMemberAccessExpression, cancellationToken).Symbol; 1360var implementationMember = rewrittenContainingType.FindImplementationForInterfaceMember(originalMemberSymbol); 1374for (var current = rewrittenMemberSymbol; current != null; current = current.GetOverriddenMember()) 1398var originalMemberSymbol = originalSemanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol; 1403var rewrittenMemberSymbol = rewrittenSemanticModel.GetSymbolInfo(rewrittenMemberAccessExpression, cancellationToken).Symbol; 1410private static bool IsComplementaryDelegateInvoke(ISymbol originalMemberSymbol, ISymbol rewrittenMemberSymbol) 1473ISymbol originalMemberSymbol, ISymbol rewrittenMemberSymbol, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (4)
567var originalSymbol = this.OriginalSemanticModel.GetSymbolInfo(ctorInitializer, CancellationToken).Symbol; 568var newSymbol = this.SpeculativeSemanticModel.GetSymbolInfo(newCtorInitializer, CancellationToken).Symbol; 574var originalSymbol = this.OriginalSemanticModel.GetCollectionInitializerSymbolInfo(originalInitializer, CancellationToken).Symbol; 575var newSymbol = this.SpeculativeSemanticModel.GetCollectionInitializerSymbolInfo(newInitializer, CancellationToken).Symbol;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
106var conflict = semanticModel.GetSpeculativeSymbolInfo(typeName.SpanStart, candidateReplacementNode, SpeculativeBindingOption.BindAsTypeOrNamespace).Symbol;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (4)
210IEnumerable<ISymbol> implementations) 212var implementation = implementations.FirstOrDefault(); 248ISymbol symbol, 269public static T? GetReuseableSyntaxNodeForSymbol<T>(ISymbol symbol, CSharpCodeGenerationContextInfo info) where T : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
196var members = new List<ISymbol>(); 907public override TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CSharpCodeGenerationContextInfo info, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (2)
104ImmutableArray<ISymbol> members, 141IList<ISymbol> newMembers,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamespaceGenerator.cs (2)
88IList<ISymbol> newMembers, 150private static UsingDirectiveSyntax? GenerateUsingDirective(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (2)
55var symbol = model.GetSymbolInfo(fullName).Symbol; 118foreach (var member in type.GetMembers())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2015var enclosingSymbol = semanticModel.GetEnclosingSymbol(position, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
113public static async Task<ISymbol?> FindApplicableAliasAsync(this ITypeSymbol type, int position, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (3)
29public override ExpressionSyntax DefaultVisit(ISymbol symbol) 32private static TExpressionSyntax AddInformationTo<TExpressionSyntax>(TExpressionSyntax syntax, ISymbol symbol) 108ISymbol symbol, ExpressionSyntax container, SimpleNameSyntax syntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (2)
35public override TypeSyntax DefaultVisit(ISymbol node) 38private static TTypeSyntax AddInformationTo<TTypeSyntax>(TTypeSyntax syntax, ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeSyntaxExtensions.cs (1)
45var firstSymbol = symbols.FirstOrDefault();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSemanticFactsService.cs (1)
36protected override IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode container, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSymbolDeclarationService.cs (1)
22public ImmutableArray<SyntaxReference> GetDeclarations(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (4)
1987var memberSymbol = GetDeclaredMemberSymbolFromOriginalSemanticModel(declaration); 2041var symbol = GetDeclaredMemberSymbolFromOriginalSemanticModel(declaration); 2050private ISymbol GetDeclaredMemberSymbolFromOriginalSemanticModel(SyntaxNode declarationInCurrentTree) 2206private ImmutableArray<TypeInferenceInfo> InferTypeBasedOnLaterUsage(ISymbol symbol, SyntaxNode afterNode)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\CSharpInitializeParameterService.cs (2)
43ISymbol fieldOrProperty, 109protected override Task<Solution> TryAddAssignmentForPrimaryConstructorAsync(Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (2)
36ISymbol fieldOrProperty, 98ISymbol fieldOrProperty,
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (53)
CodeGeneration\AddImportsTests.cs (1)
50var symbol = model.GetSymbolInfo(o).Symbol;
CodeGeneration\SymbolEditorTests.cs (28)
48private static async Task<IEnumerable<ISymbol>> GetSymbolsAsync(Solution solution, string name) 79var symbol = (await GetSymbolsAsync(solution, "C")).First(); 111var symbol = (await GetSymbolsAsync(solution, "C")).First(); 148var symbol = (await GetSymbolsAsync(solution, "C")).First(); 280var symbol = (await GetSymbolsAsync(solution, "C")).First(); 355var symbol = (await GetSymbolsAsync(solution, "C")).First(); 392var symbol = (await GetSymbolsAsync(solution, "C")).First(); 433var symbol = (await GetSymbolsAsync(solution, "C")).First(); 479var symbol = (await GetSymbolsAsync(solution, "C")).First(); 530var member = symbol.GetMembers("m").First(); 556var symbol = (await GetSymbolsAsync(solution, "C")).First(); 563var reboundSymbol = await editor.GetCurrentSymbolAsync(symbol); 593var symbol = (await GetSymbolsAsync(solution, "C")).First(); 600var reboundSymbol = await editor.GetCurrentSymbolAsync(symbol); 620var symbol = (await GetSymbolsAsync(solution, "C")).First(); 650var symbol = (await GetSymbolsAsync(solution, "C")).First(); 679var symbol = (await GetSymbolsAsync(solution, "C")).First(); 712var symbolX = symbol.GetMembers("X").First(); 713var symbolY = symbol.GetMembers("Y").First(); 767var newSymbolC = await editor.SetBaseTypeAsync(symbol, g => g.IdentifierName("A")); 808var newSymbolC = await editor.SetBaseTypeAsync(symbol, g => g.IdentifierName("A")); 841var newSymbolC = await editor.SetBaseTypeAsync(symbol, g => g.IdentifierName("A")); 907var newSymbolC = await editor.SetBaseTypeAsync(symbol, g => null); 948var newSymbolC = await editor.SetBaseTypeAsync(symbol, g => null); 981var newSymbolC = await editor.SetBaseTypeAsync(symbol, g => null); 1006var newSymbolC = await editor.SetBaseTypeAsync(symbol, g => null); 1034var property = typeC.GetMembers().First(m => m.Kind == SymbolKind.Property); 1044var iproperty = typeI.GetMembers().First(m => m.Kind == SymbolKind.Property);
CodeGeneration\SyntaxGeneratorTests.cs (24)
2245var method = type.GetMembers("M").Single(); 2266var method = type.GetMembers("M").Single(); 2287var method = type.GetMembers("M").Single(); 2308var method = type.GetMembers("M").Single(); 2329var method = type.GetMembers(WellKnownMemberNames.InstanceConstructorName).Single(); 2351var property = type.GetMembers("Prop").Single(); 2369var property = type.GetMembers("Prop").Single(); 2392var property = type.GetMembers("Accept").Single(); 2420var property = type.GetMembers("Accept").Single(); 2448var property = type.GetMembers("Accept").Single(); 2479var property = type.GetMembers("Accept").Single(); 2513var method = type.GetMembers().Single(m => m is IMethodSymbol { MethodKind: MethodKind.ExplicitInterfaceImplementation }); 2514var property = type.GetMembers().Single(m => m is IPropertySymbol { IsIndexer: false }); 2515var indexer = type.GetMembers().Single(m => m is IPropertySymbol { IsIndexer: true }); 2516var ev = type.GetMembers().Single(m => m is IEventSymbol); 2556var field = type.GetMembers("F").Single(); 2579var field = type.GetMembers("F").Single(); 2589var field = _emptyCompilation.GetSpecialType(SpecialType.System_UInt32).GetMembers(nameof(UInt32.MaxValue)).Single(); 2609var method = type.GetMembers(WellKnownMemberNames.DestructorName).Single(); 4709var symbol = comp.GlobalNamespace.GetMembers("C").First().GetMembers("M").First(); 4727var symbol = comp.GlobalNamespace.GetMembers("C").First().GetMembers("X").First(); 4744var symbol = comp.GlobalNamespace.GetMembers("C").First().GetMembers("MyEvent").First(); 4769var symbol = comp.GlobalNamespace.GetMembers("C2").First().GetMembers("MyEvent").First(); 5014var declaration = semanticModel.GetDeclaredSymbol(node);
Microsoft.CodeAnalysis.EditorFeatures (20)
CodeDefinitionWindow\DefinitionContextTracker.cs (1)
169var symbol = await SymbolFinder.FindSymbolAtPositionAsync(
GoToDefinition\GoToDefinitionHelpers.cs (2)
17ISymbol symbol, 31ISymbol symbol,
InlineRename\AbstractEditorInlineRenameService.SymbolRenameInfo.cs (1)
52public ISymbol RenameSymbol => _info.Symbol!;
IRefactorNotifyService.cs (2)
23bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure); 33bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure);
Navigation\AbstractDefinitionLocationService.cs (4)
129Project project, int position, ISymbol symbol, Document originalDocument, CancellationToken cancellationToken) 258ISymbol? otherPart = symbol is IMethodSymbol method ? method.PartialDefinitionPart ?? method.PartialImplementationPart : null; 277ISymbol symbolToNavigateTo, int caretPosition, Document document, CancellationToken cancellationToken) 293var candidateTypeSymbol = symbolToNavigateTo is ITypeSymbol
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (3)
89var symbol = await TryGetSymbolAsync(solutionWithOriginalName, document.Id, cancellationToken).ConfigureAwait(false); 205private async Task<ISymbol> TryGetSymbolAsync(Solution solutionWithOriginalName, DocumentId documentId, CancellationToken cancellationToken) 259ISymbol symbol,
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingSolutionSet.cs (2)
13ISymbol symbolToRename, 17public ISymbol Symbol { get; } = symbolToRename;
RenameTracking\RenameTrackingTaggerProvider.TrackingSession.cs (3)
219private TriggerIdentifierKind DetermineIfRenamableSymbols(IEnumerable<ISymbol> symbols, Document document) 221foreach (var symbol in symbols) 235private TriggerIdentifierKind DetermineIfRenamableSymbol(ISymbol symbol, Document document, SyntaxToken token)
Shared\Extensions\IRefactorNotifyServiceExtensions.cs (2)
15ISymbol symbol, 34ISymbol symbol,
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (8)
ChangeSignature\TestChangeSignatureOptionsService.cs (1)
25ISymbol symbol,
ExtractInterface\TestExtractInterfaceOptions.cs (3)
21public ImmutableArray<ISymbol> AllExtractableMembers { get; private set; } 30public IEnumerable<ISymbol> ChosenMembers { get; set; } 35ImmutableArray<ISymbol> extractableMembers,
MoveStaticMembers\TestMoveStaticMembersService.cs (1)
37public MoveStaticMembersOptions GetMoveMembersToTypeOptions(Document document, INamedTypeSymbol selectedType, ImmutableArray<ISymbol> selectedNodeSymbols)
PullMemberUp\TestPullMemberUpService.cs (1)
29public PullMembersUpOptions GetPullMemberUpOptions(Document document, ImmutableArray<ISymbol> selectedNodeSymbols)
RenameTracking\MockRefactorNotifyService.cs (2)
22public bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure) 34public bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities2 (6)
Utilities\GoToHelpers\MockSymbolNavigationService.vb (2)
19Public Function GetNavigableLocationAsync(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Task(Of INavigableLocation) Implements ISymbolNavigationService.GetNavigableLocationAsync 24Public Function TrySymbolNavigationNotifyAsync(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Task(Of Boolean) Implements ISymbolNavigationService.TrySymbolNavigationNotifyAsync
Utilities\MockSymbolNavigationServiceProvider.vb (4)
36Public TryNavigateToSymbolProvidedSymbol As ISymbol 39Public TrySymbolNavigationNotifyProvidedSymbol As ISymbol 48Public Function GetNavigableLocationAsync(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Task(Of INavigableLocation) Implements ISymbolNavigationService.GetNavigableLocationAsync 55symbol As ISymbol,
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (127)
CodeGeneration\CodeGenerationTests.cs (14)
40IList<ISymbol> imports = null, 510ImmutableArray<Func<SemanticModel, ISymbol>> members = default, 568var attributeTarget = testContext.SemanticModel.GetDeclaredSymbol(taggedNode); 585ImmutableArray<Func<SemanticModel, ISymbol>> getNewMembers = default, 612var allMembers = new List<ISymbol>(); 695internal static ImmutableArray<Func<SemanticModel, ISymbol>> Members(params Func<SemanticModel, ISymbol>[] m) 712private static ImmutableArray<ISymbol> GetSymbols(ImmutableArray<Func<SemanticModel, ISymbol>> members, TestContext context) 719private static Func<SemanticModel, ISymbol> CreateEnumField(string name, object value) 726internal static Func<SemanticModel, ISymbol> CreateField(Accessibility accessibility, Editing.DeclarationModifiers modifiers, Type type, string name) 909public IEnumerable<ISymbol> GetAnnotatedDeclaredSymbols(string key, SemanticModel semanticModel) 914yield return GetSelectedSymbol<ISymbol>(span, semanticModel); 919where T : class, ISymbol
CodeGeneration\CodeGenerationTests.CSharp.cs (1)
1375var method = context.GetAnnotatedDeclaredSymbols("method", context.SemanticModel).Single();
MetadataAsSource\AbstractMetadataAsSourceTests.cs (2)
71var navigationSymbol = await context.GetNavigationSymbolAsync(); 121var metadataSymbol = await context.ResolveSymbolAsync(symbolName);
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (5)
85public Task<MetadataAsSourceFile> GenerateSourceAsync(ISymbol symbol, Project? project = null, bool signaturesOnly = true) 167public async Task<ISymbol?> ResolveSymbolAsync(string symbolMetadataName, Compilation? compilation = null) 212var memberSymbol = namedTypeSymbol.GetMembers() 312internal async Task<ISymbol> GetNavigationSymbolAsync() 319var symbol = semanticModel.GetSymbolInfo(syntaxRoot.FindNode(testDocument.SelectedSpans.Single())).Symbol;
MetadataAsSource\MetadataAsSourceTests.cs (22)
2953var navigationSymbol = await context.GetNavigationSymbolAsync(); 3001var navigationSymbol = await context.GetNavigationSymbolAsync(); 3530var navigationSymbol = await context.GetNavigationSymbolAsync(); 3576var navigationSymbol = await context.GetNavigationSymbolAsync(); 3611var navigationSymbol = await context.GetNavigationSymbolAsync(); 5283var navigationSymbol = await context.GetNavigationSymbolAsync(); 5331var navigationSymbol = await context.GetNavigationSymbolAsync(); 5368var navigationSymbol = await context.GetNavigationSymbolAsync(); 5432var navigationSymbol = await context.GetNavigationSymbolAsync(); 5493var navigationSymbol = await context.GetNavigationSymbolAsync(); 5562var navigationSymbol = await context.GetNavigationSymbolAsync(); 5618var navigationSymbol = await context.GetNavigationSymbolAsync(); 5675var navigationSymbol = await context.GetNavigationSymbolAsync(); 5729var navigationSymbol = await context.GetNavigationSymbolAsync(); 5783var navigationSymbol = await context.GetNavigationSymbolAsync(); 5835var navigationSymbol = await context.GetNavigationSymbolAsync(); 5887var navigationSymbol = await context.GetNavigationSymbolAsync(); 5939var navigationSymbol = await context.GetNavigationSymbolAsync(); 5989var navigationSymbol = await context.GetNavigationSymbolAsync(); 6059var navigationSymbol = await context.GetNavigationSymbolAsync(); 6139var navigationSymbol = await context.GetNavigationSymbolAsync(); 6189var navigationSymbol = await context.GetNavigationSymbolAsync();
StackTraceExplorer\StackTraceExplorerTests.cs (1)
51var expectedSymbol = semanticModel.GetDeclaredSymbol(node);
SymbolFinder\DependentTypeFinderTests.cs (1)
763var methodSymbol = classSymbol.GetMembers("M").Single();
SymbolFinder\FindSymbolAtPositionTests.cs (2)
18private static Task<ISymbol> FindSymbolAtPositionAsync(TestWorkspace workspace) 39var symbol = await FindSymbolAtPositionAsync(workspace);
SymbolKey\SymbolKeyCrossLanguageTests.cs (1)
47var methodSymbol = semanticModel.GetDeclaredSymbol(method);
Utilities\SymbolEquivalenceComparerTests.cs (78)
198var field1_v1 = type1_v1.GetMembers("field1").Single(); 199var field1_v2 = type1_v2.GetMembers("field1").Single(); 200var field2_v1 = type1_v1.GetMembers("field2").Single(); 201var field2_v2 = type2_v2.GetMembers("field2").Single(); 202var field3_v1 = type2_v1.GetMembers("field3").Single(); 203var field3_v2 = type2_v2.GetMembers("field3").Single(); 204var field4_v1 = type2_v1.GetMembers("field4").Single(); 205var field4_v2 = type1_v2.GetMembers("field4").Single(); 249var field1_v1 = type1_v1.GetMembers("field1").Single(); 250var field1_v2 = type1_v2.GetMembers("field1").Single(); 251var field2_v1 = type1_v1.GetMembers("field2").Single(); 252var field2_v2 = type2_v2.GetMembers("field2").Single(); 253var field3_v1 = type2_v1.GetMembers("field3").Single(); 254var field3_v2 = type2_v2.GetMembers("field3").Single(); 255var field4_v1 = type2_v1.GetMembers("field4").Single(); 256var field4_v2 = type1_v2.GetMembers("field4").Single(); 291var goo = typeC.GetMembers("goo").Single(); 292var goo_intInstantiation1 = intInstantiation1.Type.GetMembers("goo").Single(); 293var goo_stringInstantiation = stringInstantiation.Type.GetMembers("goo").Single(); 294var goo_instanceInstantiation = instanceInstantiation.Type.GetMembers("goo").Single(); 295var goo_intInstantiation2 = intInstantiation2.Type.GetMembers("goo").Single(); 330var method_v1 = type1_v1.GetMembers("Goo").Single(); 331var method_v2 = type1_v2.GetMembers("Goo").Single(); 355var method_v1 = type1_v1.GetMembers("Goo").Single(); 356var method_v2 = type1_v2.GetMembers("Goo1").Single(); 380var method_v1 = type1_v1.GetMembers("Goo").Single(); 381var method_v2 = type1_v2.GetMembers("Goo").Single(); 405var method_v1 = type1_v1.GetMembers("Goo").Single(); 406var method_v2 = type1_v2.GetMembers("Goo").Single(); 430var method_v1 = type1_v1.GetMembers("Goo").Single(); 431var method_v2 = type1_v2.GetMembers("Goo").Single(); 457var method_v1 = type1_v1.GetMembers("Goo").Single(); 458var method_v2 = type1_v2.GetMembers("Goo").Single(); 484var method_v1 = type1_v1.GetMembers("Goo").Single(); 485var method_v2 = type1_v2.GetMembers("Goo").Single(); 511var method_v1 = type1_v1.GetMembers("Goo").Single(); 512var method_v2 = type1_v2.GetMembers("Goo").Single(); 536var method_v1 = type1_v1.GetMembers("Goo").Single(); 537var method_v2 = type1_v2.GetMembers("Goo").Single(); 561var method_v1 = type1_v1.GetMembers("Goo").Single(); 562var method_v2 = type1_v2.GetMembers("Goo").Single(); 588var method_v1 = type1_v1.GetMembers("Goo").Single(); 589var method_v2 = type1_v2.GetMembers("Goo").Single(); 622var csharpGooMethod = csharpType1.GetMembers("Goo").Single(); 623var csharpBarMethod = csharpType1.GetMembers("Bar").Single(); 624var vbGooMethod = vbType1.GetMembers("Goo").Single(); 625var vbQuuxMethod = vbType1.GetMembers("Quux").Single(); 667var csharpGooMethod = csharpType1.GetMembers("Goo").Single(); 668var csharpBarMethod = csharpType1.GetMembers("Bar").Single(); 669var vbGooMethod = vbType1.GetMembers("Goo").Single(); 670var vbBarMethod = vbType1.GetMembers("Bar").Single(); 697var field1_v1 = type1_v1.GetMembers("field1").Single(); 698var field2_v1 = type1_v1.GetMembers("field2").Single(); 724var method_v1 = type1_v1.GetMembers("Goo").Single(); 725var method_v2 = type1_v2.GetMembers("Goo").Single(); 759var method_v1 = type1_v1.GetMembers("Goo").Single(); 760var method_v2 = type1_v2.GetMembers("Goo").Single(); 792var method_v1 = type1_v1.GetMembers("Goo").Single(); 793var method_v2 = type1_v2.GetMembers("Goo").Single(); 827var method_v1 = type1_v1.GetMembers("Goo").Single(); 828var method_v2 = type1_v2.GetMembers("Goo").Single(); 1083var method_v1 = type1_v1.GetMembers("Goo").Single(); 1084var method_v2 = type1_v2.GetMembers("Goo").Single(); 1114var method_v1 = type1_v1.GetMembers("M").Single(); 1115var method_v2 = type1_v2.GetMembers("M").Single(); 1154var method_v1 = type1_v1.GetMembers("M").Single(); 1155var method_v2 = type1_v2.GetMembers("M").Single(); 1184var method_v1 = type1_v1.GetMembers("M").Single(); 1185var method_v2 = type1_v2.GetMembers("M").Single(); 1214var method_v1 = type1_v1.GetMembers("M").Single(); 1215var method_v2 = type1_v2.GetMembers("M").Single(); 1245var method_v1 = type1_v1.GetMembers("M").Single(); 1246var method_v2 = type1_v2.GetMembers("M").Single(); 1276var method_v1 = type1_v1.GetMembers("M").Single(); 1277var method_v2 = type1_v2.GetMembers("M").Single(); 1308var method_v1 = type1_v1.GetMembers("M").Single(); 1309var method_v2 = type1_v2.GetMembers("M").Single(); 1887var method = type1.GetMembers(methodName).Single();
Microsoft.CodeAnalysis.EditorFeatures.Wpf (4)
Peek\DefinitionPeekableItem.cs (1)
79var symbol = _peekableItem._symbolKey.Resolve(compilation, ignoreAssemblyKey: true, cancellationToken: cancellationToken).Symbol;
Peek\IPeekableItemFactory.cs (1)
16Task<IEnumerable<IPeekableItem>> GetPeekableItemsAsync(ISymbol symbol, Project project, IPeekResultFactory peekResultFactory, CancellationToken cancellationToken);
Peek\PeekableItemFactory.cs (1)
47ISymbol symbol,
Peek\PeekHelpers.cs (1)
47internal static LinePositionSpan GetEntityOfInterestSpan(ISymbol symbol, Workspace workspace, Location identifierLocation, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (17)
Diagnostics\DiagnosticServiceTests.vb (15)
1599Dim symbols = New HashSet(Of ISymbol) 2497Public AnalyzedMethodSymbols As List(Of ISymbol) = New List(Of ISymbol)() 2499Public AnalyzedOperationBlockSymbols As List(Of ISymbol) = New List(Of ISymbol)() 2501Public AnalyzedOperationBlockStartSymbols As List(Of ISymbol) = New List(Of ISymbol)() 2502Public AnalyzedOperationBlockEndSymbols As List(Of ISymbol) = New List(Of ISymbol)() 2504Public AnalyzedCodeBlockSymbols As List(Of ISymbol) = New List(Of ISymbol)() 2506Public AnalyzedCodeBlockStartSymbols As List(Of ISymbol) = New List(Of ISymbol)() 2507Public AnalyzedCodeBlockEndSymbols As List(Of ISymbol) = New List(Of ISymbol)()
Rename\RenameEngineResult.vb (1)
129symbol As ISymbol,
Workspaces\TryFindSourceDefinitionTests.vb (1)
261Assert.Equal(Of ISymbol)(originalClass, mappedMember)
Microsoft.CodeAnalysis.ExternalAccess.Copilot (1)
Analyzer\CopilotUtilities.cs (1)
20public static bool IsResultantVisibilityPublic(this ISymbol symbol)
Microsoft.CodeAnalysis.ExternalAccess.Debugger (1)
DebuggerFindReferencesService.cs (1)
27public async Task FindSymbolReferencesAsync(ISymbol symbol, Project project, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (18)
CodeRefactorings\WorkspaceServices\IOmniSharpSymbolRenamedCodeActionOperationFactoryWorkspaceService.cs (1)
11CodeActionOperation CreateSymbolRenamedOperation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution);
ExtractClass\IOmniSharpExtractClassOptionsService.cs (3)
11OmniSharpExtractClassOptions? GetExtractClassOptions(Document document, INamedTypeSymbol originalType, ImmutableArray<ISymbol> selectedMembers); 38public ISymbol Member { get; } 46ISymbol member,
ExtractInterface\IOmniSharpExtractInterfaceOptionsService.cs (3)
14List<ISymbol> extractableMembers, 27public ImmutableArray<ISymbol> IncludedMembers { get; } 32public OmniSharpExtractInterfaceOptionsResult(bool isCancelled, ImmutableArray<ISymbol> includedMembers, string interfaceName, string fileName, OmniSharpExtractLocation location)
Internal\CodeRefactorings\WorkspaceServices\OmniSharpSymbolRenamedCodeActionOperationFactoryWorkspaceService.cs (1)
27public CodeActionOperation CreateSymbolRenamedOperation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution)
Internal\ExtractClass\OmniSharpExtractClassOptionsService.cs (1)
27ImmutableArray<ISymbol> selectedMembers,
Internal\ExtractInterface\OmniSharpExtractInterfaceOptionsService.cs (1)
24ImmutableArray<ISymbol> extractableMembers,
Internal\PickMembers\OmniSharpPickMembersService.cs (1)
27public PickMembersResult PickMembers(string title, ImmutableArray<ISymbol> members, ImmutableArray<PickMembersOption> options = default, bool selectAll = true)
MetadataAsSource\OmniSharpMetadataAsSourceHelpers.cs (1)
19public static Task<Location> GetLocationInGeneratedSourceAsync(ISymbol symbol, Document generatedDocument, CancellationToken cancellationToken)
MetadataAsSource\OmniSharpMetadataAsSourceService.cs (1)
26public static Task<Document> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, OmniSharpSyntaxFormattingOptionsWrapper formattingOptions, CancellationToken cancellationToken)
PickMembers\IOmniSharpPickMembersService.cs (3)
13string title, ImmutableArray<ISymbol> members, 34public readonly ImmutableArray<ISymbol> Members; 39ImmutableArray<ISymbol> members,
Rename\OmniSharpRenamer.cs (2)
19ISymbol symbol, 22ImmutableHashSet<ISymbol>? nonConflictSymbols,
Microsoft.CodeAnalysis.ExternalAccess.Xaml (4)
External\IDescriptionService.cs (1)
20Task<IEnumerable<TaggedText>> GetDescriptionAsync(ISymbol symbol, Project project, CancellationToken cancellationToken);
External\ILocationService.cs (1)
19Task<FileLinePositionSpan[]> GetSymbolLocationsAsync(ISymbol symbol, Project project, CancellationToken cancellationToken);
Internal\DescriptionService.cs (1)
34public async Task<IEnumerable<TaggedText>> GetDescriptionAsync(ISymbol symbol, Project project, CancellationToken cancellationToken)
Internal\LocationService.cs (1)
45public async Task<FileLinePositionSpan[]> GetSymbolLocationsAsync(ISymbol symbol, Project project, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Features (961)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (2)
30ISymbol containingType, 37private readonly ISymbol _containingType = containingType;
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.ConstructorCandidate.cs (2)
11private readonly struct ConstructorCandidate(IMethodSymbol constructor, ImmutableArray<ISymbol> missingMembers, ImmutableArray<IParameterSymbol> missingParameters) 14public readonly ImmutableArray<ISymbol> MissingMembers = missingMembers;
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.State.cs (5)
30ImmutableArray<ISymbol> selectedMembers, 45ImmutableArray<ISymbol> selectedMembers, 79ImmutableArray<ISymbol> selectedMembers, 122private static ConstructorCandidate CreateConstructorCandidate(ImmutableArray<IParameterSymbol> parametersForSelectedMembers, ImmutableArray<ISymbol> selectedMembers, IMethodSymbol constructor) 125using var _1 = ArrayBuilder<ISymbol>.GetInstance(out var missingMembersBuilder);
AddImport\SearchScopes\AllSymbolsProjectSearchScope.cs (1)
24protected override async Task<ImmutableArray<ISymbol>> FindDeclarationsAsync(
AddImport\SearchScopes\MetadataSymbolsSearchScope.cs (1)
35protected override async Task<ImmutableArray<ISymbol>> FindDeclarationsAsync(
AddImport\SearchScopes\SearchScope.cs (2)
36protected abstract Task<ImmutableArray<ISymbol>> FindDeclarationsAsync(SymbolFilter filter, SearchQuery query, CancellationToken cancellationToken); 40public async Task<ImmutableArray<SymbolResult<ISymbol>>> FindDeclarationsAsync(
AddImport\SearchScopes\SourceSymbolsProjectSearchScope.cs (1)
29protected override async Task<ImmutableArray<ISymbol>> FindDeclarationsAsync(
AddImport\SymbolReferenceFinder.cs (2)
618private static ImmutableArray<SymbolResult<T>> OfType<T>(ImmutableArray<SymbolResult<ISymbol>> symbols) where T : ISymbol
AddImport\SymbolResult.cs (2)
70private readonly struct SymbolResult<T>(string desiredName, TSimpleNameSyntax nameNode, T symbol, double weight) where T : ISymbol 85public SymbolResult<T2> WithSymbol<T2>(T2 symbol) where T2 : ISymbol
ChangeSignature\AbstractChangeSignatureService.cs (13)
41public abstract Task<(ISymbol? symbol, int selectedIndex)> GetInvocationSymbolAsync(Document document, int position, bool restrictToDeclarations, CancellationToken cancellationToken); 49public abstract Task<ImmutableArray<ISymbol>> DetermineCascadedSymbolsFromDelegateInvokeAsync( 54ISymbol declarationSymbol, 89protected abstract ImmutableArray<IParameterSymbol> GetParameters(ISymbol declarationSymbol); 226ISymbol symbol, 255var definitionToUse = new Dictionary<SyntaxNode, ISymbol>(); 445private static void AddUpdatableNodeToDictionaries(Dictionary<DocumentId, List<SyntaxNode>> nodesToUpdate, DocumentId documentId, SyntaxNode nodeToUpdate, Dictionary<SyntaxNode, ISymbol> definitionToUse, ISymbol symbolWithSemanticParameters) 448if (definitionToUse.TryGetValue(nodeToUpdate, out var sym) && sym != symbolWithSemanticParameters) 471ISymbol declarationSymbol, 581private SignatureChange UpdateSignatureChangeToIncludeExtraParametersFromTheDeclarationSymbol(ISymbol declarationSymbol, SignatureChange updatedSignature) 766ISymbol declarationSymbol, 1043protected static bool IsParamsArrayExpandedHelper(ISymbol symbol, int argumentCount, bool lastArgumentIsNamed, SemanticModel semanticModel, SyntaxNode lastArgumentExpression, CancellationToken cancellationToken)
ChangeSignature\ChangeSignatureAnalyzedContext.cs (2)
12SemanticDocument document, int positionForTypeBinding, ISymbol symbol, ParameterConfiguration parameterConfiguration) : ChangeSignatureAnalyzedContext 15public readonly ISymbol Symbol = symbol;
ChangeSignature\DelegateInvokeMethodReferenceFinder.cs (5)
40protected override async ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 46using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 48var beginInvoke = symbol.ContainingType.GetMembers(WellKnownMemberNames.DelegateBeginInvokeName).FirstOrDefault(); 109var convertedType = (ISymbol?)state.SemanticModel.GetTypeInfo(node, cancellationToken).ConvertedType;
ChangeSignature\IChangeSignatureOptionsService.cs (1)
23ISymbol symbol,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (5)
51ISymbol targetSymbol, 60SyntaxNode targetNode, ISymbol targetSymbol, INamedTypeSymbol suppressMessageAttribute, Diagnostic diagnostic); 255public ISymbol TargetSymbol { get; set; } 291ISymbol targetSymbol = null; 374protected static string GetTargetString(ISymbol targetSymbol)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageCodeAction.cs (2)
16ISymbol targetSymbol, INamedTypeSymbol suppressMessageAttribute, 38internal ISymbol TargetSymbol_TestOnly { get; } = targetSymbol;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (11)
28private readonly IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>> _diagnosticsBySymbol; 33IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>> diagnosticsBySymbol, 152private static async Task<IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>>> CreateDiagnosticsBySymbolAsync(AbstractSuppressionCodeFixProvider fixer, IEnumerable<KeyValuePair<Document, ImmutableArray<Diagnostic>>> diagnosticsByDocument, CancellationToken cancellationToken) 154var diagnosticsMapBuilder = ImmutableDictionary.CreateBuilder<ISymbol, List<Diagnostic>>(); 173private static async Task<IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>>> CreateDiagnosticsBySymbolAsync(Project project, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 175var diagnosticsMapBuilder = ImmutableDictionary.CreateBuilder<ISymbol, List<Diagnostic>>(); 190private static void AddDiagnosticForSymbolIfNeeded(ISymbol targetSymbol, Diagnostic diagnostic, ImmutableDictionary<ISymbol, List<Diagnostic>>.Builder diagnosticsMapBuilder) 206private static IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>> CreateDiagnosticsBySymbol(ImmutableDictionary<ISymbol, List<Diagnostic>>.Builder diagnosticsMapBuilder) 211var builder = new List<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>>();
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.LocalSuppressMessageCodeAction.cs (2)
16ISymbol targetSymbol, 23private readonly ISymbol _targetSymbol = targetSymbol;
CodeLens\CodeLensFindReferenceProgress.cs (7)
25ISymbol queriedDefinition, 32private readonly ISymbol _queriedSymbol = queriedDefinition; 67private static bool FilterDefinition(ISymbol definition) 74private IEnumerable<Location> GetPartialLocations(ISymbol symbol, CancellationToken cancellationToken) 85public void OnDefinitionFound(ISymbol symbol) 114private bool FilterReference(ISymbol definition, ReferenceLocation reference) 128public void OnReferenceFound(ISymbol symbol, ReferenceLocation location)
CodeLens\CodeLensReferencesService.cs (6)
56var symbol = semanticModel.GetDeclaredSymbol(syntaxNode, cancellationToken); 145var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken); 217private static ISymbol GetEnclosingMethod(SemanticModel semanticModel, Location location, CancellationToken cancellationToken) 219var enclosingSymbol = semanticModel.GetEnclosingSymbol(location.SourceSpan.Start, cancellationToken); 221for (var current = enclosingSymbol; current != null; current = current.ContainingSymbol) 281var declaredSymbol = semanticModel.GetDeclaredSymbol(syntaxNode, cancellationToken);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (6)
330var memberSymbol = semanticModel.GetDeclaredSymbol(memberDecl, cancellationToken); 364private async Task<ImmutableArray<ISymbol>> GetDeclaredSymbolsInContainerAsync( 371var builder = ArrayBuilder<ISymbol>.GetInstance(); 375var symbol = semanticModel.GetDeclaredSymbol(declaration, cancellationToken); 514Document document, ISymbol symbol, CancellationToken cancellationToken) 547private static async Task<ImmutableArray<ReferencedSymbol>> FindReferencesAsync(ISymbol symbol, Document document, CancellationToken cancellationToken)
CodeRefactorings\WorkspaceServices\ISymbolRenamedCodeActionOperationFactoryWorkspaceService.cs (1)
11CodeActionOperation CreateSymbolRenamedOperation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution);
Common\TaggedText.cs (2)
89this IEnumerable<SymbolDisplayPart>? displayParts, TaggedTextStyle style = TaggedTextStyle.None, Func<ISymbol?, string?>? getNavigationHint = null, bool includeNavigationHints = true) 121private static string? GetNavigationTarget(ISymbol? symbol)
Completion\CommonCompletionUtilities.cs (4)
86SolutionServices workspaceServices, SemanticModel semanticModel, int position, ISymbol symbol, int overloadCount, SymbolDescriptionOptions options, SupportedPlatformData? supportedPlatforms, CancellationToken cancellationToken) 151SolutionServices workspaceServices, SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SupportedPlatformData? supportedPlatforms, CancellationToken cancellationToken) 174List<TaggedText> textContentBuilder, ISymbol symbol, SemanticModel semanticModel, int position, IDocumentationCommentFormattingService formatter, CancellationToken cancellationToken) 208public static bool TryRemoveAttributeSuffix(ISymbol symbol, SyntaxContext context, [NotNullWhen(true)] out string? name)
Completion\Providers\AbstractContextVariableArgumentProvider.cs (5)
35ISymbol? bestSymbol = null; 40ISymbol candidate; 60ISymbol candidate; 110void CheckCandidate(ISymbol candidate, string? overridingName = null) 153bool IsNewNameSameOrBetter(ISymbol symbol)
Completion\Providers\AbstractCrefCompletionProvider.cs (1)
45protected abstract Task<(SyntaxToken, SemanticModel?, ImmutableArray<ISymbol>)> GetSymbolsAsync(
Completion\Providers\AbstractDocCommentCompletionProvider.cs (7)
102protected abstract ImmutableArray<IParameterSymbol> GetParameters(ISymbol symbol); 143protected IEnumerable<CompletionItem> GetNestedItems(ISymbol? symbol, bool includeKeywords) 161private IEnumerable<CompletionItem> GetParamRefItems(ISymbol symbol) 171private IEnumerable<CompletionItem> GetTypeParamRefItems(ISymbol symbol) 181protected IEnumerable<CompletionItem> GetAttributeValueItems(ISymbol? symbol, string tagName, string attributeName) 213protected ImmutableArray<CompletionItem> GetTopLevelItems(ISymbol? symbol, TSyntax syntax) 261private IEnumerable<CompletionItem> GetParameterItems<TSymbol>(ImmutableArray<TSymbol> symbols, TSyntax syntax, string tagName) where TSymbol : ISymbol
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (3)
39protected abstract Task<ISymbol> GenerateMemberAsync( 40Document document, CompletionItem item, Compilation compilation, ISymbol member, INamedTypeSymbol containingType, CancellationToken cancellationToken); 133var member = symbols.FirstOrDefault();
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (3)
21protected abstract string EscapeIdentifier(ISymbol symbol); 91protected virtual bool IsInitializableFieldOrProperty(ISymbol fieldOrProperty, INamedTypeSymbol containingType) 109static bool CanSupportObjectInitializer(ISymbol fieldOrProperty)
Completion\Providers\AbstractOverrideCompletionProvider.cs (5)
18public abstract ImmutableArray<ISymbol> FilterOverrides(ImmutableArray<ISymbol> members, ITypeSymbol? returnType); 33protected override Task<ISymbol> GenerateMemberAsync( 34Document document, CompletionItem completionItem, Compilation compilation, ISymbol overriddenMember, INamedTypeSymbol containingType, CancellationToken cancellationToken) 71protected static ITypeSymbol GetReturnType(ISymbol symbol)
Completion\Providers\AbstractOverrideCompletionProvider.ItemGetter.cs (3)
70ISymbol symbol, SemanticModel semanticModel, 92out ImmutableArray<ISymbol> overridableMembers) 94var containingType = semanticModel.GetEnclosingSymbol<INamedTypeSymbol>(startToken.SpanStart, CancellationToken);
Completion\Providers\AbstractPartialMethodCompletionProvider.cs (2)
62protected override async Task<ISymbol> GenerateMemberAsync( 63Document document, CompletionItem item, Compilation compilation, ISymbol member, INamedTypeSymbol containingType, CancellationToken cancellationToken)
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (6)
27protected abstract bool IsInstrinsic(ISymbol symbol); 30protected abstract string GetFilterText(ISymbol symbol, string displayText, TSyntaxContext context); 78private static bool IsValidForTaskLikeTypeOnlyContext(ISymbol symbol, TSyntaxContext context) 104private static bool IsValidForGenericConstraintContext(ISymbol symbol) 126private static ITypeSymbol? GetSymbolType(ISymbol symbol) 179private static int ComputeSymbolMatchPriority(ISymbol symbol)
Completion\Providers\AbstractSymbolCompletionProvider.cs (7)
28protected abstract (string displayText, string suffix, string insertionText) GetDisplayAndSuffixAndInsertionText(ISymbol symbol, TSyntaxContext context); 49ISymbol symbol, 150Dictionary<ISymbol, ArrayBuilder<ProjectId>>? invalidProjectMap, 249Dictionary<ISymbol, ArrayBuilder<ProjectId>>? invalidProjectMap, 291protected static string GetFilterTextDefault(ISymbol symbol, string displayText, TSyntaxContext context) 452private static Dictionary<ISymbol, ArrayBuilder<ProjectId>> FindSymbolsMissingInLinkedContexts( 456var missingSymbols = new Dictionary<ISymbol, ArrayBuilder<ProjectId>>(LinkedFilesSymbolEquivalenceComparer.Instance);
Completion\Providers\AbstractSymbolCompletionProvider.SymbolAndSelectionInfo.cs (1)
13protected readonly record struct SymbolAndSelectionInfo(ISymbol Symbol, bool Preselect)
Completion\Providers\ImportCompletionProvider\AbstractExtensionMethodImportCompletionProvider.cs (1)
103private static ITypeSymbol? GetSymbolType(ISymbol symbol)
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (1)
417static bool IsAccessible(ISymbol symbol, bool internalsVisible)
Completion\Providers\ImportCompletionProvider\ImportCompletionItem.cs (1)
177private static (ISymbol? symbol, int overloadCount) GetSymbolAndOverloadCount(CompletionItem item, Compilation compilation)
Completion\Providers\MemberInsertingCompletionItem.cs (1)
20ISymbol symbol,
Completion\Providers\SymbolCompletionItem.cs (20)
25private static readonly Action<ImmutableArray<ISymbol>, ArrayBuilder<KeyValuePair<string, string>>> s_addSymbolEncoding = AddSymbolEncoding; 26private static readonly Action<ImmutableArray<ISymbol>, ArrayBuilder<KeyValuePair<string, string>>> s_addSymbolInfo = AddSymbolInfo; 32ImmutableArray<ISymbol> symbols, 35Action<ImmutableArray<ISymbol>, ArrayBuilder<KeyValuePair<string, string>>> symbolEncoder, 63var firstSymbol = symbols[0]; 81private static void AddSymbolEncoding(ImmutableArray<ISymbol> symbols, ArrayBuilder<KeyValuePair<string, string>> properties) 84private static void AddSymbolInfo(ImmutableArray<ISymbol> symbols, ArrayBuilder<KeyValuePair<string, string>> properties) 86var symbol = symbols[0]; 108public static string EncodeSymbols(ImmutableArray<ISymbol> symbols) 124public static string EncodeSymbol(ISymbol symbol) 132public static async Task<ImmutableArray<ISymbol>> GetSymbolsAsync(CompletionItem item, Document document, CancellationToken cancellationToken) 137using var _ = ArrayBuilder<ISymbol>.GetInstance(out var symbols); 163private static void DecodeSymbols(List<string> ids, Compilation compilation, ArrayBuilder<ISymbol> symbols) 168var symbol = DecodeSymbol(id, compilation); 181private static ISymbol? DecodeSymbol(string id, Compilation compilation) 192CompletionItem item, Document document, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, CancellationToken cancellationToken) 303ImmutableArray<ISymbol> symbols, 335ImmutableArray<ISymbol> symbols, 359ImmutableArray<ISymbol> symbols, 390CompletionItem item, ImmutableArray<ISymbol> symbols, Document document, SemanticModel semanticModel, SymbolDescriptionOptions options, CancellationToken cancellationToken)
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (4)
259using var _ = ArrayBuilder<ISymbol>.GetInstance(out var members); 290var readonlyProperties = ImmutableArray<ISymbol>.CastUp( 313string className, bool isRecord, ImmutableArray<ITypeParameterSymbol> capturedTypeParameters, ImmutableArray<ISymbol> members) 382var parameterToPropMap = new Dictionary<string, ISymbol>();
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
393private bool CheckIfForEachVariableIsWrittenInside(SemanticModel semanticModel, ISymbol foreachVariable, TForEachStatement foreachStatement)
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (2)
232INamedTypeSymbol containingType, ITypeSymbol type, string memberName) where TSymbol : class, ISymbol 239INamedTypeSymbol containingType, ITypeSymbol type, string memberName) where TSymbol : class, ISymbol
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (6)
823document, namedTypeWithoutMembers, ImmutableArray<ISymbol>.CastUp(fields), 827ImmutableArray<ISymbol>.CastUp(fields), cancellationToken).ConfigureAwait(false); 829using var _ = ArrayBuilder<ISymbol>.GetInstance(out var members); 879SyntaxGenerator generator, ArrayBuilder<ISymbol> members, 910ImmutableArray<ITypeParameterSymbol> typeParameters, ImmutableArray<ISymbol> members) 927using var _ = PooledDictionary<string, ISymbol>.GetInstance(out var parameterToPropMap);
Debugging\AbstractBreakpointResolver.cs (9)
75protected abstract IEnumerable<ISymbol> GetMembers(INamedTypeSymbol type, string name); 78private BreakpointResolutionResult CreateBreakpoint(ISymbol methodSymbol) 122private async Task<IEnumerable<ISymbol>> FindMembersAsync( 200private IEnumerable<ISymbol> FindMembers(IEnumerable<INamespaceOrTypeSymbol> containers, params NameAndArity[] names) 211private IEnumerable<ISymbol> FindMembers(IEnumerable<INamedTypeSymbol> types, NameAndArity nameAndArity) 230private static ISymbol GetPartialImplementationPartOrNull(ISymbol symbol) => symbol.Kind switch 241private bool IsApplicable(ISymbol methodOrProperty, int? parameterCount, CancellationToken cancellationToken) 285private static bool IsMismatch(ISymbol methodOrProperty, int? parameterCount)
Debugging\AbstractDataTipInfoGetter.cs (1)
44private static bool IsLinqExtensionMethod([NotNullWhen(true)] ISymbol? symbol)
DecompiledSource\IDecompiledSourceService.cs (1)
27Task<Document?> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, MetadataReference? metadataReference, string? assemblyLocation, SyntaxFormattingOptions? formattingOptions, CancellationToken cancellationToken);
DocumentationComments\AbstractDocumentationCommentFormattingService.cs (5)
83internal ISymbol TypeResolutionSymbol { get; set; } 289public ImmutableArray<TaggedText> Format(string rawXmlText, ISymbol symbol, SemanticModel semanticModel, int position, SymbolDisplayFormat format, CancellationToken cancellationToken) 453var symbol = DocumentationCommentId.GetFirstSymbolForDeclarationId(crefAttribute.Value, semanticModel.Compilation); 502var symbol = DocumentationCommentId.GetFirstSymbolForDeclarationId(crefValue, semanticModel.Compilation); 520string crefValue, ISymbol typeResolutionSymbol, int position, SemanticModel semanticModel, SymbolDisplayFormat format)
DocumentationComments\IDocumentationCommentFormattingService.cs (1)
14ImmutableArray<TaggedText> Format(string? rawXmlText, ISymbol symbol, SemanticModel semanticModel, int position, SymbolDisplayFormat format, CancellationToken cancellationToken);
DocumentHighlighting\AbstractDocumentHighlightsService.cs (6)
112ISymbol symbol, 137private static bool ShouldConsiderSymbol(ISymbol symbol) 163IImmutableSet<Document> documentsToSearch, ISymbol symbol, 196Document document, ISymbol symbol, CancellationToken cancellationToken) 203ISymbol symbol, 275private static bool ShouldIncludeDefinition(ISymbol symbol)
EditAndContinue\AbstractEditAndContinueAnalyzer.ActiveMembersBuilder.cs (2)
32public void Add(ISymbol member) 55public bool IsActive(ISymbol member)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (27)
104internal abstract MemberBody? TryGetDeclarationBody(SyntaxNode node, ISymbol? symbol); 109internal abstract bool IsDeclarationWithSharedBody(SyntaxNode declaration, ISymbol member); 180/// Returns all symbols with declaring syntax (<see cref="GetSymbolDeclarationSyntax(ISymbol, CancellationToken)"/> must return a syntax node) 185ref TemporaryArray<(ISymbol?, ISymbol?, EditKind)> result, 188ISymbol? oldSymbol, 190ISymbol? newSymbol, 201protected abstract OneOrMany<(ISymbol? oldSymbol, ISymbol? newSymbol)> GetEditedSymbols( 209private OneOrMany<(ISymbol? oldSymbol, ISymbol? newSymbol, EditKind editKind)> GetSymbolEdits( 220var result = new TemporaryArray<(ISymbol?, ISymbol?, EditKind)>(); 2490 => OneOrMany<(ISymbol?, ISymbol?, EditKind)>.Empty, 258protected abstract IEnumerable<SyntaxNode> GetVariableUseSites(IEnumerable<SyntaxNode> roots, ISymbol localOrParameter, SemanticModel model, CancellationToken cancellationToken); 292internal string GetDisplayKindAndName(ISymbol symbol, string? displayKind = null, bool fullyQualify = false) 313internal string GetDisplayKind(ISymbol symbol) 430internal abstract void ReportInsertedMemberSymbolRudeEdits(RudeEditDiagnosticsBuilder diagnostics, ISymbol newSymbol, SyntaxNode newNode, bool insertingIntoExistingContainingType); 490/// <see cref="ISymbol.DeclaringSyntaxReferences"/> of a primary constructor returns the type declaration syntax. 499internal abstract bool IsConstructorWithMemberInitializers(ISymbol symbol, CancellationToken cancellationToken); 951ISymbol oldMember, 952ISymbol newMember, 2387protected static bool SymbolsEquivalent(ISymbol oldSymbol, ISymbol newSymbol) 2448protected static bool MemberOrDelegateSignaturesEquivalent(ISymbol? oldMember, ISymbol? newMember, bool exact = false)
EditAndContinue\AbstractSimpleMemberBody.cs (1)
36public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody.cs (1)
63public abstract ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model);
EditAndContinue\EditSession.cs (6)
684out ImmutableHashSet<ISymbol> addedSymbols, 688using var _1 = PooledHashSet<ISymbol>.GetInstance(out var addedSymbolsBuilder); 689using var _2 = ArrayBuilder<(ISymbol? oldSymbol, ISymbol? newSymbol)>.GetInstance(edits.Count, out var resolvedSymbols); 787using var _3 = PooledHashSet<ISymbol>.GetInstance(out var visitedSymbols); 1010static _ => false : (Func<ISymbol, bool>)projectChanges.AddedSymbols.Contains;
EditAndContinue\ProjectChanges.cs (2)
27public readonly ImmutableHashSet<ISymbol> AddedSymbols; 42ImmutableHashSet<ISymbol> addedSymbols,
EditAndContinue\RudeEditReportingCondition.cs (4)
7internal readonly struct RudeEditReportingCondition(ISymbol oldMember, bool reportWhenActive) 9public ISymbol OldSymbol { get; } = ValidateMember(oldMember); 16private static ISymbol ValidateMember(ISymbol member)
EditAndContinue\SemanticEditInfo.cs (5)
61public static SemanticEditInfo CreateInsert(ISymbol symbol, CancellationToken cancellationToken) 71public static SemanticEditInfo CreateUpdate(ISymbol symbol, SyntaxMaps syntaxMaps, CancellationToken cancellationToken) 84public static SemanticEditInfo CreateDelete(ISymbol symbol, SymbolKey containingSymbolKey, CancellationToken cancellationToken) 101/// We use <see cref="SymbolKey"/> to represent the symbol rather then <see cref="ISymbol"/>, 110/// We use <see cref="SymbolKey"/> to represent the symbol rather then <see cref="ISymbol"/>,
EditAndContinue\Utilities\Extensions.cs (14)
138public static bool IsSynthesized(this ISymbol symbol) 144public static bool IsSynthesizedAutoProperty(this ISymbol symbol) 147public static bool IsSynthesizedParameter(this ISymbol symbol) 152/// In some cases <see cref="ISymbol.IsImplicitlyDeclared"/> of parameters of synthezied methods might be false. 166public static bool IsAutoProperty(this ISymbol symbol) 175public static bool IsCopyConstructor(this ISymbol symbol) 213public static ISymbol PartialAsImplementation(this ISymbol symbol) 216public static bool IsPartialDefinition(this ISymbol symbol) 219public static bool IsPartialImplementation(this ISymbol symbol) 222public static ISymbol? PartialDefinitionPart(this ISymbol symbol) 230public static ISymbol? PartialImplementationPart(this ISymbol symbol)
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (3)
101var method = symbolInfo.Symbol; 105foreach (var candidate in symbolInfo.CandidateSymbols) 148private bool TryAnalyzeInvocation(ISymbol? symbol, string? argName, int? argIndex)
EmbeddedLanguages\EmbeddedLanguageDetector.cs (8)
194var impl = type.FindImplementationForInterfaceMember(formatMethod); 265var symbol = semanticModel.GetDeclaredSymbol(property, cancellationToken); 332ISymbol? symbol, 359ISymbol? symbol, 384ISymbol symbol, 467var symbol = semanticModel.GetSymbolInfo(left, cancellationToken).Symbol; 472ISymbol? symbol, [NotNullWhen(true)] out string? identifier) 480[NotNullWhen(true)] ISymbol? symbol,
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (3)
100var method = symbolInfo.Symbol; 104foreach (var candidate in symbolInfo.CandidateSymbols) 146ISymbol? method,
ExternalAccess\Pythia\Api\PythiaCompletionProviderBase.cs (1)
36IReadOnlyList<ISymbol> symbols,
ExternalAccess\Pythia\Api\PythiaDocumentationCommentFormatting.cs (1)
13public static IEnumerable<TaggedText> GetDocumentationParts(ISymbol symbol, SemanticModel semanticModel, int position, IDocumentationCommentFormattingService formatter, CancellationToken cancellationToken)
ExternalAccess\Pythia\Api\PythiaSymbolSorting.cs (1)
18where TSymbol : ISymbol
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (7)
111var symbol = model.GetDeclaredSymbol(declarationNode, CancellationToken); 121private async Task<bool> TryEnqueueFromTypeAsync(Document document, ISymbol symbol) 146private async Task<bool> TryEnqueueFromMemberAsync(Document document, ISymbol symbol) 171private Task EnqueueWorkItemAsync(Document document, ISymbol symbol) 191private static bool IsInternal(ISymbol symbol) 198private static bool IsType(ISymbol symbol) 201private static bool IsMember(ISymbol symbol)
ExtractClass\ExtractClassWithDialogCodeAction.cs (4)
32ImmutableArray<ISymbol> selectedMembers, 36private readonly ImmutableArray<ISymbol> _selectedMembers = selectedMembers; 145using var _1 = ArrayBuilder<(ISymbol member, bool makeAbstract)>.GetInstance(out var pullMembersBuilder); 186var currentSymbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
ExtractClass\IExtractClassOptionsService.cs (1)
17ImmutableArray<ISymbol> selectedMembers,
ExtractInterface\AbstractExtractInterfaceService.cs (10)
40IEnumerable<ISymbol> includedMembers, 41ImmutableDictionary<ISymbol, SyntaxAnnotation> symbolToDeclarationAnnotationMap, 257ImmutableArray<ISymbol> extractableMembers, 313IEnumerable<ISymbol> includedMembers, 314ImmutableDictionary<ISymbol, SyntaxAnnotation> symbolToDeclarationAnnotationMap, 364private static ImmutableArray<ISymbol> CreateInterfaceMembers(IEnumerable<ISymbol> includedMembers) 366using var _ = ArrayBuilder<ISymbol>.GetInstance(out var interfaceMembers); 368foreach (var member in includedMembers) 424internal virtual bool IsExtractableMember(ISymbol m)
ExtractInterface\ExtractInterfaceOptionsResult.cs (2)
22public ImmutableArray<ISymbol> IncludedMembers { get; } 27public ExtractInterfaceOptionsResult(bool isCancelled, ImmutableArray<ISymbol> includedMembers, string interfaceName, string fileName, ExtractLocation location)
ExtractInterface\ExtractInterfaceTypeAnalysisResult.cs (2)
19public readonly ImmutableArray<ISymbol> ExtractableMembers; 27ImmutableArray<ISymbol> extractableMembers,
ExtractInterface\IExtractInterfaceOptionsService.cs (1)
14ImmutableArray<ISymbol> extractableMembers,
ExtractMethod\MethodExtractor.Analyzer.cs (33)
49protected virtual bool IsReadOutside(ISymbol symbol, HashSet<ISymbol> readOutsideMap) 146GetSignatureInformation(Dictionary<ISymbol, VariableInfo> symbolMap, ExtractMethodFlowControlInformation flowControlInformation) 220MultiDictionary<ISymbol, SyntaxToken> symbolMap, 222IList<ISymbol> failedVariables, 282private MultiDictionary<ISymbol, SyntaxToken> GetSymbolMap() 284var symbolMap = new MultiDictionary<ISymbol, SyntaxToken>(); 403MultiDictionary<ISymbol, SyntaxToken> symbolMap, 405out Dictionary<ISymbol, VariableInfo> variableInfoMap, 406out List<ISymbol> failedVariables) 426var candidates = new HashSet<ISymbol>(readInsideMap); 436foreach (var symbol in candidates) 522PooledDisposer<PooledHashSet<ISymbol>> GetPooledSymbolSet(ImmutableArray<ISymbol> symbols, out PooledHashSet<ISymbol> symbolSet) 524var disposer = PooledHashSet<ISymbol>.GetInstance(out symbolSet); 529ITypeSymbol? GetSymbolTypeWithUpdatedNullability(ISymbol symbol) 556ISymbol symbol, 573private ITypeSymbol? GetUnderlyingSymbolType(ISymbol symbol) 584private static void AddVariableToMap(IDictionary<ISymbol, VariableInfo> variableInfoMap, ISymbol localOrParameter, VariableInfo variableInfo) 589MultiDictionary<ISymbol, SyntaxToken> symbolMap, 590ISymbol symbol, 644MultiDictionary<ISymbol, SyntaxToken> symbolMap, ISymbol symbol, bool writtenInside) 697private static bool IsThisParameter(ISymbol localOrParameter) 707private static bool IsInteractiveSynthesizedParameter(ISymbol localOrParameter) 747IDictionary<ISymbol, VariableInfo> variableInfoMap, 750foreach (var symbol in variableInfoMap.Keys) 777private void AppendMethodTypeParameterUsedDirectly(MultiDictionary<ISymbol, SyntaxToken> symbolMap, IDictionary<int, ITypeParameterSymbol> sortedMap) 784IDictionary<ISymbol, VariableInfo> variableInfoMap, 785MultiDictionary<ISymbol, SyntaxToken> symbolMap, 869private OperationStatus CheckReadOnlyFields(MultiDictionary<ISymbol, SyntaxToken> symbolMap)
ExtractMethod\MethodExtractor.TypeParameterCollector.cs (1)
30public override void DefaultVisit(ISymbol node)
ExtractMethod\MethodExtractor.VariableSymbol.cs (6)
53protected abstract ISymbol GetSymbol(); 93where TSymbol : ISymbol 97protected override ISymbol GetSymbol() => this.Symbol; 104protected static int DefaultCompareTo(ISymbol left, ISymbol right) 121where TSymbol : ISymbol
FindUsages\AbstractFindUsagesService.ProgressAdapter.cs (2)
52ISymbol symbol, 115ImmutableArray<(SymbolGroup group, ISymbol symbol, ReferenceLocation location)> references, CancellationToken cancellationToken)
FindUsages\AbstractFindUsagesService_FindImplementations.cs (15)
41IFindUsagesContext context, ISymbol symbol, Project project, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken) 68ISymbol symbol, Project project, IFindUsagesContext context, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken) 84foreach (var implementation in implementations) 93private static async Task<ImmutableArray<ISymbol>> FindSourceImplementationsAsync( 94Solution solution, ISymbol symbol, CancellationToken cancellationToken) 96var builder = new HashSet<ISymbol>(SymbolEquivalenceComparer.Instance); 128static bool AddedAllLocations(ISymbol implementation, HashSet<(string filePath, TextSpan span)> seenLocations) 140private static async Task<ImmutableArray<ISymbol>> FindImplementationsWorkerAsync( 141Solution solution, ISymbol symbol, CancellationToken cancellationToken) 145using var _ = PooledHashSet<ISymbol>.GetInstance(out var result); 168private static async Task<ImmutableArray<ISymbol>> FindSourceAndMetadataImplementationsAsync( 169Solution solution, ISymbol symbol, CancellationToken cancellationToken) 179using var _ = PooledHashSet<ISymbol>.GetInstance(out var implementationsAndOverrides); 181foreach (var implementation in implementations) 199return ImmutableArray<ISymbol>.CastUp(await SymbolFinder.FindDerivedClassesArrayAsync(
FindUsages\AbstractFindUsagesService_FindReferences.cs (3)
108IFindUsagesContext context, ISymbol symbol, Project project, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken) 126ISymbol symbol, 158ISymbol symbol,
FindUsages\DefinitionItem.DefaultDefinitionItem.cs (2)
60private async ValueTask<(Project? project, ISymbol? symbol)> TryResolveSymbolAsync(Solution solution, string symbolKey, CancellationToken cancellationToken) 73var symbol = SymbolKey.ResolveString(symbolKey, compilation, cancellationToken: cancellationToken).Symbol;
FindUsages\DefinitionItemFactory.cs (9)
29this ISymbol definition, 35this ISymbol definition, 42ISymbol definition, 61this ISymbol definition, 93ISymbol definition, 147internal static ImmutableDictionary<string, string> WithMetadataSymbolProperties(this ImmutableDictionary<string, string> properties, ISymbol symbol, ProjectId originatingProjectId) 163internal static ImmutableArray<AssemblyLocation> GetMetadataLocations(ISymbol definition, Solution solution, out ProjectId? originatingProjectId) 223private static ImmutableArray<DocumentSpan> GetSourceLocations(ISymbol definition, ImmutableArray<Location> locations, Solution solution, bool includeHiddenLocations) 254private static ImmutableDictionary<string, string> GetProperties(ISymbol definition, bool isPrimary)
FindUsages\FindUsagesHelpers.cs (6)
19public static string GetDisplayName(ISymbol symbol) 22public static Task<(ISymbol symbol, Project project)?> GetRelevantSymbolAndProjectAtPositionAsync( 35public static async Task<(ISymbol symbol, Project project)?> GetRelevantSymbolAndProjectAtPositionAsync( 40var symbol = await SymbolFinder.FindSymbolAtPositionAsync(document, position, cancellationToken).ConfigureAwait(false); 68private static SymbolDisplayFormat GetFormat(ISymbol definition) 98public static ImmutableArray<TaggedText> GetDisplayParts(ISymbol definition)
FullyQualify\AbstractFullyQualifyService.cs (5)
112async Task<ImmutableArray<ISymbol>> FindAsync(string name, bool ignoreCase, SymbolFilter filter) 123ImmutableArray<ISymbol> matchingTypes) 155ImmutableArray<ISymbol> symbols) 204var member = container.GetMembers(name).FirstOrDefault(); 265private static bool HasValidContainer(ISymbol symbol)
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (2)
123foreach (var member in comparableType.GetMembers(nameof(IComparable<int>.CompareTo))) 242foreach (var member in containingType.GetMembers(GetOperatorName(kind)))
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.FieldDelegatingCodeAction.cs (1)
40var parameterToExistingFieldMap = ImmutableDictionary.CreateBuilder<string, ISymbol>();
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.GenerateConstructorWithDialogCodeAction.cs (2)
28ImmutableArray<ISymbol> viableMembers, 37internal ImmutableArray<ISymbol> ViableMembers { get; } = viableMembers;
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.State.cs (5)
30public ImmutableArray<ISymbol> SelectedMembers { get; private set; } 42ImmutableArray<ISymbol> selectedMembers, 58ImmutableArray<ISymbol> selectedMembers, 85private static ISymbol? TryMapToWritableInstanceFieldOrProperty( 87ISymbol symbol,
GenerateEqualsAndGetHashCodeFromMembers\AbstractGenerateEqualsAndGetHashCodeService.cs (5)
39Document document, INamedTypeSymbol namedType, ImmutableArray<ISymbol> members, 52ImmutableArray<ISymbol> members, INamedTypeSymbol constructedEquatableType, CancellationToken cancellationToken) 119ImmutableArray<ISymbol> members, CancellationToken cancellationToken) 129INamedTypeSymbol namedType, ImmutableArray<ISymbol> members) 149INamedTypeSymbol namedType, ImmutableArray<ISymbol> members)
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeAction.cs (2)
25ImmutableArray<ISymbol> selectedMembers, 43private readonly ImmutableArray<ISymbol> _selectedMembers = selectedMembers;
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (5)
102.SelectAccessibleMembers<ISymbol>(containingType) 201Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> selectedMembers, 241Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> members, 258Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> members, 295Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> members,
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndHashWithDialogCodeAction.cs (2)
25ImmutableArray<ISymbol> viableMembers, 37private readonly ImmutableArray<ISymbol> _viableMembers = viableMembers;
GenerateEqualsAndGetHashCodeFromMembers\IGenerateEqualsAndGetHashCodeService.cs (3)
29Task<IMethodSymbol> GenerateEqualsMethodAsync(Document document, INamedTypeSymbol namedType, ImmutableArray<ISymbol> members, string? localNameOpt, CancellationToken cancellationToken); 41Task<IMethodSymbol> GenerateIEquatableEqualsMethodAsync(Document document, INamedTypeSymbol namedType, ImmutableArray<ISymbol> members, INamedTypeSymbol constructedEquatableType, CancellationToken cancellationToken); 50Task<IMethodSymbol> GenerateGetHashCodeMethodAsync(Document document, INamedTypeSymbol namedType, ImmutableArray<ISymbol> members, CancellationToken cancellationToken);
GenerateEqualsAndGetHashCodeFromMembers\IGenerateEqualsAndGetHashCodeServiceExtensions.cs (1)
15ImmutableArray<ISymbol> members, CancellationToken cancellationToken)
GenerateFromMembers\GenerateFromMembersHelpers.cs (6)
49public static bool IsReadableInstanceFieldOrProperty(ISymbol symbol) 52public static bool IsWritableInstanceFieldOrProperty(ISymbol symbol) 55private static bool IsReadableFieldOrProperty(ISymbol symbol) 63private static bool IsWritableFieldOrProperty(ISymbol symbol) 85ImmutableArray<ISymbol> selectedMembers, ImmutableArray<NamingRule> rules) 89foreach (var symbol in selectedMembers)
GenerateFromMembers\SelectedMemberInfo.cs (2)
12ImmutableArray<ISymbol> selectedMembers) 16public readonly ImmutableArray<ISymbol> SelectedMembers = selectedMembers;
GenerateOverrides\GenerateOverridesWithDialogCodeAction.cs (4)
28ImmutableArray<ISymbol> viableMembers) : CodeActionWithOptions 33private readonly ImmutableArray<ISymbol> _viableMembers = viableMembers; 89private Task<ISymbol> GenerateOverrideAsync( 90SyntaxGenerator generator, ISymbol symbol,
GenerateType\AbstractGenerateTypeService.Editor.cs (3)
584ImmutableDictionary<string, ISymbol>.Builder parameterToFieldMap, 616ISymbol symbol) 639private bool IsSymbolAccessible(ISymbol symbol)
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (7)
104private async Task<ImmutableArray<ISymbol>> DetermineMembersAsync(GenerateTypeOptionsResult options = null) 106using var _ = ArrayBuilder<ISymbol>.GetInstance(out var members); 115private async Task AddMembersAsync(ArrayBuilder<ISymbol> members, GenerateTypeOptionsResult options = null) 173private void AddProperties(ArrayBuilder<ISymbol> members) 186IList<TArgumentSyntax> argumentList, ArrayBuilder<ISymbol> members, GenerateTypeOptionsResult options = null) 195var parameterToExistingFieldMap = ImmutableDictionary.CreateBuilder<string, ISymbol>(); 234private void AddExceptionConstructors(ArrayBuilder<ISymbol> members)
GenerateType\AbstractGenerateTypeService.State.cs (2)
294var symbol = SymbolFinder.FindSourceDefinition(TypeToGenerateInOpt, document.Project.Solution, cancellationToken); 382var symbol = leftSideInfo.Symbol;
GoToBase\AbstractGoToBaseService.cs (2)
62foreach (var baseSymbol in bases) 64var sourceDefinition = SymbolFinder.FindSourceDefinition(
GoToBase\FindBaseHelpers.cs (3)
13public static ImmutableArray<ISymbol> FindBases( 14ISymbol symbol, Solution solution, CancellationToken cancellationToken) 21var result = BaseTypeFinder.FindBaseTypesAndInterfaces(namedTypeSymbol).CastArray<ISymbol>();
GoToDefinition\AbstractGoToDefinitionSymbolService.cs (3)
18protected abstract Task<ISymbol> FindRelatedExplicitlyDeclaredSymbolAsync(Project project, ISymbol symbol, CancellationToken cancellationToken); 22public async Task<(ISymbol? symbol, Project project, TextSpan boundSpan)> GetSymbolProjectAndBoundSpanAsync(
GoToDefinition\GoToDefinitionFeatureHelpers.cs (4)
18public static ISymbol? TryGetPreferredSymbol( 19Solution solution, ISymbol? symbol, CancellationToken cancellationToken) 46var definition = SymbolFinder.FindSourceDefinition(symbol, solution, cancellationToken); 64ISymbol? symbol,
GoToDefinition\IGoToDefinitionSymbolService.cs (1)
14Task<(ISymbol? symbol, Project project, TextSpan boundSpan)> GetSymbolProjectAndBoundSpanAsync(
InheritanceMargin\AbstractInheritanceMarginService.cs (1)
68private static bool CanHaveInheritanceTarget(ISymbol symbol)
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (32)
25using SymbolAndLineNumberArray = ImmutableArray<(ISymbol symbol, int lineNumber)>; 89using var _ = ArrayBuilder<(ISymbol symbol, int lineNumber)>.GetInstance(out var builder); 102var member = semanticModel.GetDeclaredSymbol(memberDeclarationNode, cancellationToken); 321baseSymbols: baseSymbols.CastArray<ISymbol>(), 322derivedTypesSymbols: derivedSymbols.CastArray<ISymbol>(), 333baseSymbols: baseSymbols.CastArray<ISymbol>(), 334derivedTypesSymbols: derivedSymbols.CastArray<ISymbol>(), 343ISymbol memberSymbol, 403ImmutableArray<ISymbol> baseSymbols, 404ImmutableArray<ISymbol> derivedTypesSymbols, 438ISymbol memberSymbol, 440ImmutableArray<ISymbol> implementingMembers, 465ImmutableArray<ISymbol> baseSymbols, 466ImmutableArray<ISymbol> derivedTypesSymbols, 502ISymbol memberSymbol, 504ImmutableArray<ISymbol> implementedMembers, 505ImmutableArray<ISymbol> overridingMembers, 506ImmutableArray<ISymbol> overriddenMembers, 550ISymbol targetSymbol, 554var symbolInSource = SymbolFinder.FindSourceDefinition(targetSymbol, solution, cancellationToken); 584private static ImmutableArray<ISymbol> GetImplementedSymbolsForTypeMember( 585ISymbol memberSymbol, 586ImmutableArray<ISymbol> overriddenSymbols) 590using var _ = ArrayBuilder<ISymbol>.GetInstance(out var builder); 602foreach (var symbol in overriddenSymbols) 616private static async Task<ImmutableArray<ISymbol>> GetImplementingSymbolsForTypeMemberAsync( 618ISymbol memberSymbol, 624using var _ = ArrayBuilder<ISymbol>.GetInstance(out var builder); 651private static ImmutableArray<ISymbol> GetOverriddenSymbols(ISymbol memberSymbol, bool allowLooseMatch) 656using var _ = ArrayBuilder<ISymbol>.GetInstance(out var builder); 706private static DefinitionItem? ToSlimDefinitionItem(ISymbol symbol, Solution solution)
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (19)
122var siblingFieldOrProperty = TryFindSiblingFieldOrProperty(parameter, blockStatement); 170var fields = parameters.SelectAsArray(p => (ISymbol)CreateField(p, accessibilityModifiersRequired, rules)); 171var properties = parameters.SelectAsArray(p => (ISymbol)CreateProperty(p, accessibilityModifiersRequired, rules)); 241ISymbol fieldOrProperty, 260private static ISymbol? TryFindSiblingFieldOrProperty( 265TryFindFieldOrPropertyAssignmentStatement(siblingParam, blockStatement, out var sibling); 361ImmutableArray<ISymbol> fieldsOrProperties, 382var fieldOrProperty = fieldsOrProperties[i]; 425ISymbol fieldOrProperty, 449var finalFieldOrProperty = SymbolFinder.FindSimilarSymbols(currentFieldOrProperty, compilation, cancellationToken).FirstOrDefault(); 469private static async Task<(Document documentWithMemberAdded, IParameterSymbol? currentParameter, ISymbol? currentFieldOrProperty)> AddMissingFieldOrPropertyAsync( 474ISymbol fieldOrProperty, 530var currentFieldOrProperty = currentParameter?.ContainingType 541where TSymbol : ISymbol 546sibling, blockStatement, out var fieldOrProperty); 574IParameterSymbol parameter, IBlockOperation? blockStatement, out ISymbol? fieldOrProperty) 614private async Task<(ISymbol?, bool isThrowNotImplementedProperty)> TryFindMatchingUninitializedFieldOrPropertySymbolAsync( 631foreach (var memberWithName in containingType.GetMembers(memberName)) 668static bool ContainsMemberAssignment(IBlockOperation? blockStatement, ISymbol member)
InlineHints\InlineHintHelpers.cs (1)
26var symbol = symbolKey.Resolve(semanticModel.Compilation, cancellationToken: cancellationToken).Symbol;
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (6)
212var callerSymbol = GetCallerSymbol(calleeInvocationNode, semanticModel, cancellationToken); 252ISymbol callerSymbol, 295ISymbol callerSymbol, 369ISymbol callerSymbol, 571private ISymbol? GetCallerSymbol( 578var declaredSymbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (13)
251ImmutableDictionary<ISymbol, string> renameTable) 277ImmutableDictionary<ISymbol, string> renameTable, 289ImmutableDictionary<ISymbol, SyntaxNode> replacementTable, 322private ImmutableDictionary<ISymbol, SyntaxNode> ComputeReplacementTable( 327ImmutableDictionary<ISymbol, string> renameTable) 331(parameter, argument) => (parameter: (ISymbol)parameter, 334.Select(parameterAndExpressionPair => (parameter: (ISymbol)parameterAndExpressionPair.Key, 338.Select(parameterAndName => (parameter: (ISymbol)parameterAndName.parameter, 351private static ImmutableDictionary<ISymbol, string> ComputeRenameTable( 360var renameTable = new Dictionary<ISymbol, string>(); 363foreach (var symbol in parametersNeedGenerateFreshVariableFor.Concat(localSymbolsInCallee)) 382private readonly HashSet<ISymbol> _allSymbols = []; 389public static ImmutableHashSet<ISymbol> GetAllSymbols(
InlineTemporary\AbstractInlineTemporaryCodeRefactoringProvider.cs (1)
30var local = semanticModel.GetDeclaredSymbol(variableDeclarator, cancellationToken);
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (3)
73var containingSymbol = semanticModel.GetDeclaredSymbol(containingMethod, cancellationToken); 77var expressionSymbol = semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol; 203var symbol = semanticModel.GetSymbolInfo(variable, cancellationToken).Symbol;
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
70var symbol = semanticModel.GetSymbolInfo(variable, cancellationToken).Symbol;
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (6)
364using var _0 = ArrayBuilder<ISymbol>.GetInstance(out var localVariables); 367using var _1 = PooledDictionary<ISymbol, int>.GetInstance(out var variableDeclarationIndex); 368using var _2 = PooledDictionary<ISymbol, int>.GetInstance(out var lastVariableUsageIndex); 378using var _ = PooledHashSet<ISymbol>.GetInstance(out var referencedVariables); 430HashSet<ISymbol> referencedVariables, 432ArrayBuilder<ISymbol> localVariables,
LanguageServiceIndexFormat\SymbolMoniker.cs (3)
15public static bool HasMoniker(ISymbol symbol) 44public static SymbolMoniker Create(ISymbol symbol) 71static string GetRequiredDocumentationCommentId(ISymbol symbol)
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.cs (3)
62ISymbol orderSymbol, 147ISymbol symbol) 225private static SymbolDisplayPart Part(SymbolDisplayPartKind kind, ISymbol? symbol, string text)
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.StructuralTypeCollectorVisitor.cs (1)
18public override void DefaultVisit(ISymbol node)
LanguageServices\AnonymousTypeDisplayService\IStructuralTypeDisplayService.cs (1)
13ISymbol orderSymbol,
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (18)
84private readonly Func<ISymbol?, string?> _getNavigationHint; 110protected abstract Task<ImmutableArray<SymbolDisplayPart>> GetInitializerSourcePartsAsync(ISymbol symbol); 111protected abstract ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(ISymbol symbol, SemanticModel semanticModel, int position, SymbolDisplayFormat format); 112protected abstract string? GetNavigationHint(ISymbol? symbol); 150protected virtual ImmutableArray<SymbolDisplayPart> WrapConstraints(ISymbol symbol, ImmutableArray<SymbolDisplayPart> displayParts) 153private async Task AddPartsAsync(ImmutableArray<ISymbol> symbols) 155var firstSymbol = symbols[0]; 171private void AddDocumentationContent(ISymbol symbol, DocumentationComment documentationComment) 232protected abstract void AddCaptures(ISymbol symbol); 261foreach (var captured in captures) 282ImmutableArray<ISymbol> symbolGroup, SymbolDescriptionGroups groups) 291public async Task<IDictionary<SymbolDescriptionGroups, ImmutableArray<TaggedText>>> BuildDescriptionSectionsAsync(ImmutableArray<ISymbol> symbolGroup) 300private async Task AddDescriptionPartAsync(ISymbol symbol) 685private void AddDescriptionForArbitrarySymbol(ISymbol symbol) 703ImmutableArray<ISymbol> symbolGroup) 720private static int GetOverloadCount(ImmutableArray<ISymbol> symbolGroup) 804protected ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(ISymbol symbol, SymbolDisplayFormat? format = null) 810private static IEnumerable<SymbolDisplayPart> Part(SymbolDisplayPartKind kind, ISymbol? symbol, string text)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AnonymousTypes.cs (1)
15private void FixAllStructuralTypes(ISymbol firstSymbol)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.cs (4)
25public Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ISymbol symbol, SymbolDescriptionOptions options, SymbolDescriptionGroups groups, CancellationToken cancellationToken) 28public async Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups, CancellationToken cancellationToken) 34public async Task<ImmutableArray<SymbolDisplayPart>> ToDescriptionPartsAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups, CancellationToken cancellationToken) 46SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, CancellationToken cancellationToken)
LanguageServices\SymbolDisplayService\ISymbolDisplayService.cs (4)
15Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ISymbol symbol, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, CancellationToken cancellationToken = default); 16Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, CancellationToken cancellationToken = default); 17Task<ImmutableArray<SymbolDisplayPart>> ToDescriptionPartsAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, CancellationToken cancellationToken = default); 18Task<IDictionary<SymbolDescriptionGroups, ImmutableArray<TaggedText>>> ToDescriptionGroupsAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, CancellationToken cancellationToken = default);
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedNamespaceOrTypeSymbol.cs (2)
22public abstract ImmutableArray<ISymbol> GetMembers(); 23public abstract ImmutableArray<ISymbol> GetMembers(string name);
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (6)
18private readonly ISymbol _symbol; 22protected AbstractWrappedSymbol(ISymbol symbol, bool canImplementImplicitly, IDocumentationCommentFormattingService docCommentFormattingService) 37public ISymbol ContainingSymbol => _symbol.ContainingSymbol; 73public ISymbol OriginalDefinition => _symbol.OriginalDefinition; 107public bool Equals(ISymbol other) 110public bool Equals(ISymbol other, SymbolEqualityComparer equalityComparer)
MetadataAsSource\AbstractMetadataAsSourceService.cs (3)
24ISymbol symbol, 86protected abstract Task<Document> AddAssemblyInfoRegionAsync(Document document, Compilation symbolCompilation, ISymbol symbol, CancellationToken cancellationToken); 92private static INamespaceOrTypeSymbol CreateCodeGenerationSymbol(Document document, ISymbol symbol)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedFieldSymbol.cs (1)
22public ISymbol AssociatedSymbol => _symbol.AssociatedSymbol;
MetadataAsSource\AbstractMetadataAsSourceService.WrappedMethodSymbol.cs (1)
21public ISymbol AssociatedSymbol => _symbol.AssociatedSymbol;
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (8)
20private readonly ImmutableArray<ISymbol> _members; 43private static ISymbol WrapMember(ISymbol m, bool canImplementImplicitly, IDocumentationCommentFormattingService docCommentFormattingService) 69public ISymbol AssociatedSymbol => _symbol.AssociatedSymbol; 99public ISymbol FindImplementationForInterfaceMember(ISymbol interfaceMember) 102public override ImmutableArray<ISymbol> GetMembers() 107public override ImmutableArray<ISymbol> GetMembers(string name)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedPropertySymbol.cs (2)
60ISymbol ISymbol.OriginalDefinition => _symbol.OriginalDefinition;
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (1)
66ISymbol symbol,
MetadataAsSource\IMetadataAsSourceFileProvider.cs (1)
23ISymbol symbol,
MetadataAsSource\IMetadataAsSourceFileService.cs (2)
29ISymbol symbol, 46bool IsNavigableMetadataSymbol(ISymbol symbol);
MetadataAsSource\IMetadataAsSourceService.cs (1)
26Task<Document> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, SyntaxFormattingOptions? formattingOptions, CancellationToken cancellationToken);
MetadataAsSource\MetadataAsSourceFileService.cs (2)
72ISymbol symbol, 277public bool IsNavigableMetadataSymbol(ISymbol symbol)
MetadataAsSource\MetadataAsSourceHelpers.cs (3)
50public static INamedTypeSymbol GetTopLevelContainingNamedType(ISymbol symbol) 53public static INamedTypeSymbol? TryGetTopLevelContainingNamedType(ISymbol symbol) 56var topLevelNamedType = symbol;
MetadataAsSource\SymbolMappingServiceFactory.cs (1)
40public Task<SymbolMappingResult?> MapSymbolAsync(Document document, ISymbol symbol, CancellationToken cancellationToken)
MoveStaticMembers\IMoveStaticMembersOptionsService.cs (1)
12MoveStaticMembersOptions GetMoveMembersToTypeOptions(Document document, INamedTypeSymbol selectedType, ImmutableArray<ISymbol> selectedNodeSymbols);
MoveStaticMembers\MoveStaticMembersOptions.cs (3)
28public ImmutableArray<ISymbol> SelectedMembers { get; } 38ImmutableArray<ISymbol> selectedMembers, 56ImmutableArray<ISymbol> selectedMembers,
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (5)
29ImmutableArray<ISymbol> selectedMembers) : CodeActionWithOptions 32private readonly ImmutableArray<ISymbol> _selectedMembers = selectedMembers; 160ImmutableArray<ISymbol> selectedMembers, 347ImmutableArray<ISymbol> members, 354foreach (var member in members)
MoveToNamespace\AbstractMoveToNamespaceService.cs (2)
186private static async Task<ImmutableArray<ISymbol>> GetMemberSymbolsAsync(Document document, SyntaxNode container, CancellationToken cancellationToken) 287private static string GetNewSymbolName(ISymbol symbol, string targetNamespace)
MoveToNamespace\MoveToNamespaceResult.cs (2)
19public ImmutableDictionary<string, ISymbol> NewNameOriginalSymbolMapping { get; } 26ImmutableDictionary<string, ISymbol> newNameOriginalSymbolMapping)
Navigation\AbstractNavigableItemsService.cs (3)
43async Task<(ISymbol symbol, Solution solution)?> GetSymbolAsync(Document document) 60var typeSymbol = symbol.GetSymbolType() as ISymbol;
Navigation\DefaultSymbolNavigationService.cs (2)
15public Task<INavigableLocation?> GetNavigableLocationAsync(ISymbol symbol, Project project, CancellationToken cancellationToken) 18public Task<bool> TrySymbolNavigationNotifyAsync(ISymbol symbol, Project project, CancellationToken cancellationToken)
Navigation\ISymbolNavigationService.cs (2)
22Task<INavigableLocation?> GetNavigableLocationAsync(ISymbol symbol, Project project, CancellationToken cancellationToken); 26Task<bool> TrySymbolNavigationNotifyAsync(ISymbol symbol, Project project, CancellationToken cancellationToken);
Navigation\NavigableItemFactory.cs (4)
17Solution solution, ISymbol symbol, Location location, 26ISymbol symbol, 36Solution solution, ISymbol symbol, CancellationToken cancellationToken) 53private static IEnumerable<Location> GetPreferredSourceLocations(ISymbol symbol)
Navigation\NavigableItemFactory.SymbolLocationNavigableItem.cs (2)
20ISymbol symbol, 25private readonly ISymbol _symbol = symbol;
NavigationBar\AbstractNavigationBarItemService.cs (3)
44Solution solution, ISymbol symbol, SyntaxTree tree, Func<SyntaxReference, TextSpan> computeFullSpan) 50Solution solution, ISymbol symbol, SyntaxTree tree, 91Solution solution, ISymbol symbol, SyntaxTree tree, ISymbolDeclarationService symbolDeclarationService)
PdbSourceDocument\IImplementationAssemblyLookupService.cs (1)
26string? FollowTypeForwards(ISymbol symbol, string dllPath, IPdbSourceDocumentLogger? logger);
PdbSourceDocument\ImplementationAssemblyLookupService.cs (1)
55public string? FollowTypeForwards(ISymbol symbol, string dllPath, IPdbSourceDocumentLogger? logger)
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (3)
82ISymbol symbol, 120var symbolToFind = symbol is IParameterSymbol parameterSymbol ? parameterSymbol.ContainingSymbol : symbol; 161var newSymbol = resolution.Symbol;
PickMembers\IPickMembersService.cs (1)
13string title, ImmutableArray<ISymbol> members,
PickMembers\PickMembersResult.cs (2)
14public readonly ImmutableArray<ISymbol> Members; 26ImmutableArray<ISymbol> members,
PullMemberUp\AbstractPullMemberUpRefactoringProvider.cs (1)
79ImmutableArray<ISymbol> selectedMembers,
PullMemberUp\Dialog\IPullMemberUpOptionsService.cs (1)
13PullMembersUpOptions GetPullMemberUpOptions(Document document, ImmutableArray<ISymbol> selectedNodeSymbols);
PullMemberUp\Dialog\PullMemberUpWithDialogCodeAction.cs (2)
20ImmutableArray<ISymbol> selectedMembers, 26private readonly ImmutableArray<ISymbol> _selectedMembers = selectedMembers;
PullMemberUp\MemberAnalysisResult.cs (2)
8ISymbol member, 17public readonly ISymbol Member = member;
PullMemberUp\MemberAndDestinationValidator.cs (1)
28public static bool IsMemberValid([NotNullWhen(true)] ISymbol? member)
PullMemberUp\MembersPuller.cs (14)
39ImmutableArray<ISymbol> selectedMembers, 148private static ISymbol GetSymbolsToPullUp(MemberAnalysisResult analysisResult) 198ISymbol member, 441private static ISymbol MakeAbstractVersion(ISymbol member) 467private static async Task<ImmutableDictionary<ISymbol, ImmutableArray<SyntaxNode>>> InitializeSymbolToDeclarationsMapAsync( 473var symbolToDeclarationsBuilder = ImmutableDictionary.CreateBuilder<ISymbol, ImmutableArray<SyntaxNode>>(); 489private static bool IsSelectedMemberDeclarationAlreadyInDestination(ISymbol selectedMember, INamedTypeSymbol destination) 496private static bool IsSelectedMemberDeclarationAlreadyInDestinationClass(ISymbol selectedMember, INamedTypeSymbol destination) 506var overrideMembersSet = new HashSet<ISymbol>(); 507for (var symbol = selectedMember; symbol != null; symbol = symbol.GetOverriddenMember()) 516ISymbol selectedMember, INamedTypeSymbol destination) 518foreach (var interfaceMember in destination.GetMembers()) 520var implementationOfMember = selectedMember.ContainingType.FindImplementationForInterfaceMember(interfaceMember);
PullMemberUp\PullMembersUpOptionsBuilder.cs (1)
14ImmutableArray<(ISymbol member, bool makeAbstract)> members)
QuickInfo\CommonSemanticQuickInfoProvider.cs (11)
134private static bool HasNoErrors(ImmutableArray<ISymbol> symbols) 189protected virtual NullableFlowState GetNullabilityAnalysis(SemanticModel semanticModel, ISymbol symbol, SyntaxNode node, CancellationToken cancellationToken) => NullableFlowState.None; 200var symbolSet = new HashSet<ISymbol>(SymbolEquivalenceComparer.Instance); 201using var _ = ArrayBuilder<ISymbol>.GetInstance(out var filteredSymbols); 229void AddSymbols(ImmutableArray<ISymbol> symbols, bool checkAccessibility) 231foreach (var symbol in symbols) 245private ImmutableArray<ISymbol> GetSymbolsFromToken(SyntaxToken token, SolutionServices services, SemanticModel semanticModel, CancellationToken cancellationToken) 249var symbol = semanticModel.GetSymbolInfo(lambdaSyntax, cancellationToken).Symbol; 255var symbol = semanticModel.GetSymbolInfo(elementAccessExpression, cancellationToken).Symbol; 272private static bool IsOk([NotNullWhen(returnValue: true)] ISymbol? symbol) 286private static bool IsAccessible(ISymbol symbol, INamedTypeSymbol? within)
QuickInfo\CommonSemanticQuickInfoProvider.ErrorVisitor.cs (2)
17public static bool ContainsError(ISymbol? symbol) 20public override bool DefaultVisit(ISymbol symbol)
QuickInfo\CommonSemanticQuickInfoProvider.TokenInfo.cs (2)
11public readonly struct TokenInformation(ImmutableArray<ISymbol> symbols, bool showAwaitReturn = false, NullableFlowState nullableFlowState = NullableFlowState.None) 13public ImmutableArray<ISymbol> Symbols => symbols.NullToEmpty();
QuickInfo\QuickInfoUtilities.cs (3)
26public static Task<QuickInfoItem> CreateQuickInfoItemAsync(SolutionServices services, SemanticModel semanticModel, TextSpan span, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, CancellationToken cancellationToken) 33ImmutableArray<ISymbol> symbols, 46var symbol = symbols.First();
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (1)
88var symbol = documentEditor.SemanticModel.GetDeclaredSymbol(node, cancellationToken);
Rename\IRenameIssuesService.cs (1)
13SemanticModel semantic, ISymbol symbol, SyntaxToken triggerToken, [NotNullWhen(true)] out string? langError);
Rename\SymbolicRenameInfo.cs (2)
34public ISymbol? Symbol { get; } 47ISymbol symbol,
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (4)
61var symbol = GetEnclosingSymbol(semanticModel, span.Start, cancellationToken); 101var childMember = namedType.GetMembers().FirstOrDefault(m => syntaxFacts.StringComparer.Equals(m.Name, singleWordText)); 132private static ISymbol? GetEnclosingSymbol(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 139if (semanticModel.GetDeclaredSymbol(node, cancellationToken) is ISymbol declaration)
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (1)
428where TSymbol : class, ISymbol
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (1)
423where TSymbol : class, ISymbol
RQName\RQNameInternal.cs (1)
16public static string? From(ISymbol symbol)
RQName\RQNodeBuilder.cs (1)
19public static RQNode? Build(ISymbol symbol)
Shared\Extensions\DocumentExtensions.cs (1)
94public static async Task<NamingRule> GetApplicableNamingRuleAsync(this Document document, ISymbol symbol, CancellationToken cancellationToken)
Shared\Extensions\ISymbolExtensions_2.cs (5)
16public static Glyph GetGlyph(this ISymbol symbol) 184public static ImmutableArray<TaggedText> GetDocumentationParts(this ISymbol symbol, SemanticModel semanticModel, int position, IDocumentationCommentFormattingService formatter, CancellationToken cancellationToken) 191public static DocumentationComment GetAppropriateDocumentationComment(this ISymbol symbol, Compilation compilation, CancellationToken cancellationToken) 207var containingSymbol = parameter.ContainingSymbol; 234this ISymbol symbol, SemanticModel semanticModel, int position, IDocumentationCommentFormattingService formatter)
Shared\Extensions\ISymbolExtensions_Sorting.cs (5)
25where TSymbol : ISymbol 34where TSymbol : ISymbol 131ISymbol symbol, 138private static ImmutableArray<IParameterSymbol> GetMethodOrIndexerOrEventParameters(ISymbol symbol) 156where TSymbol : ISymbol
Shared\Utilities\AnnotatedSymbolMapping.cs (8)
16ImmutableDictionary<ISymbol, SyntaxAnnotation> symbolToDeclarationAnnotationMap, 18ImmutableDictionary<DocumentId, ImmutableArray<ISymbol>> documentIdsToSymbolMap, 25public ImmutableDictionary<ISymbol, SyntaxAnnotation> SymbolToDeclarationAnnotationMap { get; } = symbolToDeclarationAnnotationMap; 35public ImmutableDictionary<DocumentId, ImmutableArray<ISymbol>> DocumentIdsToSymbolMap { get; } = documentIdsToSymbolMap; 48IEnumerable<ISymbol> symbols, 53using var _ = PooledDictionary<ISymbol, SyntaxAnnotation>.GetInstance(out var symbolToDeclarationAnnotationMap); 55using var _2 = PooledDictionary<DocumentId, List<ISymbol>>.GetInstance(out var documentIdToSymbolsMap); 67foreach (var symbol in symbols)
Shared\Utilities\ExtractTypeHelpers.cs (4)
116Document document, SyntaxFormattingOptions formattingOptions, INamedTypeSymbol type, ImmutableArray<ISymbol> extractableMembers, CancellationToken cancellationToken) 132INamedTypeSymbol type, ImmutableArray<ISymbol> includedMembers) 187ImmutableArray<ITypeParameterSymbol> potentialTypeParameters, ImmutableArray<ISymbol> includedMembers) 201private static bool DoesMemberReferenceTypeParameter(ISymbol member, ITypeParameterSymbol typeParameter, HashSet<ITypeSymbol> checkedTypes)
Shared\Utilities\LinkedFilesSymbolEquivalenceComparer.cs (4)
14internal sealed class LinkedFilesSymbolEquivalenceComparer : IEqualityComparer<ISymbol> 18public bool Equals(ISymbol? x, ISymbol? y) 21public int GetHashCode(ISymbol symbol)
SignatureHelp\AbstractSignatureHelpProvider.cs (6)
133ISymbol orderSymbol, 151ISymbol orderSymbol, 168ISymbol orderSymbol, 267symbolKey.Resolve(compilation, ignoreAssemblyKey: true, cancellationToken).Symbol is not ISymbol symbol) 340protected static int? TryGetSelectedIndex<TSymbol>(ImmutableArray<TSymbol> candidates, ISymbol? currentSymbol) where TSymbol : class, ISymbol
SignatureHelp\AbstractSignatureHelpProvider.SymbolKeySignatureHelpItem.cs (1)
14ISymbol symbol,
Snippets\SnippetFunctionService.cs (1)
79foreach (var member in enumFields)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (4)
58public (bool accessesBase, ImmutableArray<ISymbol> members, ImmutableArray<IOperation> statements) GetHashedMembers(ISymbol? owningSymbol, IOperation? operation) 89private (bool accessesBase, ImmutableArray<ISymbol> members)? MatchTuplePattern( 112private (bool accessesBase, ImmutableArray<ISymbol> members)? MatchAccumulatorPattern(
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.OperationDeconstructor.cs (6)
28private readonly ArrayBuilder<ISymbol> _hashedSymbols = ArrayBuilder<ISymbol>.GetInstance(); 34public readonly (bool accessesBase, ImmutableArray<ISymbol> hashedSymbol) GetResult() 144if (TryGetFieldOrProperty(value, out var fieldOrProp) && 168private static bool TryGetFieldOrProperty(IOperation operation, [NotNullWhen(true)] out ISymbol? symbol) 188private readonly bool TryAddSymbol(ISymbol member)
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (4)
118foreach (var member in members) 142foreach (var member in namedType.GetMembers()) 237private static bool IsWrittenTo(IOperation? operation, ISymbol owningSymbol) 253private static bool IsFieldWrite(IFieldReferenceOperation fieldReference, ISymbol owningSymbol)
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (2)
71var symbol = context.SemanticModel.GetDeclaredSymbol(namespaceDecl); 179var symbol = semanticModel.GetDeclaredSymbol(typeDecl);
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (3)
40protected abstract bool ShouldIgnore(ISymbol symbol); 85var symbol = syntaxContext.SemanticModel.GetDeclaredSymbol(syntaxContext.Node, syntaxContext.CancellationToken); 111ISymbol symbol,
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
35protected abstract ICollection<ISymbol> GetMissingEnumMembers(TSwitchOperation operation);
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchExpressionDiagnosticAnalyzer.cs (1)
29protected sealed override ICollection<ISymbol> GetMissingEnumMembers(ISwitchExpressionOperation operation)
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchStatementDiagnosticAnalyzer.cs (1)
29protected sealed override ICollection<ISymbol> GetMissingEnumMembers(ISwitchOperation operation)
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchExpressionHelpers.cs (5)
16public static ICollection<ISymbol> GetMissingEnumMembers(ISwitchExpressionOperation operation) 29var enumMembers = new Dictionary<long, ISymbol>(); 52ISwitchExpressionOperation operation, Dictionary<long, ISymbol> enumMembers) 64internal static void HandleBinaryPattern(IBinaryPatternOperation? binaryPattern, Dictionary<long, ISymbol> enumMembers) 76private static void RemoveIfConstantPatternHasValue(IOperation operation, Dictionary<long, ISymbol> enumMembers)
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchStatementHelpers.cs (5)
55public static ICollection<ISymbol> GetMissingEnumMembers(ISwitchOperation switchStatement) 60var enumMembers = new Dictionary<long, ISymbol>(); 97private static bool TryRemoveExistingEnumMembers(ISwitchOperation switchStatement, Dictionary<long, ISymbol> enumValues) 153Dictionary<long, ISymbol> enumValues) 155foreach (var member in enumType.GetMembers())
src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (2)
42protected abstract bool CanMemberAccessBeQualified(ISymbol containingSymbol, SyntaxNode node); 144static bool IsStaticMemberOrIsLocalFunctionHelper(ISymbol symbol)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
752using var _2 = PooledHashSet<ISymbol>.GetInstance(out var processedPartialSymbols);
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\SuppressMessageAttributeState.cs (1)
95out ImmutableArray<ISymbol> resolvedSymbols)
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (25)
89protected virtual void HandleNamedTypeSymbolStart(SymbolStartAnalysisContext context, Action<ISymbol, ValueUsageInfo> onSymbolUsageFound) 99internal sealed class OriginalDefinitionSymbolEqualityComparer : IEqualityComparer<ISymbol> 107bool IEqualityComparer<ISymbol>.Equals(ISymbol? x, ISymbol? y) 110int IEqualityComparer<ISymbol>.GetHashCode(ISymbol obj) 118private static readonly ObjectPool<HashSet<ISymbol>> s_originalDefinitionSymbolHashSetPool = new(() => new(OriginalDefinitionSymbolEqualityComparer.Instance)); 123private readonly Dictionary<ISymbol, ValueUsageInfo> _symbolValueUsageStateMap_doNotAccessDirectly = new(OriginalDefinitionSymbolEqualityComparer.Instance); 165private static Location GetDiagnosticLocation(ISymbol symbol) 230Action<ISymbol, ValueUsageInfo> onSymbolUsageFound = OnSymbolUsage; 283foreach (var member in namedType.GetMembers()) 302var symbol = symbolContext.Symbol; 315private void AddSymbolUsage(ISymbol? symbol, ValueUsageInfo info) 326private void UpdateSymbolUsage(ISymbol? symbol, ValueUsageInfo info) 340private bool TryGetAndRemoveSymbolUsage(ISymbol memberSymbol, out ValueUsageInfo valueUsageInfo) 380private void OnSymbolUsage(ISymbol? memberSymbol, ValueUsageInfo usageInfo) 391var memberSymbol = memberReference.Member; 526foreach (var member in namedType.GetMembers()) 625ISymbol member, 667HashSet<ISymbol> builder, 687var symbol = lazyModel.GetSymbolInfo(node, cancellationToken).Symbol; 749foreach (var member in namedTypeSymbol.GetMembers()) 764private void AddDebuggerDisplayAttributeArgumentsCore(ISymbol symbol, ArrayBuilder<string> builder) 790private bool IsCandidateSymbol([NotNullWhen(true)] ISymbol? memberSymbol)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (2)
273public bool IsComputingUnusedParams(ISymbol symbol) 278ISymbol symbol,
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (7)
32/// We use this value in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/> to determine whether to bail from analysis or not. 45/// We use this value in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/> to determine whether to bail from analysis or not. 51/// We use this value in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/> to determine whether to bail from analysis or not. 253/// delegate escape, and corresponding bail out from flow analysis in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/>. 301/// delegate escape, and corresponding bail out from flow analysis in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/>. 366private bool ShouldAnalyze(IOperation operationBlock, ISymbol owningSymbol, ref bool hasUnknownOperationNoneDescendant) 589ISymbol symbol,
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
120foreach (var member in namedType.GetMembers())
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractObjectCreationExpressionAnalyzer.cs (1)
141var initializedSymbol = semanticModel.GetDeclaredSymbol(valuePattern.GetRequiredParent(), cancellationToken);
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (2)
56public readonly ISymbol? InitializedSymbol; 63ISymbol? initializedSymbol)
src\Analyzers\Core\Analyzers\UseCompoundAssignment\UseCompoundAssignmentUtilities.cs (1)
109var symbol = symbolInfo.Symbol;
src\Analyzers\Core\Analyzers\UseConditionalExpression\AbstractUseConditionalExpressionDiagnosticAnalyzer.cs (1)
31IConditionalOperation ifOperation, ISymbol containingSymbol, CancellationToken cancellationToken);
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentDiagnosticAnalyzer.cs (1)
25IConditionalOperation ifOperation, ISymbol containingSymbol, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnDiagnosticAnalyzer.cs (1)
25IConditionalOperation ifOperation, ISymbol containingSymbol, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\UseConditionalExpressionForReturnHelpers.cs (1)
17ISymbol containingSymbol,
src\Analyzers\Core\Analyzers\UseExplicitTupleName\UseExplicitTupleNameDiagnosticAnalyzer.cs (1)
79foreach (var member in containingType.GetMembers())
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
101var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (2)
22public static bool IsSystemNullableValueProperty([NotNullWhen(true)] ISymbol? symbol) 320var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
src\Analyzers\Core\Analyzers\UseObjectInitializer\UseNamedMemberInitializerAnalyzer.cs (3)
128if (IsExplicitlyImplemented(type, leftSymbol, out var typeMember)) 178ISymbol? member, 179[NotNullWhen(true)] out ISymbol? typeMember)
src\Analyzers\Core\Analyzers\UseSystemHashCode\UseSystemHashCodeDiagnosticAnalyzer.cs (1)
45var owningSymbol = context.OwningSymbol;
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (6)
106if (!TryDecomposeIfCondition(ifOperation, out var localOrParameter)) 138private static bool ValueIsAccessed(SemanticModel semanticModel, IConditionalOperation ifOperation, IBlockOperation containingBlock, ISymbol localOrParameter, IExpressionStatementOperation expressionStatement, IAssignmentOperation assignmentExpression) 167IBlockOperation containingBlock, IConditionalOperation ifOperation, ISymbol localOrParameter, 189if (!TryGetLocalOrParameterSymbol(assignmentExpression.Value, out var assignmentValue)) 209[NotNullWhen(true)] out ISymbol? localOrParameter) 241[NotNullWhen(true)] out ISymbol? localOrParameter)
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
52var symbol = semanticModel.GetDeclaredSymbol(declarator, cancellationToken);
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AddAccessibilityModifiersHelpers.cs (2)
13SyntaxEditor editor, ISymbol symbol, SyntaxNode declaration) 39private static Accessibility GetPreferredAccessibility(ISymbol symbol)
src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (1)
50using var _ = ArrayBuilder<ISymbol>.GetInstance(out var candidateSymbols);
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
112for (ISymbol current = symbol; current != null; current = current.ContainingSymbol)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
123protected static bool IsSymbolAccessible(ISymbol? symbol, SemanticDocument document)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (3)
55private ImmutableDictionary<string, ISymbol>? _parameterToExistingMemberMap; 403var definition = SymbolFinderInternal.FindSourceDefinition(original, _document.Project.Solution, cancellationToken); 461private async Task<(ImmutableArray<ISymbol>, ImmutableArray<SyntaxNode>)> GenerateMembersAndAssignmentsAsync(
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (9)
50private static bool IsSymbolAccessible(Compilation compilation, ISymbol symbol) 132ImmutableDictionary<string, ISymbol> parameterToExistingMemberMap, 149var parameterToExistingMemberMap = ImmutableDictionary.CreateBuilder<string, ISymbol>(); 186var symbol = TryFindMatchingMember(parameterName); 239ISymbol? TryFindMatchingMember(ParameterName parameterName) 245var symbol = TryFindMemberWithRule(fieldNamingRule, parameterNameParts); 261ISymbol? TryFindMemberWithRule(NamingRule rule, IdentifierNameParts parameterNameParts) 311private static bool IsSymbolAccessible(ISymbol? symbol, SemanticDocument document) 347ISymbol symbol,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
24protected abstract bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (6)
344var previousAssignedSymbol = TryGetAssignedSymbol(symbolKind, children, statementindex - 1, cancellationToken); 345var nextAssignedSymbol = TryGetAssignedSymbol(symbolKind, children, statementindex + 1, cancellationToken); 360private ISymbol TryGetAssignedSymbol( 377var symbol = _document.SemanticModel.GetSymbolInfo(left, cancellationToken).Symbol; 392var symbol = semanticModel.GetEnclosingSymbol(position, cancellationToken); 406private static bool FieldIsReadOnly(ISymbol symbol)
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (19)
35ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> unimplementedMembers) 41private readonly ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> _unimplementedMembers = unimplementedMembers; 89ISymbol? throughMember, bool? canDelegateAllMembers, CancellationToken cancellationToken) 126private ImmutableArray<ISymbol> GenerateMembers( 127Compilation compilation, ISymbol? throughMember, 137private ISymbol? GenerateMember( 138Compilation compilation, ISymbol member, ISymbol? throughMember, 151private ISymbol? GenerateMember( 152Compilation compilation, ISymbol member, ISymbol? throughMember, bool addUnsafe, 175private ISymbol GenerateMethod( 176Compilation compilation, IMethodSymbol method, ISymbol? throughMember, 197ISymbol? throughMember, 238IEventSymbol @event, ISymbol? throughMember, Accessibility accessibility, DeclarationModifiers modifiers) 248IEventSymbol @event, IMethodSymbol? accessor, ISymbol? throughMember, 269public ImmutableArray<(ISymbol symbol, bool canDelegateAllMembers)> GetDelegatableMembers(CancellationToken cancellationToken) 277using var _ = ArrayBuilder<(ISymbol symbol, bool canDelegateAllMembers)>.GetInstance(out var result); 284foreach (var member in members)
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (2)
156foreach (var member in delegatableMembers) 200private static ImmutableArray<ISymbol> GetDelegatableMembers(
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.cs (2)
102public ImmutableArray<ISymbol> ImplementInterfaceMember( 108ISymbol interfaceMember)
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.State.cs (3)
36public ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> MembersWithoutExplicitOrImplicitImplementationWhichCanBeImplicitlyImplemented => Info.MembersWithoutExplicitOrImplicitImplementationWhichCanBeImplicitlyImplemented; 37public ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> MembersWithoutExplicitOrImplicitImplementation => Info.MembersWithoutExplicitOrImplicitImplementation; 40public ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> MembersWithoutExplicitImplementation => Info.MembersWithoutExplicitImplementation;
src\Analyzers\Core\CodeFixes\ImplementInterface\IImplementInterfaceService.cs (3)
19public ISymbol? ThroughMember { get; init; } 40ImmutableArray<ISymbol> ImplementInterfaceMember( 46ISymbol interfaceMember);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (3)
18public static ImmutableArray<ISymbol> GetDelegatableMembers( 120ISymbol? first, INamedTypeSymbol second, bool supportsImplicitImplementationOfNonPublicInterfaceMembers) 254foreach (var member in idisposable.GetMembers(nameof(IDisposable.Dispose)))
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (29)
46private ISymbol? ThroughMember => Configuration.ThroughMember; 76ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> unimplementedMembers, 77ImmutableArray<ISymbol> extraMembers, 106private ImmutableArray<ISymbol> GenerateMembers( 109ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> unimplementedMembers, 126using var _1 = ArrayBuilder<ISymbol>.GetInstance(out var implementedVisibleMembers); 127using var _2 = ArrayBuilder<ISymbol>.GetInstance(out var implementedMembers); 131foreach (var unimplementedInterfaceMember in unimplementedInterfaceMembers) 160private string DetermineMemberName(ISymbol member, ArrayBuilder<ISymbol> implementedVisibleMembers, out ISymbol? conflictingMember) 167var memberNames = State.ClassOrStructType.GetAccessibleMembersInThisAndBaseTypes<ISymbol>(State.ClassOrStructType).Select(m => m.Name); 179private IEnumerable<ISymbol?> GenerateMembers( 182ISymbol member, 183ArrayBuilder<ISymbol> implementedVisibleMembers, 200var memberName = DetermineMemberName(member, implementedVisibleMembers, out var conflictingMember); 229ParseOptions options, ISymbol member, string memberName, bool supportsImplementingLessAccessibleMember) 257private bool HasUnexpressibleConstraint(ParseOptions options, ISymbol member) 284public ImmutableArray<ISymbol> GenerateMembers( 286ISymbol member, 287ISymbol? conflictingMember, 312private ISymbol GenerateEvent(Compilation compilation, string memberName, bool generateInvisibly, SyntaxGenerator factory, DeclarationModifiers modifiers, bool useExplicitInterfaceSymbol, Accessibility accessibility, IEventSymbol @event) 350ISymbol member, 364private static bool HasNameConflict(ISymbol member, ISymbol baseMember) 387private bool HasMatchingMember(ArrayBuilder<ISymbol> implementedVisibleMembers, ISymbol member) 412private bool MembersMatch(ISymbol existingMember, ISymbol memberToAdd)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Conflicts.cs (6)
25private bool HasConflictingMember(ISymbol member, ArrayBuilder<ISymbol> implementedVisibleMembers, [NotNullWhen(true)] out ISymbol? conflictingMember) 31var allMembers = State.ClassOrStructType.GetAccessibleMembersInThisAndBaseTypes<ISymbol>(State.ClassOrStructType).Concat(implementedVisibleMembers); 37private bool HasConflict(ISymbol member1, ISymbol member2)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (3)
46ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> unimplementedMembers, 117private (ImmutableArray<ISymbol>, SyntaxNode) CreateDisposableMethods( 132return (ImmutableArray.Create<ISymbol>(disposeImplMethod, disposeInterfaceMethod), finalizer);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Method.cs (1)
24private ISymbol GenerateMethod(
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Property.cs (2)
28private ImmutableArray<ISymbol> GeneratePropertyMembers( 56using var result = TemporaryArray<ISymbol>.Empty;
src\Analyzers\Core\CodeFixes\MakeTypePartial\AbstractMakeTypePartialCodeFixProvider.cs (1)
37var symbol = semanticModel.GetDeclaredSymbol(declaration, cancellationToken);
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (4)
74var symbol = model.GetDeclaredSymbol(node, context.CancellationToken); 104Document document, ISymbol symbol, string fixedName, CancellationToken cancellationToken) 115private readonly ISymbol _symbol; 133ISymbol symbol,
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
39protected abstract ICollection<ISymbol> GetMissingEnumMembers(TSwitchOperation switchOperation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
45protected sealed override ICollection<ISymbol> GetMissingEnumMembers(ISwitchExpressionOperation switchOperation)
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
62protected sealed override ICollection<ISymbol> GetMissingEnumMembers(ISwitchOperation switchOperation)
src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (1)
56var symbol = semanticModel.GetDeclaredSymbol(diagnosticNode, cancellationToken);
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
42var definition = SymbolFinderInternal.FindSourceDefinition(
src\Analyzers\Core\CodeFixes\UseSystemHashCode\UseSystemHashCodeCodeFixProvider.cs (1)
59var method = semanticModel.GetDeclaredSymbol(methodDecl, cancellationToken);
src\Compilers\Core\AnalyzerDriver\DeclarationComputer.cs (4)
17var declaredSymbol = GetDeclaredSymbol(model, node, getSymbol, cancellationToken); 21internal static DeclarationInfo GetDeclarationInfo(SyntaxNode node, ISymbol? declaredSymbol, IEnumerable<SyntaxNode>? executableCodeBlocks) 42private static ISymbol? GetDeclaredSymbol(SemanticModel model, SyntaxNode node, bool getSymbol, CancellationToken cancellationToken) 49var declaredSymbol = model.GetDeclaredSymbol(node, cancellationToken);
src\Compilers\Core\AnalyzerDriver\DeclarationInfo.cs (2)
15internal DeclarationInfo(SyntaxNode declaredNode, ImmutableArray<SyntaxNode> executableCodeBlocks, ISymbol? declaredSymbol) 42public ISymbol? DeclaredSymbol { get; }
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (17)
65public ImmutableArray<ISymbol> Resolve(out bool resolvedWithDocCommentIdFormat) 70return ImmutableArray<ISymbol>.Empty; 82var results = ArrayBuilder<ISymbol>.GetInstance(); 198ISymbol singleResult; 377private TypeInfo? ParseType(ISymbol bindingContext) 491private TypeInfo? ParseIndexedTypeParameter(ISymbol bindingContext) 540private TypeInfo? ParseNamedTypeParameter(ISymbol bindingContext) 574private TypeInfo? ParseNamedType(ISymbol bindingContext) 655private TypeInfo[] ParseTypeArgumentList(ISymbol bindingContext) 724private ISymbol GetFirstMatchingIndexer(ImmutableArray<ISymbol> candidateMembers, ParameterInfo[] parameters) 726foreach (var symbol in candidateMembers) 738private ImmutableArray<IMethodSymbol> GetMatchingMethods(ImmutableArray<ISymbol> candidateMembers, int? arity, ParameterInfo[] parameters, TypeInfo? returnType) 742foreach (var symbol in candidateMembers) 806private ITypeSymbol BindParameterOrReturnType(ISymbol bindingContext, TypeInfo type) 821private static INamedTypeSymbol GetFirstMatchingNamedType(ImmutableArray<ISymbol> candidateMembers, int arity) 828private static INamespaceOrTypeSymbol GetFirstMatchingNamespaceOrType(ImmutableArray<ISymbol> candidateMembers)
StackTraceExplorer\StackTraceExplorerUtilities.cs (1)
95ISymbol symbol = method;
SymbolMapping\ISymbolMappingService.cs (1)
33Task<SymbolMappingResult?> MapSymbolAsync(Document document, ISymbol symbol, CancellationToken cancellationToken = default);
SymbolMapping\SymbolMappingResult.cs (2)
10public ISymbol Symbol { get; } 12internal SymbolMappingResult(Project project, ISymbol symbol)
SymbolMapping\SymbolMappingServiceFactory.cs (2)
27var symbol = symbolId.Resolve(compilation, cancellationToken: cancellationToken).Symbol; 36public Task<SymbolMappingResult> MapSymbolAsync(Document document, ISymbol symbol, CancellationToken cancellationToken)
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (1)
58var symbol = semanticModel.GetSymbolInfo(receiver, cancellationToken).Symbol;
ValueTracking\ValueTrackedItem.cs (1)
44public static async ValueTask<ValueTrackedItem?> TryCreateAsync(Solution solution, Location location, ISymbol symbol, ValueTrackedItem? parent = null, CancellationToken cancellationToken = default)
ValueTracking\ValueTracker.cs (7)
81var symbol = await GetSymbolAsync(previousTrackedItem, solution, cancellationToken).ConfigureAwait(false); 98var previousSymbol = await GetSymbolAsync(previousTrackedItem.Parent, solution, cancellationToken).ConfigureAwait(false); 164private static async Task TrackVariableReferencesAsync(ISymbol symbol, OperationCollector collector, CancellationToken cancellationToken) 179var containingSymbol = parameterSymbol.ContainingSymbol; 255private static async Task<(ISymbol?, SyntaxNode?)> GetSelectedSymbolAsync(TextSpan textSpan, Document document, CancellationToken cancellationToken) 284private static async Task TrackVariableDefinitionsAsync(ISymbol symbol, OperationCollector collector, CancellationToken cancellationToken) 321private static async Task<ISymbol?> GetSymbolAsync(ValueTrackedItem? item, Solution solution, CancellationToken cancellationToken)
ValueTracking\ValueTracker.FindReferencesProgress.cs (2)
34ImmutableArray<(SymbolGroup group, ISymbol symbol, ReferenceLocation location)> references, 42ISymbol symbol, ReferenceLocation location, CancellationToken cancellationToken)
ValueTracking\ValueTracker.OperationCollector.cs (1)
172private async Task AddOperationAsync(IOperation operation, ISymbol symbol, CancellationToken cancellationToken)
ValueTracking\ValueTrackingProgressCollector.cs (1)
40internal async Task<bool> TryReportAsync(Solution solution, Location location, ISymbol symbol, CancellationToken cancellationToken = default)
Microsoft.CodeAnalysis.Features.Test.Utilities (10)
EditAndContinue\EditAndContinueTestVerifier.cs (3)
56public abstract ImmutableArray<SyntaxNode> GetDeclarators(ISymbol method); 329ISymbol? expectedOldSymbol = null, expectedNewSymbol = null; 347symbolKey.Resolve(oldCompilation, ignoreAssemblyKey: true).Symbol is ISymbol resolvedSymbol)
EditAndContinue\SemanticEditDescription.cs (4)
15Func<Compilation, ISymbol> symbolProvider, 20Func<Compilation, ISymbol>? deletedSymbolContainerProvider) 23public readonly Func<Compilation, ISymbol> SymbolProvider = symbolProvider; 25public readonly Func<Compilation, ISymbol>? DeletedSymbolContainerProvider = deletedSymbolContainerProvider;
Workspaces\TestSymbolRenamedCodeActionOperationFactoryWorkspaceService.cs (3)
24public CodeActionOperation CreateSymbolRenamedOperation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution) 29public ISymbol _symbol; 34public Operation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution)
Microsoft.CodeAnalysis.Features.UnitTests (4)
FindUsages\DefinitionItemFactoryTests.cs (4)
83(ISymbol symbol, string localName)[]? symbols = null, 1452var f = model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().Single(n => n is LocalFunctionStatementSyntax)); 1518var x = model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().Single(n => n is VariableDeclaratorSyntax)); 1589var r = model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().Single(n => n is FromClauseSyntax));
Microsoft.CodeAnalysis.LanguageServer (2)
Services\LspExtractClassOptionsService.cs (1)
22ImmutableArray<ISymbol> selectedMembers,
Services\LspExtractInterfaceOptionsService.cs (1)
19ImmutableArray<ISymbol> extractableMembers,
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Handler\References\FindUsagesLSPContext.cs (1)
255var symbol = await SymbolFinder.FindSymbolAtPositionAsync(_document, _position, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.PublicApiAnalyzers (114)
DeclarePublicApiAnalyzer.Impl.cs (21)
168private void OnSymbolActionCore(ISymbol symbol, Action<Diagnostic> reportDiagnostic, INamedTypeSymbol? obsoleteAttribute, CancellationToken cancellationToken, Location? explicitLocation = null) 190foreach (var member in namedType.GetMembers()) 224private void OnSymbolActionCore(ISymbol symbol, Action<Diagnostic> reportDiagnostic, bool isImplicitlyDeclaredConstructor, INamedTypeSymbol? obsoleteAttribute, CancellationToken cancellationToken, Location? explicitLocation = null) 400void reportDeclareNewApi(ISymbol symbol, bool isImplicitlyDeclaredConstructor, string publicApiName) 421void reportAnnotateApi(ISymbol symbol, bool isImplicitlyDeclaredConstructor, ApiName publicApiName, bool isShipped, string filename) 440void reportObliviousApi(ISymbol symbol) 463private static string GetErrorMessageName(ISymbol symbol, bool isImplicitlyDeclaredConstructor) 481private string GetSiblingNamesToRemoveFromUnshippedText(ISymbol symbol, CancellationToken cancellationToken) 497private string GetSiblingNamesToRemoveFromUnshippedTextCore(ISymbol symbol, CancellationToken cancellationToken) 554foreach (var sibling in siblings) 582private static bool UsesOblivious(ISymbol symbol) 592private ApiName GetApiName(ISymbol symbol) 600static string? getExperimentName(ISymbol symbol) 602for (var current = symbol; current is not null; current = current.ContainingSymbol) 620static string getApiString(Compilation compilation, ISymbol symbol, string? experimentName, SymbolDisplayFormat format) 721private void VisitForwardedTypeRecursively(ISymbol symbol, Action<Diagnostic> reportDiagnostic, INamedTypeSymbol? obsoleteAttribute, Location typeForwardedAttributeLocation, CancellationToken cancellationToken) 733foreach (var member in namedTypeSymbol.GetMembers()) 782private bool IsTrackedAPI(ISymbol symbol, CancellationToken cancellationToken) 813private bool IsNamespaceSkipped(ISymbol symbol, CancellationToken cancellationToken) 862private bool IsTrackedApiCore(ISymbol symbol, CancellationToken cancellationToken) 876for (var current = symbol; current != null; current = current.ContainingType)
src\RoslynAnalyzers\Utilities\Compiler\DiagnosticHelpers.cs (1)
65public static string GetMemberName(ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (2)
79this ISymbol symbol, 87this ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (5)
135/// "qualifying member" (<see cref="IsQualifyingMember(ISymbol)"/>) and no 136/// "disqualifying members" (<see cref="IsDisqualifyingMember(ISymbol)"/>). 165foreach (var member in symbol.GetMembers()) 195private static bool IsQualifyingMember(ISymbol member) 243private static bool IsDisqualifyingMember(ISymbol member)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (59)
20public static bool IsType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 25public static bool IsAccessorMethod([NotNullWhen(returnValue: true)] this ISymbol? symbol) 31public static IEnumerable<IMethodSymbol> GetAccessors(this ISymbol symbol) 70public static bool IsDefaultConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 75public static bool IsPublic(this ISymbol symbol) 80public static bool IsProtected(this ISymbol symbol) 85public static bool IsPrivate(this ISymbol symbol) 90public static bool IsErrorType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 97public static bool IsConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 102public static bool IsDestructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 107public static bool IsIndexer([NotNullWhen(returnValue: true)] this ISymbol? symbol) 112public static bool IsPropertyWithBackingField([NotNullWhen(returnValue: true)] this ISymbol? symbol, [NotNullWhen(true)] out IFieldSymbol? backingField) 116foreach (ISymbol member in propertySymbol.ContainingType.GetMembers()) 139[NotNullWhen(returnValue: true)] this ISymbol? symbol, 156public static bool IsUserDefinedOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 161public static bool IsConversionOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 166public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol? symbol) 179public static bool IsExternallyVisible(this ISymbol symbol) => 182public static SymbolVisibility GetResultantVisibility(this ISymbol symbol) 229public static bool MatchMemberDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 239public static bool MatchMethodByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 244public static bool MatchPropertyDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 249public static bool MatchMemberByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 254public static bool MatchPropertyByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 259public static bool MatchFieldByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 283public static string FormatMemberName(this ISymbol member) 419public static bool IsFromMscorlib(this ISymbol symbol, Compilation compilation) 460public static bool IsImplementationOfAnyInterfaceMember(this ISymbol symbol) 465public static bool IsImplementationOfAnyImplicitInterfaceMember(this ISymbol symbol) 467return IsImplementationOfAnyImplicitInterfaceMember<ISymbol>(symbol); 473public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol) 474where TSymbol : ISymbol 496public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol, out TSymbol interfaceMember) 497where TSymbol : ISymbol 518public static bool IsImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 527public static bool IsOverrideOrImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 546/// <remarks>Requires that <see cref="ISymbol.IsOverride"/> is true for the given <paramref name="symbol"/>.</remarks> 547public static ISymbol GetOverriddenMember(this ISymbol symbol) 566public static bool IsImplementationOfAnyExplicitInterfaceMember([NotNullWhen(returnValue: true)] this ISymbol? symbol) 586public static ITypeSymbol? GetMemberOrLocalOrParameterType(this ISymbol symbol) 598public static ITypeSymbol? GetMemberType(this ISymbol? symbol) 614public static bool IsReadOnlyFieldOrProperty([NotNullWhen(returnValue: true)] this ISymbol? symbol) 626public static AttributeData? GetAttribute(this ISymbol symbol, [NotNullWhen(true)] INamedTypeSymbol? attributeType) 631public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, IEnumerable<INamedTypeSymbol?> attributesToMatch) 649public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 655public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1) 666public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1, INamedTypeSymbol? attributeTypeToMatch2) 679public static bool HasAnyAttribute(this ISymbol symbol, IEnumerable<INamedTypeSymbol> attributesToMatch) 684public static bool HasAnyAttribute(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 707public static bool HasAnyAttribute(this ISymbol symbol, [NotNullWhen(returnValue: true)] INamedTypeSymbol? attribute) 806public static bool[] HasAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributes) 826public static bool IsInSource(this ISymbol symbol) 831public static bool IsLambdaOrLocalFunction([NotNullWhen(returnValue: true)] this ISymbol? symbol) 839public static bool IsSymbolWithSpecialDiscardName([NotNullWhen(returnValue: true)] this ISymbol? symbol) 843public static bool IsConst([NotNullWhen(returnValue: true)] this ISymbol? symbol) 855public static bool IsReadOnly([NotNullWhen(returnValue: true)] this ISymbol? symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\UriExtensions.cs (2)
32public static bool SymbolNameContainsUriWordSubstring(this ISymbol symbol, CancellationToken cancellationToken) 58public static bool SymbolNameContainsUriWords(this ISymbol symbol, CancellationToken cancellationToken)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
55where TSymbol : ISymbol 99where TSymbol : ISymbol
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolModifiers.cs (1)
38public static SymbolModifiers GetSymbolModifiers(this ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (15)
31private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 58private readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> _wildcardMatchResult = new(); 60private readonly ConcurrentDictionary<ISymbol, string> _symbolToDeclarationId = new(); 62private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 75_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 90var symbolsBuilder = PooledDictionary<ISymbol, TValue>.GetInstance(); 189static void ProcessSymbolName(NameParts parts, Compilation compilation, string? optionalPrefix, PooledDictionary<ISymbol, TValue> symbolsBuilder) 201foreach (var symbol in DocumentationCommentId.GetSymbolsForDeclarationId(nameWithPrefix, compilation)) 230public bool Contains(ISymbol symbol) 236public bool TryGetValue(ISymbol symbol, [MaybeNullWhen(false)] out TValue value) 266private bool TryGetFirstWildcardMatch(ISymbol symbol, [NotNullWhen(true)] out string? firstMatchName, [MaybeNullWhen(false)] out TValue firstMatchValue) 344static string GetDeclarationId(ISymbol symbol) 374internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 378internal ref readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> WildcardMatchResult => ref _symbolNamesWithValueOption._wildcardMatchResult; 380internal ref readonly ConcurrentDictionary<ISymbol, string> SymbolToDeclarationId => ref _symbolNamesWithValueOption._symbolToDeclarationId;
src\RoslynAnalyzers\Utilities\Compiler\SymbolDisplayStringCache.cs (2)
29private readonly ConcurrentDictionary<ISymbol, string> SymbolToDisplayNames = new(); 65public string GetDisplayString(ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\SymbolEqualityComparer.cs (4)
10internal sealed class SymbolEqualityComparer : IEqualityComparer<ISymbol?> 16public bool Equals(ISymbol? x, ISymbol? y) 21public int GetHashCode(ISymbol? obj)
Microsoft.CodeAnalysis.Remote.ServiceHub (3)
Services\SymbolFinder\RemoteSymbolFinderService.cs (3)
81private static ImmutableArray<SerializableSymbolAndProjectId> Convert(ImmutableArray<ISymbol> items, Solution solution, CancellationToken cancellationToken) 85foreach (var item in items) 227ImmutableArray<(SymbolGroup group, ISymbol symbol, ReferenceLocation location)> references,
Microsoft.CodeAnalysis.ResxSourceGenerator (136)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (8)
28ISymbol symbol, 65public ISymbol Symbol { get; } 228public static Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, Compilation compilation, CancellationToken cancellationToken) 246public static Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, CodeMetricsAnalysisContext context) 265static async Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, CodeMetricsAnalysisContext context) 291public static CodeAnalysisMetricData ComputeSynchronously(ISymbol symbol, CodeMetricsAnalysisContext context) 325internal static async Task<ImmutableArray<CodeAnalysisMetricData>> ComputeAsync(IEnumerable<ISymbol> children, CodeMetricsAnalysisContext context) 333internal static ImmutableArray<CodeAnalysisMetricData> ComputeSynchronously(IEnumerable<ISymbol> children, CodeMetricsAnalysisContext context)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
51private static IEnumerable<ISymbol> GetMembers(INamedTypeSymbol namedType, CodeMetricsAnalysisContext context)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\ComputationalComplexityMetrics.cs (8)
28ImmutableHashSet<BinaryOperatorKind>.Empty, ImmutableHashSet<UnaryOperatorKind>.Empty, ImmutableHashSet<CaseKind>.Empty, ImmutableHashSet<ISymbol>.Empty, ImmutableHashSet<object>.Empty); 36private readonly ImmutableHashSet<ISymbol> _distinctReferencedSymbols; 49ImmutableHashSet<ISymbol> distinctReferencedSymbols, 75ImmutableHashSet<ISymbol> distinctReferencedSymbols, 101ImmutableHashSet<ISymbol>.Builder? distinctReferencedSymbolsBuilder = null; 296distinctReferencedSymbolsBuilder != null ? distinctReferencedSymbolsBuilder.ToImmutable() : ImmutableHashSet<ISymbol>.Empty, 341void countOperand(ISymbol? symbol) 347distinctReferencedSymbolsBuilder ??= ImmutableHashSet.CreateBuilder<ISymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (6)
65internal static long GetLinesOfCode(ImmutableArray<SyntaxReference> declarations, ISymbol symbol, CodeMetricsAnalysisContext context) 179internal static SyntaxNode GetTopmostSyntaxNodeForDeclaration(SyntaxReference declaration, ISymbol declaredSymbol, CodeMetricsAnalysisContext context) 196ISymbol symbol, 249var declaredSymbol = model.GetDeclaredSymbol(node, context.CancellationToken); 402internal static void RemoveContainingTypes(ISymbol symbol, ImmutableHashSet<INamedTypeSymbol>.Builder coupledTypesBuilder) 412internal static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol member)
src\RoslynAnalyzers\Utilities\Compiler\DiagnosticHelpers.cs (1)
65public static string GetMemberName(ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (2)
79this ISymbol symbol, 87this ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (5)
135/// "qualifying member" (<see cref="IsQualifyingMember(ISymbol)"/>) and no 136/// "disqualifying members" (<see cref="IsDisqualifyingMember(ISymbol)"/>). 165foreach (var member in symbol.GetMembers()) 195private static bool IsQualifyingMember(ISymbol member) 243private static bool IsDisqualifyingMember(ISymbol member)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (6)
503public static PooledHashSet<ISymbol> GetCaptures(this IOperation operation, IMethodSymbol lambdaOrLocalFunction) 510var builder = PooledHashSet<ISymbol>.GetInstance(); 543void ProcessLocalOrParameter(ISymbol symbol) 656public static ISymbol? GetReferencedMemberOrLocalOrParameter(this IOperation? operation) 912public static ValueUsageInfo GetValueUsageInfo(this IOperation operation, ISymbol containingSymbol) 1117public static RefKind GetRefKind(this IReturnOperation operation, ISymbol containingSymbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (59)
20public static bool IsType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 25public static bool IsAccessorMethod([NotNullWhen(returnValue: true)] this ISymbol? symbol) 31public static IEnumerable<IMethodSymbol> GetAccessors(this ISymbol symbol) 70public static bool IsDefaultConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 75public static bool IsPublic(this ISymbol symbol) 80public static bool IsProtected(this ISymbol symbol) 85public static bool IsPrivate(this ISymbol symbol) 90public static bool IsErrorType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 97public static bool IsConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 102public static bool IsDestructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 107public static bool IsIndexer([NotNullWhen(returnValue: true)] this ISymbol? symbol) 112public static bool IsPropertyWithBackingField([NotNullWhen(returnValue: true)] this ISymbol? symbol, [NotNullWhen(true)] out IFieldSymbol? backingField) 116foreach (ISymbol member in propertySymbol.ContainingType.GetMembers()) 139[NotNullWhen(returnValue: true)] this ISymbol? symbol, 156public static bool IsUserDefinedOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 161public static bool IsConversionOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 166public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol? symbol) 179public static bool IsExternallyVisible(this ISymbol symbol) => 182public static SymbolVisibility GetResultantVisibility(this ISymbol symbol) 229public static bool MatchMemberDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 239public static bool MatchMethodByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 244public static bool MatchPropertyDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 249public static bool MatchMemberByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 254public static bool MatchPropertyByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 259public static bool MatchFieldByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 283public static string FormatMemberName(this ISymbol member) 419public static bool IsFromMscorlib(this ISymbol symbol, Compilation compilation) 460public static bool IsImplementationOfAnyInterfaceMember(this ISymbol symbol) 465public static bool IsImplementationOfAnyImplicitInterfaceMember(this ISymbol symbol) 467return IsImplementationOfAnyImplicitInterfaceMember<ISymbol>(symbol); 473public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol) 474where TSymbol : ISymbol 496public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol, out TSymbol interfaceMember) 497where TSymbol : ISymbol 518public static bool IsImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 527public static bool IsOverrideOrImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 546/// <remarks>Requires that <see cref="ISymbol.IsOverride"/> is true for the given <paramref name="symbol"/>.</remarks> 547public static ISymbol GetOverriddenMember(this ISymbol symbol) 566public static bool IsImplementationOfAnyExplicitInterfaceMember([NotNullWhen(returnValue: true)] this ISymbol? symbol) 586public static ITypeSymbol? GetMemberOrLocalOrParameterType(this ISymbol symbol) 598public static ITypeSymbol? GetMemberType(this ISymbol? symbol) 614public static bool IsReadOnlyFieldOrProperty([NotNullWhen(returnValue: true)] this ISymbol? symbol) 626public static AttributeData? GetAttribute(this ISymbol symbol, [NotNullWhen(true)] INamedTypeSymbol? attributeType) 631public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, IEnumerable<INamedTypeSymbol?> attributesToMatch) 649public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 655public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1) 666public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1, INamedTypeSymbol? attributeTypeToMatch2) 679public static bool HasAnyAttribute(this ISymbol symbol, IEnumerable<INamedTypeSymbol> attributesToMatch) 684public static bool HasAnyAttribute(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 707public static bool HasAnyAttribute(this ISymbol symbol, [NotNullWhen(returnValue: true)] INamedTypeSymbol? attribute) 806public static bool[] HasAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributes) 826public static bool IsInSource(this ISymbol symbol) 831public static bool IsLambdaOrLocalFunction([NotNullWhen(returnValue: true)] this ISymbol? symbol) 839public static bool IsSymbolWithSpecialDiscardName([NotNullWhen(returnValue: true)] this ISymbol? symbol) 843public static bool IsConst([NotNullWhen(returnValue: true)] this ISymbol? symbol) 855public static bool IsReadOnly([NotNullWhen(returnValue: true)] this ISymbol? symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\UriExtensions.cs (2)
32public static bool SymbolNameContainsUriWordSubstring(this ISymbol symbol, CancellationToken cancellationToken) 58public static bool SymbolNameContainsUriWords(this ISymbol symbol, CancellationToken cancellationToken)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
55where TSymbol : ISymbol 99where TSymbol : ISymbol
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (18)
29private static bool TryGetSyntaxTreeForOption(ISymbol symbol, [NotNullWhen(returnValue: true)] out SyntaxTree? tree) 48ISymbol symbol, 66ISymbol symbol, 84ISymbol symbol, 117ISymbol symbol, 189ISymbol symbol, 254ISymbol symbol, 261ISymbol symbol, 262ISymbol containingContextSymbol, 298ISymbol symbol, 307ISymbol symbol, 317ISymbol symbol, 331ISymbol symbol, 380ISymbol symbol, 578ISymbol symbol, 593ISymbol symbol, 594ISymbol containingContextSymbol, 612ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolModifiers.cs (1)
38public static SymbolModifiers GetSymbolModifiers(this ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (15)
31private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 58private readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> _wildcardMatchResult = new(); 60private readonly ConcurrentDictionary<ISymbol, string> _symbolToDeclarationId = new(); 62private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 75_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 90var symbolsBuilder = PooledDictionary<ISymbol, TValue>.GetInstance(); 189static void ProcessSymbolName(NameParts parts, Compilation compilation, string? optionalPrefix, PooledDictionary<ISymbol, TValue> symbolsBuilder) 201foreach (var symbol in DocumentationCommentId.GetSymbolsForDeclarationId(nameWithPrefix, compilation)) 230public bool Contains(ISymbol symbol) 236public bool TryGetValue(ISymbol symbol, [MaybeNullWhen(false)] out TValue value) 266private bool TryGetFirstWildcardMatch(ISymbol symbol, [NotNullWhen(true)] out string? firstMatchName, [MaybeNullWhen(false)] out TValue firstMatchValue) 344static string GetDeclarationId(ISymbol symbol) 374internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 378internal ref readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> WildcardMatchResult => ref _symbolNamesWithValueOption._wildcardMatchResult; 380internal ref readonly ConcurrentDictionary<ISymbol, string> SymbolToDeclarationId => ref _symbolNamesWithValueOption._symbolToDeclarationId;
src\RoslynAnalyzers\Utilities\Compiler\SymbolDisplayStringCache.cs (2)
29private readonly ConcurrentDictionary<ISymbol, string> SymbolToDisplayNames = new(); 65public string GetDisplayString(ISymbol symbol)
Microsoft.CodeAnalysis.Test.Utilities (67)
Compilation\CompilationExtensions.cs (5)
144IEnumerable<ISymbol> allAddedSymbols = null, 148var isAddedSymbol = new Func<ISymbol, bool>(s => allAddedSymbols?.Contains(s) ?? false); 253internal static bool CanHaveExecutableCodeBlock(ISymbol symbol) 277var roots = ArrayBuilder<(IOperation operation, ISymbol associatedSymbol)>.GetInstance(); 361void checkControlFlowGraph(IOperation root, ISymbol associatedSymbol)
Compilation\ControlFlowGraphVerifier.cs (12)
28public static (ControlFlowGraph graph, ISymbol associatedSymbol) GetControlFlowGraph(SyntaxNode syntaxNode, SemanticModel model) 78var declaredSymbol = model.GetDeclaredSymbol(operationRoot.Syntax); 82public static void VerifyGraph(Compilation compilation, string expectedFlowGraph, ControlFlowGraph graph, ISymbol associatedSymbol) 98public static string GetFlowGraph(Compilation compilation, ControlFlowGraph graph, ISymbol associatedSymbol) 109ControlFlowRegion enclosing, string idSuffix, int indent, ISymbol associatedSymbol) 119var referencedLocalsAndMethods = PooledHashSet<ISymbol>.GetInstance(); 1685ISymbol symbol = referencedLocalsAndMethods.First(); 1753static bool isInAssociatedSymbol(ISymbol symbol, ISymbol associatedSymbol) 1801private readonly ISymbol _associatedSymbol; 1805Compilation compilation, IOperation root, int initialIndent, ISymbol associatedSymbol) : 1990private static bool IsTopLevelMainMethod([NotNullWhen(true)] this ISymbol? symbol)
Compilation\OperationTreeVerifier.cs (3)
263private void LogSymbol(ISymbol symbol, string header, bool logDisplayString = true) 375internal void VisitSymbolArrayElement(ISymbol element) 412private void VisitArray(ImmutableArray<ISymbol> list, string header, bool logElementCount, bool logNullForDefault = false)
Compilation\TestOperationVisitor.cs (2)
801foreach (var symbol in symbolInfo.GetAllSymbols()) 874private static void AssertConstrainedToType(ISymbol member, ITypeSymbol constrainedToType)
CompilationVerifier.cs (1)
697var symbol = dummy.GetAssemblyOrModuleSymbol(metadataReference);
Diagnostics\CommonDiagnosticAnalyzers.cs (36)
758internal readonly ConcurrentSet<ISymbol> CallbackSymbols = new(); 1230private readonly ConcurrentDictionary<IOperation, (ControlFlowGraph Graph, ISymbol AssociatedSymbol)> _controlFlowGraphMapOpt; 1252_controlFlowGraphMapOpt = verifyGetControlFlowGraph ? new ConcurrentDictionary<IOperation, (ControlFlowGraph, ISymbol)>() : null; 1255public ImmutableArray<(ControlFlowGraph Graph, ISymbol AssociatedSymbol)> GetControlFlowGraphs() 1267private void CacheAndVerifyControlFlowGraph(ImmutableArray<IOperation> operationBlocks, Func<IOperation, (ControlFlowGraph Graph, ISymbol AssociatedSymbol)> getControlFlowGraph) 1658private void ReportSymbolDiagnostics(ISymbol symbol, Action<Diagnostic> addDiagnostic) 1699var namedTypes = new HashSet<ISymbol>(); 1704foreach (var namedType in namedTypes) 1882SymbolsStarted = new ConcurrentSet<ISymbol>(); 1885internal ConcurrentSet<ISymbol> SymbolsStarted { get; } 1979var symbolsEnded = new ConcurrentSet<ISymbol>(); 1980var seenOperationContainers = new ConcurrentDictionary<OperationAnalysisContext, ISet<ISymbol>>(); 2077IEnumerable<ISymbol> GetContainingSymbolsAndThis(ISymbol symbol) 2089ISymbol symbolStarted = symbolStartContext.Symbol; 2090IEnumerable<ISymbol> members; 2105foreach (var member in members.Where(m => !m.IsImplicitlyDeclared)) 2117ISymbol symbolEnded = symbolEndContext.Symbol; 2118IList<ISymbol> containersToVerify = new List<ISymbol>(); 2129foreach (var container in containersToVerify) 2144ISet<ISymbol> containers = kvp.Value; 2397private readonly ConcurrentSet<ISymbol> _symbolCallbacks; 2403_symbolCallbacks = new ConcurrentSet<ISymbol>(); 2462private void ReportDiagnostic(ISymbol symbol, Action<Diagnostic> reportDiagnostic) 2821private static void ReportSymbolDiagnostics(string actionName, ISymbol symbol, Compilation compilation, Action<Diagnostic> reportDiagnostic) 2841private static void ReportDiagnostics(string actionName, SyntaxTree tree, ISymbol containingSymbol, Action<Diagnostic> reportDiagnostic) 2984public readonly List<ISymbol> AnalyzedSymbols = new(); 2985public readonly List<ISymbol> AnalyzedSymbolStartSymbols = new(); 2986public readonly List<ISymbol> AnalyzedSymbolEndSymbols = new(); 2988public readonly List<ISymbol> AnalyzedOperationBlockSymbols = new(); 2990public readonly List<ISymbol> AnalyzedOperationBlockStartSymbols = new(); 2991public readonly List<ISymbol> AnalyzedOperationBlockEndSymbols = new(); 2993public readonly List<ISymbol> AnalyzedCodeBlockSymbols = new(); 2995public readonly List<ISymbol> AnalyzedCodeBlockStartSymbols = new(); 2996public readonly List<ISymbol> AnalyzedCodeBlockEndSymbols = new();
Diagnostics\OperationTestAnalyzer.cs (1)
1379ISymbol memberSymbol;
Diagnostics\OptionsDiagnosticAnalyzer.cs (1)
27protected override void OnAbstractMember(string AbstractMemberName, SyntaxNode node = null, ISymbol symbol = null, [CallerMemberName] string callerName = null)
Diagnostics\TestDiagnosticAnalyzer.cs (1)
33protected abstract void OnAbstractMember(string abstractMemberName, SyntaxNode node = null, ISymbol symbol = null, [CallerMemberName] string callerName = null);
Diagnostics\ThrowingDiagnosticAnalyzer.cs (1)
52protected override void OnAbstractMember(string abstractMemberName, SyntaxNode node, ISymbol symbol, string methodName)
Diagnostics\TrackingDiagnosticAnalyzer.cs (2)
34public Entry(string abstractMemberName, string callerName, SyntaxNode node, ISymbol symbol) 52protected override void OnAbstractMember(string abstractMemberName, SyntaxNode node, ISymbol symbol, string callerName)
Extensions\SymbolExtensions.cs (1)
11public static string ToTestDisplayString(this ISymbol symbol)
Metadata\ILBuilderVisualizer.cs (1)
62ISymbol symbol = ((reference as ISymbolInternal) ?? (reference as Cci.IReference)?.GetInternalSymbol())?.GetISymbol();
Microsoft.CodeAnalysis.UnitTests (12)
Diagnostics\OperationTests.cs (1)
328var cfgSymbol = model.GetDeclaredSymbol(methodBodySyntax);
Diagnostics\SuppressMessageTargetSymbolResolverTests.cs (6)
1347var expectedSymbols = new List<ISymbol>(); 1369var expectedSymbol = expectedSymbols.Single(); 1378var symbol = symbols.SingleOrDefault(); 1385foreach (var symbol in symbols) 1395private static ISymbol GetSymbolAtPosition(SemanticModel model, int pos) 1406var symbol = q.FirstOrDefault();
Symbols\DocumentationCommentIdTests.cs (5)
37var symbol = comp.GetSymbolsWithName("DoStuff").Single(); 68var symbol = comp.GetSymbolsWithName("DoStuff").Single(); 87var symbol = comp.GetSymbolsWithName("DoStuff").Single(); 111var symbol = comp.GetSymbolsWithName("DoStuff").Single(); 181var symbol = semanticModel.GetSymbolInfo(node!).Symbol;
Microsoft.CodeAnalysis.VisualBasic (208)
Analysis\FlowAnalysis\DataFlowsOutWalker.vb (3)
23Private ReadOnly _dataFlowsIn As ImmutableArray(Of ISymbol) 32unassignedVariables As HashSet(Of Symbol), originalUnassigned As HashSet(Of Symbol), dataFlowsIn As ImmutableArray(Of ISymbol)) 41unassignedVariables As HashSet(Of Symbol), dataFlowsIn As ImmutableArray(Of ISymbol)) As HashSet(Of Symbol)
Analysis\FlowAnalysis\VisualBasicDataFlowAnalysis.vb (38)
22Private _variablesDeclared As ImmutableArray(Of ISymbol) 24Private _dataFlowsIn As ImmutableArray(Of ISymbol) 25Private _definitelyAssignedOnEntry As ImmutableArray(Of ISymbol) 26Private _definitelyAssignedOnExit As ImmutableArray(Of ISymbol) 27Private _dataFlowsOut As ImmutableArray(Of ISymbol) 28Private _alwaysAssigned As ImmutableArray(Of ISymbol) 29Private _readInside As ImmutableArray(Of ISymbol) 30Private _writtenInside As ImmutableArray(Of ISymbol) 31Private _readOutside As ImmutableArray(Of ISymbol) 32Private _writtenOutside As ImmutableArray(Of ISymbol) 33Private _captured As ImmutableArray(Of ISymbol) 34Private _capturedInside As ImmutableArray(Of ISymbol) 35Private _capturedOutside As ImmutableArray(Of ISymbol) 47Public Overrides ReadOnly Property VariablesDeclared As ImmutableArray(Of ISymbol) 50Dim result = If(Me._context.Failed, ImmutableArray(Of ISymbol).Empty, 72Public Overrides ReadOnly Property DataFlowsIn As ImmutableArray(Of ISymbol) 76Dim result = If(Me._context.Failed, ImmutableArray(Of ISymbol).Empty, 84Public Overrides ReadOnly Property DefinitelyAssignedOnEntry As ImmutableArray(Of ISymbol) 90Public Overrides ReadOnly Property DefinitelyAssignedOnExit As ImmutableArray(Of ISymbol) 96Private Function ComputeDefinitelyAssignedValues() As (onEntry As ImmutableArray(Of ISymbol), onExit As ImmutableArray(Of ISymbol)) 101Dim entry = ImmutableArray(Of ISymbol).Empty 102Dim ex = ImmutableArray(Of ISymbol).Empty 121Public Overrides ReadOnly Property DataFlowsOut As ImmutableArray(Of ISymbol) 125Dim result = If(Me._context.Failed, ImmutableArray(Of ISymbol).Empty, 136Public Overrides ReadOnly Property AlwaysAssigned As ImmutableArray(Of ISymbol) 139Dim result = If(Me._context.Failed, ImmutableArray(Of ISymbol).Empty, 150Public Overrides ReadOnly Property ReadInside As ImmutableArray(Of ISymbol) 162Public Overrides ReadOnly Property WrittenInside As ImmutableArray(Of ISymbol) 174Public Overrides ReadOnly Property ReadOutside As ImmutableArray(Of ISymbol) 186Public Overrides ReadOnly Property WrittenOutside As ImmutableArray(Of ISymbol) 237Public Overrides ReadOnly Property Captured As ImmutableArray(Of ISymbol) 247Public Overrides ReadOnly Property CapturedInside As ImmutableArray(Of ISymbol) 257Public Overrides ReadOnly Property CapturedOutside As ImmutableArray(Of ISymbol) 283Public Overrides ReadOnly Property UnsafeAddressTaken As ImmutableArray(Of ISymbol) 285Return ImmutableArray(Of ISymbol).Empty 295Friend Function Normalize(data As IEnumerable(Of Symbol)) As ImmutableArray(Of ISymbol) 299Return builder.ToImmutableAndFree().As(Of ISymbol)()
Binding\MemberSemanticModel.vb (4)
499Friend Overloads Overrides Function GetDeclaredSymbol(declarationSyntax As MethodBaseSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 568Public Overrides Function GetDeclaredSymbol(identifierSyntax As ModifiedIdentifierSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 708Friend Overrides Function GetDeclaredSymbols(declarationSyntax As FieldDeclarationSyntax, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 710Return ImmutableArray.Create(Of ISymbol)()
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\LexicalOrderSymbolComparer.vb (2)
37comparison = DirectCast(x, ISymbol).Kind.ToSortOrder() - DirectCast(y, ISymbol).Kind.ToSortOrder()
Compilation\SemanticModel.vb (41)
439Public Shadows Function GetMemberGroup(expression As ExpressionSyntax, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 449Return StaticCast(Of ISymbol).From(result) 451Return ImmutableArray(Of ISymbol).Empty 455Public Shadows Function GetSpeculativeMemberGroup(position As Integer, expression As ExpressionSyntax) As ImmutableArray(Of ISymbol) 466Return StaticCast(Of ISymbol).From(result) 468Return ImmutableArray(Of ISymbol).Empty 472Public Shadows Function GetMemberGroup(attribute As AttributeSyntax, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 482Return StaticCast(Of ISymbol).From(result) 484Return ImmutableArray(Of ISymbol).Empty 1601) As ImmutableArray(Of ISymbol) 1612Return StaticCast(Of ISymbol).From(result) 1651) As ImmutableArray(Of ISymbol) 1659Return StaticCast(Of ISymbol).From(result) 1684) As ImmutableArray(Of ISymbol) 1691Return StaticCast(Of ISymbol).From(result) 1716) As ImmutableArray(Of ISymbol) 1724Return StaticCast(Of ISymbol).From(result) 1744) As ImmutableArray(Of ISymbol) 1751Return StaticCast(Of ISymbol).From(result) 2070Public Shadows Function IsAccessible(position As Integer, symbol As ISymbol) As Boolean 2380Public Overridable Overloads Function GetDeclaredSymbol(identifierSyntax As ModifiedIdentifierSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 2424Public Overloads Function GetDeclaredSymbol(elementSyntax As TupleElementSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 2602Friend MustOverride Overloads Function GetDeclaredSymbol(declarationSyntax As MethodBaseSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 2745Friend MustOverride Function GetDeclaredSymbols(declarationSyntax As FieldDeclarationSyntax, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 2847Return SymbolInfoFactory.Create(StaticCast(Of ISymbol).From(symbols.ToImmutableAndFree()), reason) 2984Public Shadows Function GetEnclosingSymbol(position As Integer, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 3146Private Function GetMemberGroupForNode(node As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 3161Return ImmutableArray(Of ISymbol).Empty 3212Protected NotOverridable Overrides Function GetMemberGroupCore(node As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 3216Protected NotOverridable Overrides Function LookupSymbolsCore(position As Integer, container As INamespaceOrTypeSymbol, name As String, includeReducedExtensionMethods As Boolean) As ImmutableArray(Of ISymbol) 3220Protected NotOverridable Overrides Function LookupBaseMembersCore(position As Integer, name As String) As ImmutableArray(Of ISymbol) 3224Protected NotOverridable Overrides Function LookupStaticMembersCore(position As Integer, container As INamespaceOrTypeSymbol, name As String) As ImmutableArray(Of ISymbol) 3228Protected NotOverridable Overrides Function LookupNamespacesAndTypesCore(position As Integer, container As INamespaceOrTypeSymbol, name As String) As ImmutableArray(Of ISymbol) 3232Protected NotOverridable Overrides Function LookupLabelsCore(position As Integer, name As String) As ImmutableArray(Of ISymbol) 3248Protected NotOverridable Overrides Function GetDeclaredSymbolCore(declaration As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 3360Protected NotOverridable Overrides Function GetDeclaredSymbolsCore(declaration As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 3373Return ImmutableArray.Create(Of ISymbol)() 3435Protected NotOverridable Overrides Function GetEnclosingSymbolCore(position As Integer, Optional cancellationToken As System.Threading.CancellationToken = Nothing) As ISymbol 3511Protected NotOverridable Overrides Function IsAccessibleCore(position As Integer, symbol As ISymbol) As Boolean 3523Friend Overrides Sub ComputeDeclarationsInNode(node As SyntaxNode, associatedSymbol As ISymbol, getSymbol As Boolean, builder As ArrayBuilder(Of DeclarationInfo), cancellationToken As CancellationToken, Optional levelsToCompute As Integer? = Nothing) 3527Protected Overrides Function GetTopmostNodeForDiagnosticAnalysis(symbol As ISymbol, declaringSyntax As SyntaxNode) As SyntaxNode
Compilation\SpeculativeSemanticModelWithMemberModel.vb (3)
165Friend Overloads Overrides Function GetDeclaredSymbol(declarationSyntax As MethodBaseSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 185Public Overrides Function GetDeclaredSymbol(identifierSyntax As ModifiedIdentifierSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 209Friend Overrides Function GetDeclaredSymbols(declarationSyntax As FieldDeclarationSyntax, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol)
Compilation\SpeculativeSyntaxTreeSemanticModel.vb (1)
95Return SymbolInfoFactory.Create(ImmutableArray.Create(Of ISymbol)(aliasSymbol), If(aliasSymbol IsNot Nothing, LookupResultKind.Good, LookupResultKind.Empty))
Compilation\SymbolInfo.vb (3)
14Return Create(StaticCast(Of ISymbol).From(symbols), resultKind) 17Friend Shared Function Create(symbols As ImmutableArray(Of ISymbol), resultKind As LookupResultKind) As SymbolInfo 22Friend Shared Function Create(symbols As ImmutableArray(Of ISymbol), reason As CandidateReason) As SymbolInfo
Compilation\SyntaxTreeSemanticModel.vb (5)
959Friend Overloads Overrides Function GetDeclaredSymbol(declarationSyntax As MethodBaseSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 1113Dim symbol As ISymbol = Nothing 1179Public Overrides Function GetDeclaredSymbol(declarationSyntax As ModifiedIdentifierSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 1353Friend Overrides Function GetDeclaredSymbols(declarationSyntax As FieldDeclarationSyntax, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 1362Dim builder = New ArrayBuilder(Of ISymbol)
Compilation\VisualBasicCompilation.vb (13)
1330Friend Overrides Function GetSymbolInternal(Of TSymbol As {Class, ISymbolInternal})(symbol As ISymbol) As TSymbol 2018Private Protected Overrides Function IsSymbolAccessibleWithinCore(symbol As ISymbol, within As ISymbol, throughType As ITypeSymbol) As Boolean 2028Friend Shadows Function IsSymbolAccessibleWithin(symbol As ISymbol, within As ISymbol, Optional throughType As ITypeSymbol = Nothing) As Boolean 2602isAddedSymbol As Func(Of ISymbol, Boolean), 2813Protected Overrides Function CommonGetAssemblyOrModuleSymbol(reference As MetadataReference) As ISymbol 3123Public Overrides Function GetSymbolsWithName(predicate As Func(Of String, Boolean), Optional filter As SymbolFilter = SymbolFilter.TypeAndMember, Optional cancellationToken As CancellationToken = Nothing) As IEnumerable(Of ISymbol) 3154Public Overrides Function GetSymbolsWithName(name As String, Optional filter As SymbolFilter = SymbolFilter.TypeAndMember, Optional cancellationToken As CancellationToken = Nothing) As IEnumerable(Of ISymbol) 3206Public Function GetSymbolsWithName() As IEnumerable(Of ISymbol) 3207Dim result = New HashSet(Of ISymbol)() 3219spine As ArrayBuilder(Of MergedNamespaceOrTypeDeclaration), current As MergedNamespaceOrTypeDeclaration, [set] As HashSet(Of ISymbol)) 3260spine As ArrayBuilder(Of MergedNamespaceOrTypeDeclaration), mergedType As MergedTypeDeclaration, [set] As HashSet(Of ISymbol))
Emit\EditAndContinue\EmitHelpers.vb (1)
24isAddedSymbol As Func(Of ISymbol, Boolean),
Emit\EditAndContinue\VisualBasicDefinitionMap.vb (1)
64Protected Overrides Function GetISymbolInternalOrNull(symbol As ISymbol) As ISymbolInternal
Emit\EditAndContinue\VisualBasicSymbolChanges.vb (2)
13Public Sub New(definitionMap As DefinitionMap, edits As IEnumerable(Of SemanticEdit), isAddedSymbol As Func(Of ISymbol, Boolean)) 17Protected Overrides Function GetISymbolInternalOrNull(symbol As ISymbol) As ISymbolInternal
Errors\MessageProvider.vb (1)
96Public Overrides Function GetErrorDisplayString(symbol As ISymbol) As String
Operations\VisualBasicOperationFactory_Methods.vb (1)
275Friend Function CreateReceiverOperation(node As BoundNode, symbol As ISymbol) As IOperation
SymbolDisplay\SymbolDisplay.vb (7)
26Public Function ToDisplayString(symbol As ISymbol, Optional format As SymbolDisplayFormat = Nothing) As String 44Public Function ToMinimalDisplayString(symbol As ISymbol, 52Private Function ToDisplayString(symbol As ISymbol, 77Public Function ToDisplayParts(symbol As ISymbol, 95Public Function ToMinimalDisplayParts(symbol As ISymbol, 103Private Function ToDisplayParts(symbol As ISymbol, 116symbol As ISymbol,
SymbolDisplay\SymbolDisplayVisitor.Members.vb (4)
610Private Sub AddMemberModifiersIfRequired(symbol As ISymbol) 675Private Function IsWithEventsProperty(symbol As ISymbol) As Boolean 680Private Function IsOverloads(symbol As ISymbol) As Boolean 696Private Sub AssertContainingSymbol(symbol As ISymbol)
SymbolDisplay\SymbolDisplayVisitor.Types.vb (1)
139Dim containingSymbol As ISymbol = symbol.ContainingSymbol
SymbolDisplay\SymbolDisplayVisitor.vb (4)
87symbol As ISymbol, 343Private Sub AddAccessibilityIfRequired(symbol As ISymbol) 376Private Function ShouldVisitNamespace(containingSymbol As ISymbol) As Boolean 391Private Shared Function IsEnumMember(symbol As ISymbol) As Boolean
Symbols\ErrorTypeSymbol.vb (2)
428Public ReadOnly Property IErrorTypeSymbol_CandidateSymbols As ImmutableArray(Of ISymbol) Implements IErrorTypeSymbol.CandidateSymbols 430Return StaticCast(Of ISymbol).From(Me.CandidateSymbols)
Symbols\FieldSymbol.vb (1)
404Private ReadOnly Property IFieldSymbol_AssociatedSymbol As ISymbol Implements IFieldSymbol.AssociatedSymbol
Symbols\Metadata\PE\PENamedTypeSymbol.vb (4)
611Implements IComparer(Of ISymbol) 618Public Function Compare(x As ISymbol, y As ISymbol) As Integer Implements IComparer(Of ISymbol).Compare
Symbols\MethodSymbol.vb (2)
1017Private ReadOnly Property ISymbol_IsExtern As Boolean Implements ISymbol.IsExtern 1128Private ReadOnly Property IMethodSymbol_AssociatedSymbol As ISymbol Implements IMethodSymbol.AssociatedSymbol
Symbols\NamedTypeSymbol.vb (1)
1437Private ReadOnly Property INamedTypeSymbol_AssociatedSymbol As ISymbol Implements INamedTypeSymbol.AssociatedSymbol
Symbols\NamespaceOrTypeSymbol.vb (4)
268Private Function INamespaceOrTypeSymbol_GetMembers() As ImmutableArray(Of ISymbol) Implements INamespaceOrTypeSymbol.GetMembers 269Return StaticCast(Of ISymbol).From(Me.GetMembers()) 272Private Function INamespaceOrTypeSymbol_GetMembers(name As String) As ImmutableArray(Of ISymbol) Implements INamespaceOrTypeSymbol.GetMembers 273Return StaticCast(Of ISymbol).From(Me.GetMembers(name))
Symbols\Symbol.vb (41)
59Public Overridable ReadOnly Property MetadataName As String Implements ISymbol.MetadataName, ISymbolInternal.MetadataName 69Public Overridable ReadOnly Property MetadataToken As Integer Implements ISymbol.MetadataToken, ISymbolInternal.MetadataToken 778Public Overridable Function GetDocumentationCommentId() As String Implements ISymbol.GetDocumentationCommentId 793Public Overridable Function GetDocumentationCommentXml(Optional preferredCulture As CultureInfo = Nothing, Optional expandIncludes As Boolean = False, Optional cancellationToken As CancellationToken = Nothing) As String Implements ISymbol.GetDocumentationCommentXml 838Private Overloads Function IEquatable_Equals(other As ISymbol) As Boolean Implements IEquatable(Of ISymbol).Equals 842Private Overloads Function ISymbol_Equals(other As ISymbol, equalityComparer As SymbolEqualityComparer) As Boolean Implements ISymbol.Equals 969Public Overridable ReadOnly Property HasUnsupportedMetadata As Boolean Implements ISymbol.HasUnsupportedMetadata 1165Public MustOverride Sub Accept(visitor As SymbolVisitor) Implements ISymbol.Accept 1167Public MustOverride Function Accept(Of TResult)(visitor As SymbolVisitor(Of TResult)) As TResult Implements ISymbol.Accept 1169Public MustOverride Function Accept(Of TArgument, TResult)(visitor As SymbolVisitor(Of TArgument, TResult), argument As TArgument) As TResult Implements ISymbol.Accept 1175Private ReadOnly Property ISymbol_ContainingAssembly As IAssemblySymbol Implements ISymbol.ContainingAssembly 1187Private ReadOnly Property ISymbol_ContainingModule As IModuleSymbol Implements ISymbol.ContainingModule 1199Private ReadOnly Property ISymbol_ContainingNamespace As INamespaceSymbol Implements ISymbol.ContainingNamespace 1211Private ReadOnly Property ISymbol_ContainingSymbol As ISymbol Implements ISymbol.ContainingSymbol 1223Private ReadOnly Property ISymbol_ContainingType As INamedTypeSymbol Implements ISymbol.ContainingType 1235Private ReadOnly Property ISymbol_DeclaredAccessibility As Accessibility Implements ISymbol.DeclaredAccessibility, ISymbolInternal.DeclaredAccessibility 1241Protected Overridable ReadOnly Property ISymbol_IsAbstract As Boolean Implements ISymbol.IsAbstract, ISymbolInternal.IsAbstract 1247Private ReadOnly Property ISymbol_IsDefinition As Boolean Implements ISymbol.IsDefinition, ISymbolInternal.IsDefinition 1253Private ReadOnly Property ISymbol_IsOverride As Boolean Implements ISymbol.IsOverride, ISymbolInternal.IsOverride 1259Protected Overridable ReadOnly Property ISymbol_IsSealed As Boolean Implements ISymbol.IsSealed 1265Protected Overridable ReadOnly Property ISymbol_IsStatic As Boolean Implements ISymbol.IsStatic, ISymbolInternal.IsStatic 1271Private ReadOnly Property ISymbol_IsImplicitlyDeclared As Boolean Implements ISymbol.IsImplicitlyDeclared, ISymbolInternal.IsImplicitlyDeclared 1277Private ReadOnly Property ISymbol_IsVirtual As Boolean Implements ISymbol.IsVirtual, ISymbolInternal.IsVirtual 1283Private ReadOnly Property ISymbol_CanBeReferencedByName As Boolean Implements ISymbol.CanBeReferencedByName 1289Public ReadOnly Property Language As String Implements ISymbol.Language 1295Private ReadOnly Property ISymbol_Locations As ImmutableArray(Of Location) Implements ISymbol.Locations, ISymbolInternal.Locations 1301Private ReadOnly Property ISymbol_DeclaringSyntaxReferences As ImmutableArray(Of SyntaxReference) Implements ISymbol.DeclaringSyntaxReferences 1307Private ReadOnly Property ISymbol_Name As String Implements ISymbol.Name, ISymbolInternal.Name 1313Private ReadOnly Property ISymbol_OriginalDefinition As ISymbol Implements ISymbol.OriginalDefinition 1319Private ReadOnly Property ISymbol_Kind As SymbolKind Implements ISymbol.Kind, ISymbolInternal.Kind 1325Private Function ISymbol_ToDisplayString(Optional format As SymbolDisplayFormat = Nothing) As String Implements ISymbol.ToDisplayString 1329Private Function ISymbol_ToDisplayParts(Optional format As SymbolDisplayFormat = Nothing) As ImmutableArray(Of SymbolDisplayPart) Implements ISymbol.ToDisplayParts 1333Private Function ISymbol_ToMinimalDisplayString(semanticModel As SemanticModel, position As Integer, Optional format As SymbolDisplayFormat = Nothing) As String Implements ISymbol.ToMinimalDisplayString 1337Private Function ISymbol_ToMinimalDisplayParts(semanticModel As SemanticModel, position As Integer, Optional format As SymbolDisplayFormat = Nothing) As ImmutableArray(Of SymbolDisplayPart) Implements ISymbol.ToMinimalDisplayParts 1341Private ReadOnly Property ISymbol_IsExtern As Boolean Implements ISymbol.IsExtern, ISymbolInternal.IsExtern 1347Private Function ISymbol_GetAttributes() As ImmutableArray(Of AttributeData) Implements ISymbol.GetAttributes 1378Private Function ISymbolInternal_GetISymbol() As ISymbol Implements ISymbolInternal.GetISymbol
Symbols\SymbolExtensions.vb (1)
444Friend Function EnsureVbSymbolOrNothing(Of TSource As ISymbol, TDestination As {Symbol, TSource})(symbol As TSource, paramName As String) As TDestination
Symbols\SynthesizedSymbols\SynthesizedDelegateMethodSymbol.vb (1)
93''' Gets the <see cref="ISymbol" /> for the immediately containing symbol.
Symbols\TypeSymbol.vb (2)
539Private Function ITypeSymbol_FindImplementationForInterfaceMember(interfaceMember As ISymbol) As ISymbol Implements ITypeSymbol.FindImplementationForInterfaceMember
VisualBasicExtensions.vb (13)
523Public Function IsShared(symbol As ISymbol) As Boolean 528Public Function IsOverrides(symbol As ISymbol) As Boolean 533Public Function IsOverridable(symbol As ISymbol) As Boolean 538Public Function IsNotOverridable(symbol As ISymbol) As Boolean 543Public Function IsMustOverride(symbol As ISymbol) As Boolean 842Public Function GetDeclaredSymbol(semanticModel As SemanticModel, identifierSyntax As ModifiedIdentifierSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 859Public Function GetDeclaredSymbol(semanticModel As SemanticModel, elementSyntax As TupleElementSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 1527Public Function GetMemberGroup(semanticModel As SemanticModel, expression As ExpressionSyntax, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 1532Return ImmutableArray.Create(Of ISymbol) 1540Public Function GetSpeculativeMemberGroup(semanticModel As SemanticModel, position As Integer, expression As ExpressionSyntax) As ImmutableArray(Of ISymbol) 1545Return ImmutableArray.Create(Of ISymbol) 1553Public Function GetMemberGroup(semanticModel As SemanticModel, attribute As AttributeSyntax, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 1558Return ImmutableArray.Create(Of ISymbol)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (19)
src\Analyzers\VisualBasic\Analyzers\NamingStyle\VisualBasicNamingStyleDiagnosticAnalyzer.vb (1)
21Protected Overrides Function ShouldIgnore(symbol As ISymbol) As Boolean
src\Analyzers\VisualBasic\Analyzers\QualifyMemberAccess\VisualBasicQualifyMemberAccessDiagnosticAnalyzer.vb (1)
26Protected Overrides Function CanMemberAccessBeQualified(containingSymbol As ISymbol, node As SyntaxNode) As Boolean
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedMembers\VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb (2)
22Protected Overrides Sub HandleNamedTypeSymbolStart(context As SymbolStartAnalysisContext, onSymbolUsageFound As Action(Of ISymbol, ValueUsageInfo)) 45Private Shared Sub AnalyzeHandlesClause(context As SyntaxNodeAnalysisContext, onSymbolUsageFound As Action(Of ISymbol, ValueUsageInfo))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (1)
450Private Function CanReplace(symbol As ISymbol) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\InvocationExpressionSyntaxExtensions.vb (1)
49Dim symbol As ISymbol = semanticModel.GetSymbolInfo(invocationExpression.Expression).Symbol
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (3)
32cancellationToken As CancellationToken) As IList(Of ISymbol) 38Return SpecializedCollections.EmptyList(Of ISymbol)() 45cancellationToken As CancellationToken) As IList(Of ISymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SemanticFacts\VisualBasicSemanticFacts.vb (10)
65Public Function GetDeclaredSymbol(semanticModel As SemanticModel, token As SyntaxToken, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.GetDeclaredSymbol 224Public Function GetDeclaredSymbols(semanticModel As SemanticModel, memberDeclaration As SyntaxNode, cancellationToken As CancellationToken) As IEnumerable(Of ISymbol) Implements ISemanticFacts.GetDeclaredSymbols 242Public Function FindFieldOrPropertyForArgument(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.FindFieldOrPropertyForArgument 257Public Function FindFieldOrPropertyForAttributeArgument(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.FindFieldOrPropertyForAttributeArgument 261Public Function GetBestOrAllSymbols(semanticModel As SemanticModel, node As SyntaxNode, token As SyntaxToken, cancellationToken As CancellationToken) As ImmutableArray(Of ISymbol) Implements ISemanticFacts.GetBestOrAllSymbols 263Return ImmutableArray(Of ISymbol).Empty 268ImmutableArray.Create(Of ISymbol)(preprocessingSymbol), 276Public Function GetLocalFunctionSymbols(compilation As Compilation, symbol As ISymbol, cancellationToken As CancellationToken) As ImmutableArray(Of IMethodSymbol) Implements ISemanticFacts.GetLocalFunctionSymbols 339Public Function GetInterceptorSymbolAsync(document As Document, position As Integer, cancellationToken As CancellationToken) As Task(Of ISymbol) Implements ISemanticFacts.GetInterceptorSymbolAsync 341Return SpecializedTasks.Null(Of ISymbol)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (27)
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicCommonGenerationServiceMethods.vb (1)
28Public Shared Function IsValidSymbol(symbol As ISymbol, semanticModel As SemanticModel) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (1)
51Protected Overrides Function IsValidSymbol(symbol As ISymbol, semanticModel As SemanticModel) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateMethodService.vb (1)
36Protected Overrides Function IsValidSymbol(symbol As ISymbol, semanticModel As SemanticModel) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (1)
62newMembers As IList(Of ISymbol),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamespaceGenerator.vb (2)
60newMembers As IList(Of ISymbol), 106Private Function GenerateImportsStatement(import As ISymbol) As ImportsStatementSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationHelpers.vb (3)
67Public Function GenerateImplementsClause(explicitInterfaceOpt As ISymbol) As ImplementsClauseSyntax 178symbol As ISymbol, 198Public Function GetReuseableSyntaxNodeForSymbol(Of T As SyntaxNode)(symbol As ISymbol, options As CodeGenerationContextInfo) As T
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (1)
758Public Overrides Function UpdateDeclarationMembers(Of TDeclarationNode As SyntaxNode)(declaration As TDeclarationNode, newMembers As IList(Of ISymbol), options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxGeneratorVisitor.vb (3)
22Public Overrides Function DefaultVisit(symbol As ISymbol) As ExpressionSyntax 26Private Shared Function AddInformationTo(Of TExpressionSyntax As ExpressionSyntax)(expression As TExpressionSyntax, symbol As ISymbol) As TExpressionSyntax 74Private Shared Function CreateMemberAccessExpression(symbol As ISymbol, container As ExpressionSyntax, simpleName As SimpleNameSyntax) As ExpressionSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\StringExtensions.vb (2)
34Public Function EscapeIdentifier(text As String, Optional afterDot As Boolean = False, Optional symbol As ISymbol = Nothing, Optional withinAsyncMethod As Boolean = False) As String 61Public Function ToIdentifierToken(text As String, Optional afterDot As Boolean = False, Optional symbol As ISymbol = Nothing, Optional withinAsyncMethod As Boolean = False) As SyntaxToken
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SymbolExtensions.vb (2)
11Public Function IsMyNamespace(symbol As ISymbol, compilation As Compilation) As Boolean 23Public Function IsMyFormsProperty(symbol As ISymbol, compilation As Compilation) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (2)
27Public Overrides Function DefaultVisit(node As ISymbol) As TypeSyntax 31Private Shared Function AddInformationTo(Of TTypeSyntax As TypeSyntax)(type As TTypeSyntax, symbol As ISymbol) As TTypeSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\InitializeParameter\VisualBasicInitializeParameterService.vb (2)
48Protected Overrides Function TryUpdateTupleAssignment(blockStatement As IBlockOperation, parameter As IParameterSymbol, fieldOrProperty As ISymbol, editor As SyntaxEditor) As Boolean 53Protected Overrides Function TryAddAssignmentForPrimaryConstructorAsync(document As Document, parameter As IParameterSymbol, fieldOrProperty As ISymbol, cancellationToken As CancellationToken) As Task(Of Solution)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSemanticFactsService.vb (1)
126Private Function ISemanticFactsService_GenerateUniqueName(semanticModel As SemanticModel, location As SyntaxNode, containerOpt As SyntaxNode, baseName As String, filter As Func(Of ISymbol, Boolean), usedNames As IEnumerable(Of String), cancellationToken As CancellationToken) As SyntaxToken Implements ISemanticFactsService.GenerateUniqueName
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSymbolDeclarationService.vb (1)
26Public Function GetDeclarations(symbol As ISymbol) As ImmutableArray(Of SyntaxReference) Implements ISymbolDeclarationService.GetDeclarations
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (2)
366Private Shared Function InferTypeInArgument(argument As ArgumentSyntax, index As Integer, symbols As IEnumerable(Of ISymbol)) As IEnumerable(Of TypeInferenceInfo) 782Private Function GetDeclaredMemberSymbolFromOriginalSemanticModel(currentSemanticModel As SemanticModel, declarationInCurrentTree As DeclarationStatementSyntax) As ISymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\SymbolExtensions.vb (2)
10Public Function FindRelatedExplicitlyDeclaredSymbol(symbol As ISymbol, compilation As Compilation) As ISymbol
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (6)
CodeGen\CodeGenRefReturnTests.vb (1)
3772Protected Shared Function GetSymbolNamesJoined(Of T As ISymbol)(symbols As IEnumerable(Of T)) As String
Emit\EditAndContinue\EditAndContinueTest.vb (2)
48Protected Overrides Function GetEquivalentNodesMap(left As ISymbol, right As ISymbol) As Func(Of SyntaxNode, SyntaxNode)
Emit\EditAndContinue\EditAndContinueTestBase.vb (2)
57symbolProvider As Func(Of Compilation, ISymbol), 58Optional newSymbolProvider As Func(Of Compilation, ISymbol) = Nothing,
Emit\EditAndContinue\EditAndContinueTests.vb (1)
6779Dim allAddedSymbols = New ISymbol() {mA1, mX1}
Microsoft.CodeAnalysis.VisualBasic.Features (171)
ChangeSignature\VisualBasicChangeSignatureService.vb (11)
100cancellationToken As CancellationToken) As Task(Of (symbol As ISymbol, selectedIndex As Integer)) 205cancellationToken As CancellationToken) As ISymbol 276declarationSymbol As ISymbol, 492declarationSymbol As ISymbol, 560declarationSymbol As ISymbol, 610declarationSymbol As ISymbol, 633Private Function VerifyAndPermuteParamNodes(paramNodes As ImmutableArray(Of XmlElementSyntax), declarationSymbol As ISymbol, updatedSignature As SignatureChange) As ImmutableArray(Of SyntaxNode) 686cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of ISymbol)) 694Dim results = ArrayBuilder(Of ISymbol).GetInstance() 699Dim convertedType As ISymbol = semanticModel.GetTypeInfo(u, cancellationToken).ConvertedType 793Protected Overrides Function GetParameters(declarationSymbol As ISymbol) As ImmutableArray(Of IParameterSymbol)
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (1)
158Private Shared Function GetEnclosingBlockKinds(enclosingblocks As IEnumerable(Of SyntaxNode), enclosingDeclaration As ISymbol) As IEnumerable(Of SyntaxKind)
CodeFixes\Suppression\VisualBasicSuppressionCodeFixProvider.vb (4)
118targetSymbol As ISymbol, 153targetSymbol As ISymbol, 166targetSymbol As ISymbol, 177Private Shared Function CreateAttributeArguments(targetSymbol As ISymbol, diagnostic As Diagnostic, isAssemblyAttribute As Boolean) As ArgumentListSyntax
CodeLens\VisualBasicDisplayInfoService.vb (3)
66Private Shared Function SymbolToDisplayString(symbol As ISymbol) As String 97Private Shared Function IsAccessorForDefaultProperty(symbol As ISymbol) As Boolean 124Dim symbol As ISymbol = semanticModel.GetDeclaredSymbol(node)
Completion\CompletionProviders\CompletionListTagCompletionProvider.vb (2)
59For Each member In completionListType.GetAccessibleMembersInThisAndBaseTypes(Of ISymbol)(within) 86Protected Overrides Function GetDisplayAndSuffixAndInsertionText(symbol As ISymbol, context As VisualBasicSyntaxContext) As (displayText As String, suffix As String, insertionText As String)
Completion\CompletionProviders\CompletionUtilities.vb (4)
82symbol As ISymbol, 97Private Function GetDisplayText(name As String, symbol As ISymbol) As String 105Private Function GetSuffix(symbol As ISymbol) As String 115Private Function GetInsertionText(name As String, symbol As ISymbol, context As SyntaxContext) As String
Completion\CompletionProviders\CrefCompletionProvider.vb (6)
100Protected Overrides Async Function GetSymbolsAsync(document As Document, position As Integer, options As CompletionOptions, cancellationToken As CancellationToken) As Task(Of (SyntaxToken, SemanticModel, ImmutableArray(Of ISymbol))) 164Private Overloads Shared Function GetSymbols(token As SyntaxToken, semanticModel As SemanticModel, cancellationToken As CancellationToken) As IEnumerable(Of ISymbol) 173Return SpecializedCollections.EmptyEnumerable(Of ISymbol) 176Private Shared Iterator Function GetQualifiedSymbols(qualifiedName As QualifiedNameSyntax, token As SyntaxToken, semanticModel As SemanticModel, cancellationToken As CancellationToken) As IEnumerable(Of ISymbol) 198symbols As IEnumerable(Of ISymbol), position As Integer) As IEnumerable(Of CompletionItem) 213symbol As ISymbol, position As Integer, builder As StringBuilder) As CompletionItem
Completion\CompletionProviders\EnumCompletionProvider.vb (2)
90Private Shared Function GetTypeFromSymbol(symbol As ISymbol) As ITypeSymbol 104Protected Overrides Function GetDisplayAndSuffixAndInsertionText(symbol As ISymbol, context As VisualBasicSyntaxContext) As (displayText As String, suffix As String, insertionText As String)
Completion\CompletionProviders\HandlesClauseCompletionProvider.vb (11)
46Private Overloads Shared Function GetSymbolsAsync(context As VisualBasicSyntaxContext, position As Integer, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of ISymbol)) 49Return SpecializedTasks.EmptyImmutableArray(Of ISymbol)() 53Return SpecializedTasks.EmptyImmutableArray(Of ISymbol)() 67Return SpecializedTasks.EmptyImmutableArray(Of ISymbol)() 79) As ImmutableArray(Of ISymbol) 90Return ImmutableArray(Of ISymbol).Empty 102) As ImmutableArray(Of ISymbol) 114Return ImmutableArray(Of ISymbol).Empty 142Return ImmutableArray(Of ISymbol).CastUp(result) 145Private Shared Function IsWithEvents(s As ISymbol) As Boolean 155symbol As ISymbol, context As VisualBasicSyntaxContext) As (displayText As String, suffix As String, insertionText As String)
Completion\CompletionProviders\ImplementsClauseCompletionProvider.vb (31)
58context As VisualBasicSyntaxContext, position As Integer, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of ISymbol)) 60Return SpecializedTasks.EmptyImmutableArray(Of ISymbol)() 65Return SpecializedTasks.EmptyImmutableArray(Of ISymbol)() 87Return SpecializedTasks.EmptyImmutableArray(Of ISymbol)() 90Dim result = ImmutableArray(Of ISymbol).Empty 109Return SpecializedTasks.EmptyImmutableArray(Of ISymbol)() 112Private Shared Function MatchesMemberKind(symbol As ISymbol, memberKindKeyword As SyntaxKind) As Boolean 138Private Shared Function GetDottedMembers(position As Integer, qualifiedName As QualifiedNameSyntax, semanticModel As SemanticModel, memberKindKeyword As SyntaxKind, cancellationToken As CancellationToken) As ImmutableArray(Of ISymbol) 141Return ImmutableArray(Of ISymbol).Empty 152Dim interfacesAndContainers = New HashSet(Of ISymbol)(interfaces) 174Return ImmutableArray(Of ISymbol).Empty 179Dim hashSet = New HashSet(Of ISymbol)(symbols.ToArray() _ 180.Where(Function(s As ISymbol) interfacesAndContainers.Contains(s, SymbolEquivalenceComparer.Instance) OrElse 186Private Function interfaceMemberGetter([interface] As ITypeSymbol, within As ISymbol) As ImmutableArray(Of ISymbol) 187Return ImmutableArray.CreateRange(Of ISymbol)([interface].AllInterfaces.SelectMany(Function(i) i.GetMembers()).Where(Function(s) s.IsAccessibleWithin(within))) _ 191Private Function GetInterfacesAndContainers(position As Integer, node As SyntaxNode, semanticModel As SemanticModel, kind As SyntaxKind, cancellationToken As CancellationToken) As ImmutableArray(Of ISymbol) 194Return ImmutableArray(Of ISymbol).Empty 201Dim interfacesAndContainers = New HashSet(Of ISymbol)(interfaceWithUnimplementedMembers) 206Dim symbols = New HashSet(Of ISymbol)(semanticModel.LookupSymbols(position)) 215Dim defaultListing = New List(Of ISymbol)(containingType.Interfaces) 228Private Shared Sub AddAliasesAndContainers(symbol As ISymbol, interfacesAndContainers As ICollection(Of ISymbol), node As SyntaxNode, semanticModel As SemanticModel) 246Private Shared Sub AddAlias(symbol As ISymbol, interfacesAndContainers As ICollection(Of ISymbol), node As SyntaxNode, semanticModel As SemanticModel) 255Private Shared Function IsGlobal(containingSymbol As ISymbol) As Boolean 260Private Shared Function TryAddGlobalTo(symbols As ImmutableArray(Of ISymbol)) As ImmutableArray(Of ISymbol) 263Return symbols.Concat(ImmutableArray.Create(Of ISymbol)(withGlobalContainer.ContainingNamespace)) 278Protected Overrides Function GetDisplayAndSuffixAndInsertionText(symbol As ISymbol, context As VisualBasicSyntaxContext) As (displayText As String, suffix As String, insertionText As String) 291Private Shared Function IsGenericType(symbol As ISymbol) As Boolean
Completion\CompletionProviders\NamedParameterCompletionProvider.vb (10)
114Private Shared Function IsValid(parameterList As ImmutableArray(Of ISymbol), existingNamedParameters As ISet(Of String)) As Boolean 133cancellationToken As CancellationToken) As IEnumerable(Of ImmutableArray(Of ISymbol)) 143cancellationToken As CancellationToken) As IEnumerable(Of ImmutableArray(Of ISymbol)) 149Select(Function(c) c.Parameters.As(Of ISymbol)()) 158cancellationToken As CancellationToken) As IEnumerable(Of ImmutableArray(Of ISymbol)) 170cancellationToken As CancellationToken) As IEnumerable(Of ImmutableArray(Of ISymbol)) 182Dim methodParameters = accessibleMembers.OfType(Of IMethodSymbol).Select(Function(m) m.Parameters.As(Of ISymbol)()) 183Dim propertyParameters = accessibleMembers.OfType(Of IPropertySymbol).Select(Function(p) p.Parameters.As(Of ISymbol)()) 187Return SpecializedCollections.SingletonEnumerable(delegateType.DelegateInvokeMethod.Parameters.As(Of ISymbol)()) 190Select(Function(i) i.Parameters.As(Of ISymbol)())
Completion\CompletionProviders\ObjectCreationCompletionProvider.vb (1)
69Protected Overrides Function GetDisplayAndSuffixAndInsertionText(symbol As ISymbol, context As VisualBasicSyntaxContext) As (displayText As String, suffix As String, insertionText As String)
Completion\CompletionProviders\ObjectInitializerCompletionProvider.vb (3)
109Protected Overrides Function IsInitializableFieldOrProperty(fieldOrProperty As ISymbol, containingType As INamedTypeSymbol) As Boolean 116Protected Overrides Function EscapeIdentifier(symbol As ISymbol) As String 120Private Shared Function IsValidProperty(member As ISymbol) As Boolean
Completion\CompletionProviders\OverrideCompletionProvider.vb (4)
156Public Overrides Function FilterOverrides(members As ImmutableArray(Of ISymbol), 157returnType As ITypeSymbol) As ImmutableArray(Of ISymbol) 168Return ImmutableArray(Of ISymbol).CastUp(filteredMembers.ToImmutableArray()) 180Return ImmutableArray(Of ISymbol).CastUp(filteredMembers.ToImmutableArray())
Completion\CompletionProviders\SymbolCompletionProvider.vb (3)
102Protected Overrides Function GetDisplayAndSuffixAndInsertionText(symbol As ISymbol, context As VisualBasicSyntaxContext) As (displayText As String, suffix As String, insertionText As String) 106Protected Overrides Function GetFilterText(symbol As ISymbol, displayText As String, context As VisualBasicSyntaxContext) As String 121Protected Overrides Function IsInstrinsic(s As ISymbol) As Boolean
Completion\CompletionProviders\XmlDocCommentCompletionProvider.vb (3)
117Dim symbol As ISymbol = Nothing 228symbol As ISymbol) 353Protected Overrides Function GetParameters(symbol As ISymbol) As ImmutableArray(Of IParameterSymbol)
Debugging\BreakpointResolver.vb (1)
21Protected Overrides Function GetMembers(type As INamedTypeSymbol, name As String) As IEnumerable(Of ISymbol)
EditAndContinue\DeclarationBody\FieldOrPropertyDeclarationBody.vb (1)
130Public Overrides Function GetCapturedVariables(model As SemanticModel) As ImmutableArray(Of ISymbol)
EditAndContinue\DeclarationBody\FieldWithMultipleArrayBoundsDeclarationBody.vb (1)
39Public Overrides Function GetCapturedVariables(model As SemanticModel) As ImmutableArray(Of ISymbol)
EditAndContinue\DeclarationBody\FieldWithSingleArrayBoundsDeclarationBody.vb (1)
44Public Overrides Function GetCapturedVariables(model As SemanticModel) As ImmutableArray(Of ISymbol)
EditAndContinue\DeclarationBody\MethodBody.vb (2)
21Public Overrides Function GetCapturedVariables(model As SemanticModel) As ImmutableArray(Of ISymbol) 24Return ImmutableArray(Of ISymbol).Empty
EditAndContinue\DeclarationBody\VisualBasicLambdaBody.vb (1)
44Public Overrides Function GetCapturedVariables(model As SemanticModel) As ImmutableArray(Of ISymbol)
EditAndContinue\SyntaxUtilities.vb (1)
117Friend Shared Function GetArrayBoundsCapturedVariables(model As SemanticModel, arrayBounds As ArgumentListSyntax) As ImmutableArray(Of ISymbol)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (24)
88Friend Overrides Function TryGetDeclarationBody(node As SyntaxNode, symbol As ISymbol) As MemberBody 92Friend Overrides Function IsDeclarationWithSharedBody(declaration As SyntaxNode, member As ISymbol) As Boolean 101Protected Overrides Function GetVariableUseSites(roots As IEnumerable(Of SyntaxNode), localOrParameter As ISymbol, model As SemanticModel, cancellationToken As CancellationToken) As IEnumerable(Of SyntaxNode) 524Protected Overrides Function GetSymbolDeclarationSyntax(symbol As ISymbol, selector As Func(Of ImmutableArray(Of SyntaxReference), SyntaxReference), cancellationToken As CancellationToken) As SyntaxNode 629Protected Overrides Function GetDeclaredSymbol(model As SemanticModel, declaration As SyntaxNode, cancellationToken As CancellationToken) As ISymbol 633Friend Overrides Function IsConstructorWithMemberInitializers(symbol As ISymbol, cancellationToken As CancellationToken) As Boolean 703cancellationToken As CancellationToken) As OneOrMany(Of (oldSymbol As ISymbol, newSymbol As ISymbol)) 705Dim oldSymbols = OneOrMany(Of ISymbol).Empty 706Dim newSymbols = OneOrMany(Of ISymbol).Empty 710Return OneOrMany(Of (ISymbol, ISymbol)).Empty 726oldSymbols As OneOrMany(Of ISymbol), 727newSymbols As OneOrMany(Of ISymbol)) As IEnumerable(Of (ISymbol, ISymbol)) 738ByRef result As TemporaryArray(Of (ISymbol, ISymbol, EditKind)), 741oldSymbol As ISymbol, 743newSymbol As ISymbol, 889<Out> ByRef symbols As OneOrMany(Of ISymbol), 935Private Function GetParameterContainingMemberOrType(node As SyntaxNode, otherNode As SyntaxNode, model As SemanticModel, fromOtherMap As IReadOnlyDictionary(Of SyntaxNode, SyntaxNode), cancellationToken As CancellationToken) As ISymbol 1985Friend Overrides Sub ReportInsertedMemberSymbolRudeEdits(diagnostics As RudeEditDiagnosticsBuilder, newSymbol As ISymbol, newNode As SyntaxNode, insertingIntoExistingContainingType As Boolean) 1997Private Shared Function GetInsertedMemberSymbolRudeEditKind(newSymbol As ISymbol, insertingIntoExistingContainingType As Boolean) As RudeEditKind
EncapsulateField\VisualBasicEncapsulateFieldService.vb (2)
114Dim containingTypeMemberNames = field.ContainingType.GetAccessibleMembersInThisAndBaseTypes(Of ISymbol)(field.ContainingType).Select(Function(s) s.Name) 127Dim containingTypeMemberNames = field.ContainingType.GetAccessibleMembersInThisAndBaseTypes(Of ISymbol)(field.ContainingType).Select(Function(s) s.Name)
ExtractInterface\VisualBasicExtractInterfaceService.vb (2)
102typeToExtractFrom As INamedTypeSymbol, includedMembers As IEnumerable(Of ISymbol), 103symbolToDeclarationAnnotationMap As ImmutableDictionary(Of ISymbol, SyntaxAnnotation), cancellationToken As CancellationToken) As Task(Of Solution)
ExtractMethod\Extensions.vb (1)
363Public Function IsFunctionValue(symbol As ISymbol) As Boolean
GoToDefinition\VisualBasicGoToDefinitionSymbolService.vb (2)
24Protected Overrides Async Function FindRelatedExplicitlyDeclaredSymbolAsync(project As Project, symbol As ISymbol, cancellationToken As CancellationToken) As Task(Of ISymbol)
LanguageServices\VisualBasicSymbolDisplayService.SymbolDescriptionBuilder.vb (6)
77Protected Overrides Function GetInitializerSourcePartsAsync(symbol As ISymbol) As Task(Of ImmutableArray(Of SymbolDisplayPart)) 89Protected Overrides Function ToMinimalDisplayParts(symbol As ISymbol, semanticModel As SemanticModel, position As Integer, format As SymbolDisplayFormat) As ImmutableArray(Of SymbolDisplayPart) 93Protected Overrides Function GetNavigationHint(symbol As ISymbol) As String 97Private Async Function GetFirstDeclarationAsync(Of T As SyntaxNode)(symbol As ISymbol) As Task(Of T) 109Private Async Function GetDeclarationsAsync(Of T As SyntaxNode)(symbol As ISymbol) As Task(Of List(Of T)) 168Protected Overrides Sub AddCaptures(symbol As ISymbol)
MetadataAsSource\VisualBasicMetadataAsSourceService.vb (1)
28Protected Overrides Async Function AddAssemblyInfoRegionAsync(document As Document, symbolCompilation As Compilation, symbol As ISymbol, cancellationToken As CancellationToken) As Task(Of Document)
NavigationBar\VisualBasicNavigationBarItemService.vb (3)
183member As ISymbol, 269Private Shared Function IncludeMember(symbol As ISymbol) As Boolean 392members As IEnumerable(Of ISymbol),
QuickInfo\VisualBasicSemanticQuickInfoProvider.vb (1)
177Function(n) As ISymbol
Rename\VisualBasicRenameIssuesService.vb (1)
19Public Function CheckLanguageSpecificIssues(semantic As SemanticModel, symbol As ISymbol, triggerToken As SyntaxToken, <NotNullWhen(True)> ByRef langError As String) As Boolean Implements IRenameIssuesService.CheckLanguageSpecificIssues
SignatureHelp\AbstractOrdinaryMethodSignatureHelpProvider.vb (3)
14member As ISymbol, 32Private Shared Function GetMemberGroupPreambleParts(symbol As ISymbol, semanticModel As SemanticModel, position As Integer) As IList(Of SymbolDisplayPart) 50Private Shared Function GetMemberGroupPostambleParts(symbol As ISymbol,
SignatureHelp\AbstractVisualBasicSignatureHelpProvider.vb (1)
51Protected Shared Sub AddExtensionPreamble(symbol As ISymbol, result As IList(Of SymbolDisplayPart))
SignatureHelp\AttributeSignatureHelpProvider.vb (2)
107within As ISymbol, 135namedParameters As List(Of ISymbol),
SignatureHelp\GenericNameSignatureHelpProvider.vb (1)
117Private Overloads Shared Function Convert(symbol As ISymbol, genericName As GenericNameSyntax, semanticModel As SemanticModel, structuralTypeDisplayService As IStructuralTypeDisplayService, documentationCommentFormattingService As IDocumentationCommentFormattingService) As SignatureHelpItem
SignatureHelp\InvocationExpressionSignatureHelpProvider.ElementAccess.vb (1)
19within As ISymbol,
SignatureHelp\InvocationExpressionSignatureHelpProvider.MemberGroup.vb (4)
16within As ISymbol, 17memberGroup As IEnumerable(Of ISymbol), 18cancellationToken As CancellationToken) As ImmutableArray(Of ISymbol) 38Private Shared Function GetMemberGroupItems(accessibleMembers As ImmutableArray(Of ISymbol),
SignatureHelp\InvocationExpressionSignatureHelpProvider.vb (1)
119Dim accessibleMembers = ImmutableArray(Of ISymbol).Empty
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.NormalType.vb (1)
22within As ISymbol,
src\Analyzers\VisualBasic\Analyzers\NamingStyle\VisualBasicNamingStyleDiagnosticAnalyzer.vb (1)
21Protected Overrides Function ShouldIgnore(symbol As ISymbol) As Boolean
src\Analyzers\VisualBasic\Analyzers\QualifyMemberAccess\VisualBasicQualifyMemberAccessDiagnosticAnalyzer.vb (1)
26Protected Overrides Function CanMemberAccessBeQualified(containingSymbol As ISymbol, node As SyntaxNode) As Boolean
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedMembers\VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb (2)
22Protected Overrides Sub HandleNamedTypeSymbolStart(context As SymbolStartAnalysisContext, onSymbolUsageFound As Action(Of ISymbol, ValueUsageInfo)) 45Private Shared Sub AnalyzeHandlesClause(context As SyntaxNodeAnalysisContext, onSymbolUsageFound As Action(Of ISymbol, ValueUsageInfo))
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicCommonGenerationServiceMethods.vb (1)
28Public Shared Function IsValidSymbol(symbol As ISymbol, semanticModel As SemanticModel) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (1)
51Protected Overrides Function IsValidSymbol(symbol As ISymbol, semanticModel As SemanticModel) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateMethodService.vb (1)
36Protected Overrides Function IsValidSymbol(symbol As ISymbol, semanticModel As SemanticModel) As Boolean
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (7)
EditAndContinue\Helpers\EditingTestBase.vb (6)
144symbolProvider As Func(Of Compilation, ISymbol), 148Optional deletedSymbolContainerProvider As Func(Of Compilation, ISymbol) = Nothing) As SemanticEditDescription 153symbolProvider As Func(Of Compilation, ISymbol), 157Optional deletedSymbolContainerProvider As Func(Of Compilation, ISymbol) = Nothing) As SemanticEditDescription 169symbolProvider As Func(Of Compilation, ISymbol), 172Optional deletedSymbolContainerProvider As Func(Of Compilation, ISymbol) = Nothing) As SemanticEditDescription
EditAndContinue\Helpers\VisualBasicEditAndContinueTestVerifier.vb (1)
39Public Overrides Function GetDeclarators(method As ISymbol) As ImmutableArray(Of SyntaxNode)
Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests (1)
InteractiveSessionTests.vb (1)
158Function lookupMember(c As Compilation, typeName As String, memberName As String) As ISymbol
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (79)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (3)
907ByRef syntax As MethodBaseSyntax) As ISymbol 1897ByRef syntax As ModifiedIdentifierSyntax) As ISymbol 2628AssertEx.Equal(Of ISymbol)(nsSymbolA, memSymbol)
Compilation\SemanticModelLookupSymbolsAPITests.vb (1)
349Private Shared Sub CheckSymbols(symbols As ImmutableArray(Of ISymbol), ParamArray descriptions As String())
Diagnostics\DiagnosticAnalyzerTests.vb (2)
1615Private Shared Sub verifyFlowGraphs(compilation As Compilation, flowGraphs As ImmutableArray(Of (Graph As ControlFlowGraph, AssociatedSymbol As ISymbol)), expectedFlowGraphs As String()) 1618Dim actualFlowGraphAndSymbol As (Graph As ControlFlowGraph, AssociatedSymbol As ISymbol) = flowGraphs(i)
Diagnostics\GetDiagnosticsTests.vb (1)
655Private Sub AnalyzeNode(node As SyntaxNode, containingSymbol As ISymbol, reportDiagnostic As Action(Of Diagnostic))
FlowAnalysis\FlowTestBase.vb (1)
105Protected Shared Function GetSymbolNamesJoined(Of T As ISymbol)(symbols As IEnumerable(Of T)) As String
Semantics\ForeachTest.vb (13)
1161AssertEx.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerable__GetEnumerator), loopInfo.GetEnumeratorMethod) 1162AssertEx.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__Current), loopInfo.CurrentProperty) 1163AssertEx.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__MoveNext), loopInfo.MoveNextMethod) 1164AssertEx.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_IDisposable__Dispose), loopInfo.DisposeMethod) 1201AssertEx.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerable__GetEnumerator), loopInfo.GetEnumeratorMethod) 1202AssertEx.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__Current), loopInfo.CurrentProperty) 1203AssertEx.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__MoveNext), loopInfo.MoveNextMethod) 1204AssertEx.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_IDisposable__Dispose), loopInfo.DisposeMethod) 1257AssertEx.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__Current), loopInfo0.CurrentProperty) 1258AssertEx.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__MoveNext), loopInfo0.MoveNextMethod) 1259AssertEx.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_IDisposable__Dispose), loopInfo0.DisposeMethod) 1265AssertEx.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerable__GetEnumerator), loopInfo1.GetEnumeratorMethod) ' No longer using System.Array method. 1381Private Function GetSymbolNamesSortedAndJoined(Of T As ISymbol)(symbols As IEnumerable(Of T)) As String
Semantics\ForLoopTest.vb (1)
650Private Function GetSymbolNamesSortedAndJoined(Of T As ISymbol)(symbols As IEnumerable(Of T)) As String
Semantics\GetExtendedSemanticInfoTests.vb (2)
9062Dim sortedMethodGroup As ISymbol() = memberGroup.AsEnumerable().OrderBy(Function(s) s.ToTestDisplayString()).ToArray() 9255Dim sortedMethodGroup As ISymbol() = memberGroup.AsEnumerable().OrderBy(Function(s) s.ToTestDisplayString()).ToArray()
Semantics\GotoTests.vb (9)
210AssertEx.Equal(Of ISymbol)(declaredSymbol, semanticSummary.Symbol) 241AssertEx.Equal(Of ISymbol)(declaredSymbol0, semanticSummary0.Symbol) 250AssertEx.Equal(Of ISymbol)(declaredSymbol0, semanticSummary1.Symbol) 284AssertEx.Equal(Of ISymbol)(declaredSymbol, semanticSummary.Symbol) 318AssertEx.NotEqual(Of ISymbol)(declaredSymbolOuter, semanticSummary.Symbol) 319AssertEx.Equal(Of ISymbol)(declaredSymbolInner, semanticSummary.Symbol) 357AssertEx.Equal(Of ISymbol)(declaredSymbol, semanticSummary.Symbol) 393AssertEx.Equal(Of ISymbol)(declaredSymbol, semanticSummary.Symbol) 427AssertEx.Equal(Of ISymbol)(declaredSymbol, semanticSummary.Symbol)
Semantics\IFOperatorTest.vb (1)
1235Private Function GetSymbolNamesSortedAndJoined(Of T As ISymbol)(symbols As IEnumerable(Of T)) As String
Semantics\MeMyBaseMyClassTests.vb (2)
544Public Function LookUpSymbolTest(comp As VisualBasicCompilation, name As String, Optional index As Integer = 1, Optional expectedCount As Integer = 0, Optional expectedString As String = "") As ISymbol 561Public Sub GetSymbolInfoTest(comp As VisualBasicCompilation, nodeName As String, expectedSymbol As ISymbol)
Semantics\MultiDimensionalTest.vb (2)
321Private Function GetDeclareSymbolTest(compilation As VisualBasicCompilation, expectedSymbolName As String, Optional index As Integer = 1) As ISymbol 368Private Function GetSymbolNamesSortedAndJoined(Of T As ISymbol)(symbols As IEnumerable(Of T)) As String
Semantics\NameOfTests.vb (39)
55Dim group As ImmutableArray(Of ISymbol) 454Dim group As ImmutableArray(Of ISymbol) 526Dim group As ImmutableArray(Of ISymbol) 610Dim group As ImmutableArray(Of ISymbol) 662Dim group As ImmutableArray(Of ISymbol) 712Dim group As ImmutableArray(Of ISymbol) 765Dim group As ImmutableArray(Of ISymbol) 815Dim group As ImmutableArray(Of ISymbol) 865Dim group As ImmutableArray(Of ISymbol) 942Dim group As ImmutableArray(Of ISymbol) 1055Dim group As ImmutableArray(Of ISymbol) 1123Dim group As ImmutableArray(Of ISymbol) 1188Dim group As ImmutableArray(Of ISymbol) 1270Dim group As ImmutableArray(Of ISymbol) 1352Dim group As ImmutableArray(Of ISymbol) 1433Dim group As ImmutableArray(Of ISymbol) 1513Dim group As ImmutableArray(Of ISymbol) 1644Dim group As ImmutableArray(Of ISymbol) 1737Dim group As ImmutableArray(Of ISymbol) 1794Dim group As ImmutableArray(Of ISymbol) 1851Dim group As ImmutableArray(Of ISymbol) 1908Dim group As ImmutableArray(Of ISymbol) 2050Dim group As ImmutableArray(Of ISymbol) 2149Dim group As ImmutableArray(Of ISymbol) 2250Dim group As ImmutableArray(Of ISymbol) 2356Dim group As ImmutableArray(Of ISymbol) 2460Dim group As ImmutableArray(Of ISymbol) 2793Dim group As ImmutableArray(Of ISymbol) 2868Dim group As ImmutableArray(Of ISymbol) 2933Dim group As ImmutableArray(Of ISymbol) 2996Dim group As ImmutableArray(Of ISymbol) 3057Dim group As ImmutableArray(Of ISymbol) 3118Dim group As ImmutableArray(Of ISymbol) 3178Dim group As ImmutableArray(Of ISymbol) 3241Dim group As ImmutableArray(Of ISymbol) 3302Dim group As ImmutableArray(Of ISymbol) 3359Dim group As ImmutableArray(Of ISymbol) 3418Dim group As ImmutableArray(Of ISymbol) 3474Dim group As ImmutableArray(Of ISymbol)
Semantics\UsingStatementTest.vb (2)
317Private Function VerifyDeclaredSymbolForUsingStatements(compilation As VisualBasicCompilation, index As Integer, ParamArray variables As String()) As List(Of ISymbol) 323Dim symbols = New List(Of ISymbol)()
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (11)
DocumentationComments\DocCommentTests.vb (7)
4996Array.Sort(list, Function(x As ISymbol, y As ISymbol) compilation.CompareSourceLocations(x.Locations(0), y.Locations(0))) 11941Private Shared Function FilterOfSymbolKindOnly(symbols As ImmutableArray(Of ISymbol), ParamArray kinds() As SymbolKind) As ImmutableArray(Of ISymbol) 11948Private Shared Sub AssertLookupResult(actual As ImmutableArray(Of ISymbol), ParamArray expected() As String) 11952Private Function CheckSymbolInfoOnly(model As SemanticModel, syntax As ExpressionSyntax, ParamArray expected() As String) As ImmutableArray(Of ISymbol) 12071Private Sub TestSymbolAndTypeInfoForType(model As SemanticModel, syntax As TypeSyntax, expected As ISymbol)
SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb (2)
147AssertEx.Equal(Of ISymbol)(localType, symbol) 179AssertEx.Equal(Of ISymbol)(member, propSymbol)
SymbolsTests\Source\BindingsTests.vb (2)
456Dim symbols As ImmutableArray(Of ISymbol) 492AssertEx.Equal(Of ISymbol)(importsYellowSymInfo.Type, symbol)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (2)
Syntax\GeneratedTests.vb (1)
86Public Overrides Function GetErrorDisplayString(symbol As ISymbol) As String
TestSyntaxNodes.vb (1)
1099Public Overrides Function GetErrorDisplayString(symbol As ISymbol) As String
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (14)
BasicTestBase.vb (1)
843Dim graphAndSymbol As (Graph As FlowAnalysis.ControlFlowGraph, AssociatedSymbol As ISymbol) = ControlFlowGraphVerifier.GetControlFlowGraph(syntaxNode, model)
CompilationTestUtils.vb (11)
526Public CandidateSymbols As ImmutableArray(Of ISymbol) = ImmutableArray.Create(Of ISymbol)() 527Public AllSymbols As ImmutableArray(Of ISymbol) = ImmutableArray.Create(Of ISymbol)() 531Public MemberGroup As ImmutableArray(Of ISymbol) = ImmutableArray.Create(Of ISymbol)() 1195Public Function VerifyIsGlobal(globalNS1 As ISymbol, Optional expected As Boolean = True) As NamespaceSymbol 1206Public Sub CheckSymbols(Of TSymbol As ISymbol)(symbols As ImmutableArray(Of TSymbol), ParamArray descriptions As String()) 1218Public Sub CheckSymbols(Of TSymbol As ISymbol)(symbols As TSymbol(), ParamArray descriptions As String()) 1222Public Sub CheckSymbol(symbol As ISymbol, description As String) 1240Public Sub CheckSymbolsUnordered(Of TSymbol As ISymbol)(symbols As ImmutableArray(Of TSymbol), ParamArray descriptions As String())
SemanticModelTestBase.vb (2)
88Protected Function GetStartSpanErrorMessage(syntax As SyntaxNode, tpSymbol As ISymbol) As String 126Friend Function GetLookupSymbols(compilation As Compilation, filename As String, Optional container As NamespaceOrTypeSymbol = Nothing, Optional name As String = Nothing, Optional arity As Integer? = Nothing, Optional includeReducedExtensionMethods As Boolean = False, Optional mustBeStatic As Boolean = False) As List(Of ISymbol)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (104)
CaseCorrection\VisualBasicCaseCorrectionService.Rewriter.vb (5)
166Private Shared Function IsNamespaceOrTypeRelatedSymbol(symbol As ISymbol) As Boolean 172Private Function GetAliasOrAnySymbol(model As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISymbol 187symbol As ISymbol, 215Private Shared Function GetCorrectedName(token As SyntaxToken, symbol As ISymbol) As String 233Private Shared Function NamesDiffer(symbol As ISymbol,
Classification\SyntaxClassification\NameSyntaxClassifier.vb (2)
98symbol As ISymbol, 153symbol As ISymbol,
CodeGeneration\VisualBasicSyntaxGenerator.vb (2)
2569explicitInterfaceImplementations As ImmutableArray(Of ISymbol), 2591Private Function GenerateInterfaceMember(method As ISymbol) As QualifiedNameSyntax
FindSymbols\VisualBasicReferenceFinder.vb (7)
23symbol As ISymbol, 25cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of ISymbol)) Implements ILanguageServiceReferenceFinder.DetermineCascadedSymbolsAsync 31Return SpecializedTasks.EmptyImmutableArray(Of ISymbol) 38cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of ISymbol)) 44ImmutableArray(Of ISymbol).Empty, 51cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of ISymbol)) 66Select DirectCast(childProperty, ISymbol)
Recommendations\VisualBasicRecommendationServiceRunner.vb (34)
30Private Overloads Function GetSymbols() As ImmutableArray(Of ISymbol) 33Return ImmutableArray(Of ISymbol).Empty 66Return ImmutableArray(Of ISymbol).Empty 83Private Function IsWritableFieldOrLocal(symbol As ISymbol) As Boolean 97Private Function GetSymbolsForGlobalStatementContext() As ImmutableArray(Of ISymbol) 101Private Function GetUnqualifiedSymbolsForQueryIntoContext() As ImmutableArray(Of ISymbol) 105Return ImmutableArray(Of ISymbol).CastUp( 111Private Function GetUnqualifiedSymbolsForLabelContext() As ImmutableArray(Of ISymbol) 115Private Function GetUnqualifiedSymbolsForRaiseEvent() As ImmutableArray(Of ISymbol) 123Private Function GetUnqualifiedSymbolsForType() As ImmutableArray(Of ISymbol) 128Private Function GetUnqualifiedSymbolsForExpressionOrStatementContext() As ImmutableArray(Of ISymbol) 155Private Shared Function IsInEligibleDelegate(s As ISymbol) As Boolean 164Private Function GetSymbolsForQualifiedNameSyntax(node As QualifiedNameSyntax) As ImmutableArray(Of ISymbol) 172Return ImmutableArray(Of ISymbol).Empty 179Dim symbols As ImmutableArray(Of ISymbol) 197Private Function GetSymbolsForMemberAccessExpression(node As MemberAccessExpressionSyntax) As ImmutableArray(Of ISymbol) 200Return ImmutableArray(Of ISymbol).Empty 221Dim container As ISymbol = leftHandTypeInfo.Type 243Return ImmutableArray(Of ISymbol).Empty 283Return ImmutableArray(Of ISymbol).Empty 291Return ImmutableArray(Of ISymbol).Empty 306Return ImmutableArray(Of ISymbol).Empty 310Dim symbols As ImmutableArray(Of ISymbol) 362Private Function FilterEventsAndGeneratedSymbols(node As MemberAccessExpressionSyntax, s As ISymbol) As Boolean 390Private Function FilterToValidAccessibleSymbols(symbols As ImmutableArray(Of ISymbol)) As ImmutableArray(Of ISymbol) 399Dim typeOrAssemblySymbol As ISymbol = _context.SemanticModel.GetDeclaredSymbol(typeBlock, _cancellationToken) 419Return ImmutableArray(Of ISymbol).Empty 448Private Function IsValidAccessibleInterfaceOrContainer(symbol As ISymbol, within As ISymbol) As Boolean 469Private Function IsOrContainsValidAccessibleInterface(namespaceOrTypeSymbol As INamespaceOrTypeSymbol, within As ISymbol) As Boolean 489Private Function IsValidAccessibleClassOrContainer(symbol As ISymbol, within As ISymbol) As Boolean 517Private Function IsOrContainsValidAccessibleClass(namespaceOrTypeSymbol As INamespaceOrTypeSymbol, within As ISymbol) As Boolean
Rename\VisualBasicRenameRewriterLanguageService.vb (10)
49Private ReadOnly _renamedSymbol As ISymbol 482Dim symbols As IEnumerable(Of ISymbol) 675newReferencedSymbols As IEnumerable(Of ISymbol)) As Boolean 683renamedSymbol As ISymbol, 684renameSymbol As ISymbol, 685referencedSymbols As IEnumerable(Of ISymbol), 807renameSymbol As ISymbol, renamedSymbol As ISymbol, 908renamedSymbol As ISymbol, 979Public Overrides Sub TryAddPossibleNameConflicts(symbol As ISymbol, replacementText As String, possibleNameConflicts As ICollection(Of String))
Simplification\Simplifiers\AbstractVisualBasicSimplifier.vb (1)
150Private Shared Function ValidateAliasForTarget(aliasReplacement As IAliasSymbol, semanticModel As SemanticModel, node As ExpressionSyntax, symbol As ISymbol) As Boolean
Simplification\Simplifiers\ExpressionSimplifier.vb (2)
273symbol As ISymbol, 299symbol As ISymbol,
Simplification\VisualBasicSimplificationService.Expander.vb (2)
684symbol As ISymbol) As ExpressionSyntax 705symbol As ISymbol,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (1)
450Private Function CanReplace(symbol As ISymbol) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\InvocationExpressionSyntaxExtensions.vb (1)
49Dim symbol As ISymbol = semanticModel.GetSymbolInfo(invocationExpression.Expression).Symbol
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (3)
32cancellationToken As CancellationToken) As IList(Of ISymbol) 38Return SpecializedCollections.EmptyList(Of ISymbol)() 45cancellationToken As CancellationToken) As IList(Of ISymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SemanticFacts\VisualBasicSemanticFacts.vb (10)
65Public Function GetDeclaredSymbol(semanticModel As SemanticModel, token As SyntaxToken, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.GetDeclaredSymbol 224Public Function GetDeclaredSymbols(semanticModel As SemanticModel, memberDeclaration As SyntaxNode, cancellationToken As CancellationToken) As IEnumerable(Of ISymbol) Implements ISemanticFacts.GetDeclaredSymbols 242Public Function FindFieldOrPropertyForArgument(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.FindFieldOrPropertyForArgument 257Public Function FindFieldOrPropertyForAttributeArgument(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.FindFieldOrPropertyForAttributeArgument 261Public Function GetBestOrAllSymbols(semanticModel As SemanticModel, node As SyntaxNode, token As SyntaxToken, cancellationToken As CancellationToken) As ImmutableArray(Of ISymbol) Implements ISemanticFacts.GetBestOrAllSymbols 263Return ImmutableArray(Of ISymbol).Empty 268ImmutableArray.Create(Of ISymbol)(preprocessingSymbol), 276Public Function GetLocalFunctionSymbols(compilation As Compilation, symbol As ISymbol, cancellationToken As CancellationToken) As ImmutableArray(Of IMethodSymbol) Implements ISemanticFacts.GetLocalFunctionSymbols 339Public Function GetInterceptorSymbolAsync(document As Document, position As Integer, cancellationToken As CancellationToken) As Task(Of ISymbol) Implements ISemanticFacts.GetInterceptorSymbolAsync 341Return SpecializedTasks.Null(Of ISymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (1)
62newMembers As IList(Of ISymbol),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamespaceGenerator.vb (2)
60newMembers As IList(Of ISymbol), 106Private Function GenerateImportsStatement(import As ISymbol) As ImportsStatementSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationHelpers.vb (3)
67Public Function GenerateImplementsClause(explicitInterfaceOpt As ISymbol) As ImplementsClauseSyntax 178symbol As ISymbol, 198Public Function GetReuseableSyntaxNodeForSymbol(Of T As SyntaxNode)(symbol As ISymbol, options As CodeGenerationContextInfo) As T
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (1)
758Public Overrides Function UpdateDeclarationMembers(Of TDeclarationNode As SyntaxNode)(declaration As TDeclarationNode, newMembers As IList(Of ISymbol), options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxGeneratorVisitor.vb (3)
22Public Overrides Function DefaultVisit(symbol As ISymbol) As ExpressionSyntax 26Private Shared Function AddInformationTo(Of TExpressionSyntax As ExpressionSyntax)(expression As TExpressionSyntax, symbol As ISymbol) As TExpressionSyntax 74Private Shared Function CreateMemberAccessExpression(symbol As ISymbol, container As ExpressionSyntax, simpleName As SimpleNameSyntax) As ExpressionSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\StringExtensions.vb (2)
34Public Function EscapeIdentifier(text As String, Optional afterDot As Boolean = False, Optional symbol As ISymbol = Nothing, Optional withinAsyncMethod As Boolean = False) As String 61Public Function ToIdentifierToken(text As String, Optional afterDot As Boolean = False, Optional symbol As ISymbol = Nothing, Optional withinAsyncMethod As Boolean = False) As SyntaxToken
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SymbolExtensions.vb (2)
11Public Function IsMyNamespace(symbol As ISymbol, compilation As Compilation) As Boolean 23Public Function IsMyFormsProperty(symbol As ISymbol, compilation As Compilation) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (2)
27Public Overrides Function DefaultVisit(node As ISymbol) As TypeSyntax 31Private Shared Function AddInformationTo(Of TTypeSyntax As TypeSyntax)(type As TTypeSyntax, symbol As ISymbol) As TTypeSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\InitializeParameter\VisualBasicInitializeParameterService.vb (2)
48Protected Overrides Function TryUpdateTupleAssignment(blockStatement As IBlockOperation, parameter As IParameterSymbol, fieldOrProperty As ISymbol, editor As SyntaxEditor) As Boolean 53Protected Overrides Function TryAddAssignmentForPrimaryConstructorAsync(document As Document, parameter As IParameterSymbol, fieldOrProperty As ISymbol, cancellationToken As CancellationToken) As Task(Of Solution)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSemanticFactsService.vb (1)
126Private Function ISemanticFactsService_GenerateUniqueName(semanticModel As SemanticModel, location As SyntaxNode, containerOpt As SyntaxNode, baseName As String, filter As Func(Of ISymbol, Boolean), usedNames As IEnumerable(Of String), cancellationToken As CancellationToken) As SyntaxToken Implements ISemanticFactsService.GenerateUniqueName
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSymbolDeclarationService.vb (1)
26Public Function GetDeclarations(symbol As ISymbol) As ImmutableArray(Of SyntaxReference) Implements ISymbolDeclarationService.GetDeclarations
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (2)
366Private Shared Function InferTypeInArgument(argument As ArgumentSyntax, index As Integer, symbols As IEnumerable(Of ISymbol)) As IEnumerable(Of TypeInferenceInfo) 782Private Function GetDeclaredMemberSymbolFromOriginalSemanticModel(currentSemanticModel As SemanticModel, declarationInCurrentTree As DeclarationStatementSyntax) As ISymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\SymbolExtensions.vb (2)
10Public Function FindRelatedExplicitlyDeclaredSymbol(symbol As ISymbol, compilation As Compilation) As ISymbol
Microsoft.CodeAnalysis.Workspaces (1199)
Classification\SyntaxClassification\AbstractNameSyntaxClassifier.cs (4)
15protected ISymbol? TryGetSymbol(SyntaxNode node, SymbolInfo symbolInfo) 17var symbol = symbolInfo.GetAnySymbol(); 30ISymbol symbol, 38protected static bool IsStaticSymbol(ISymbol symbol)
Editing\DeclarationModifiers.cs (1)
63public static DeclarationModifiers From(ISymbol symbol)
Editing\SymbolEditor.cs (39)
96public async Task<ISymbol> GetCurrentSymbolAsync(ISymbol symbol, CancellationToken cancellationToken = default) 119var currentSymbol = await GetSymbolAsync(ChangedSolution, projectId, symbolId, cancellationToken).ConfigureAwait(false); 145private static async Task<ISymbol> GetSymbolAsync(Solution solution, ProjectId projectId, string symbolId, CancellationToken cancellationToken) 183public async Task<IReadOnlyList<SyntaxNode>> GetCurrentDeclarationsAsync(ISymbol symbol, CancellationToken cancellationToken = default) 185var currentSymbol = await this.GetCurrentSymbolAsync(symbol, cancellationToken).ConfigureAwait(false); 192private IEnumerable<SyntaxNode> GetDeclarations(ISymbol symbol) 203private bool TryGetBestDeclarationForSingleEdit(ISymbol symbol, out SyntaxNode declaration) 232public async Task<ISymbol> EditOneDeclarationAsync( 233ISymbol symbol, 237var currentSymbol = await this.GetCurrentSymbolAsync(symbol, cancellationToken).ConfigureAwait(false); 256public Task<ISymbol> EditOneDeclarationAsync( 257ISymbol symbol, 271private static void CheckSymbolArgument(ISymbol currentSymbol, ISymbol argSymbol) 279private async Task<ISymbol> EditDeclarationAsync( 280ISymbol currentSymbol, 299var newSymbol = model.GetDeclaredSymbol(newDeclaration, cancellationToken); 319public Task<ISymbol> EditOneDeclarationAsync( 320ISymbol symbol, 345public Task<ISymbol> EditOneDeclarationAsync( 346ISymbol symbol, 362private async Task<ISymbol> EditOneDeclarationAsync( 363ISymbol symbol, 369var currentSymbol = await this.GetCurrentSymbolAsync(symbol, cancellationToken).ConfigureAwait(false); 395public async Task<ISymbol> EditOneDeclarationAsync( 396ISymbol symbol, 397ISymbol member, 401var currentSymbol = await this.GetCurrentSymbolAsync(symbol, cancellationToken).ConfigureAwait(false); 404var currentMember = await this.GetCurrentSymbolAsync(member, cancellationToken).ConfigureAwait(false); 428public Task<ISymbol> EditOneDeclarationAsync( 429ISymbol symbol, 430ISymbol member, 453public async Task<ISymbol> EditAllDeclarationsAsync( 454ISymbol symbol, 458var currentSymbol = await this.GetCurrentSymbolAsync(symbol, cancellationToken).ConfigureAwait(false); 490var newSymbol = model.GetDeclaredSymbol(newDeclaration, cancellationToken); 511public Task<ISymbol> EditAllDeclarationsAsync( 512ISymbol symbol,
Editing\SymbolEditorExtensions.cs (3)
21ISymbol symbol, 57public static async Task<ISymbol> SetBaseTypeAsync( 93public static Task<ISymbol> SetBaseTypeAsync(
Editing\SyntaxGenerator.cs (7)
235ImmutableArray<ISymbol>.CastUp(method.ExplicitInterfaceImplementations)); 401ImmutableArray<ISymbol>.CastUp(property.ExplicitInterfaceImplementations)); 462ImmutableArray<ISymbol>.CastUp(indexer.ExplicitInterfaceImplementations)); 501ImmutableArray<ISymbol>.CastUp(symbol.ExplicitInterfaceImplementations)); 717public SyntaxNode Declaration(ISymbol symbol) 811private static bool CanBeDeclared(ISymbol symbol) 887SyntaxNode declaration, ImmutableArray<ISymbol> explicitInterfaceImplementations, bool removeDefaults = true);
ExternalAccess\Pythia\Api\PythiaSemanticModelExtensions.cs (1)
12public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\Api\UnitTestingSymbolExtensions.cs (1)
11public static string GetSymbolKeyString(this ISymbol symbol, CancellationToken cancellationToken)
FindSymbols\Declarations\DeclarationFinder.cs (6)
22ArrayBuilder<ISymbol> list, 73ArrayBuilder<ISymbol> list, 92internal static ImmutableArray<ISymbol> FilterByCriteria(ImmutableArray<ISymbol> symbols, SymbolFilter criteria) 95private static bool MeetCriteria(ISymbol symbol, SymbolFilter filter) 118private static bool IsNonTypeMember(ISymbol symbol)
FindSymbols\Declarations\DeclarationFinder_AllDeclarations.cs (10)
23public static async Task<ImmutableArray<ISymbol>> FindAllDeclarationsWithNormalQueryAsync( 59internal static async Task<ImmutableArray<ISymbol>> FindAllDeclarationsWithNormalQueryInCurrentProcessAsync( 62using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 82using var _ = ArrayBuilder<ISymbol>.GetInstance(out var buffer); 97using var _ = ArrayBuilder<ISymbol>.GetInstance(out var buffer); 117using var _ = ArrayBuilder<ISymbol>.GetInstance(out var buffer); 136async Task AddAllAsync(ArrayBuilder<ISymbol> buffer, bool mapSymbol) 145foreach (var symbol in buffer) 158private static async Task<ImmutableArray<ISymbol>> RehydrateAsync( 161var result = ArrayBuilder<ISymbol>.GetInstance(array.Count);
FindSymbols\Declarations\DeclarationFinder_SourceDeclarations.cs (14)
25public static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithNormalQueryAsync( 63public static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithNormalQueryAsync( 101public static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithPatternAsync( 134public static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithPatternAsync( 175internal static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithNormalQueryInCurrentProcessAsync( 180using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 190internal static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithNormalQueryInCurrentProcessAsync( 193using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 202private static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithPatternInCurrentProcessAsync( 203string pattern, Func<SearchQuery, Task<ImmutableArray<ISymbol>>> searchAsync) 237internal static Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithPatternInCurrentProcessAsync( 245internal static Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithPatternInCurrentProcessAsync( 253private static string? GetContainer(ISymbol symbol) 255var container = symbol.ContainingSymbol;
FindSymbols\FindReferences\BaseTypeFinder.cs (4)
17public static ImmutableArray<ISymbol> FindOverriddenAndImplementedMembers( 18ISymbol symbol, Solution solution, CancellationToken cancellationToken) 20using var _ = ArrayBuilder<ISymbol>.GetInstance(out var results); 41foreach (var member in type.GetMembers(symbol.Name))
FindSymbols\FindReferences\DependentProjectsFinder.cs (4)
41Solution solution, ImmutableArray<ISymbol> symbols, IImmutableSet<Project> projects, CancellationToken cancellationToken) 74Solution solution, ImmutableArray<ISymbol> symbols, CancellationToken cancellationToken) 105Solution solution, ImmutableArray<ISymbol> symbols, CancellationToken cancellationToken) 109foreach (var symbol in symbols)
FindSymbols\FindReferences\Finders\AbstractMemberScopedReferenceFinder.cs (6)
19where TSymbol : ISymbol 60var container = GetContainer(symbol); 72private static ISymbol? GetContainer(ISymbol symbol) 74for (var current = symbol; current != null; current = current.ContainingSymbol) 102ISymbol container,
FindSymbols\FindReferences\Finders\AbstractMethodOrPropertyOrEventSymbolReferenceFinder.cs (1)
13where TSymbol : ISymbol
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (33)
28ISymbol symbol, Project project, CancellationToken cancellationToken); 30public abstract ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 31ISymbol symbol, Solution solution, FindReferencesSearchOptions options, CancellationToken cancellationToken); 34ISymbol symbol, HashSet<string>? globalAliases, Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, FindReferencesSearchOptions options, CancellationToken cancellationToken); 37ISymbol symbol, FindReferencesDocumentState state, Action<FinderLocation, TData> processResult, TData processResultData, FindReferencesSearchOptions options, CancellationToken cancellationToken); 40ISymbol symbol, FindReferencesDocumentState state, SyntaxToken token, CancellationToken cancellationToken) 54ISymbol searchSymbol, FindReferencesDocumentState state, SyntaxNode node, CancellationToken cancellationToken) 61ISymbol searchSymbol, FindReferencesDocumentState state, SymbolInfo symbolInfo) 66foreach (var candidate in symbolInfo.CandidateSymbols) 165ISymbol symbol, 180ISymbol symbol, 244ISymbol symbol, 284ISymbol symbol, 393ISymbol symbol, 429ISymbol symbol, 472ISymbol symbol, 510ISymbol symbol, 541ISymbol symbol, 560var constructor = state.SemanticModel.GetSymbolInfo(node, cancellationToken).Symbol; 575protected static bool Matches(SymbolInfo info, ISymbol notNullOriginalUnreducedSymbol2) 580foreach (var symbol in info.CandidateSymbols) 589protected static bool Matches(ISymbol? symbol1, ISymbol notNullOriginalUnreducedSymbol2) 772var symbol = semanticModel.GetDeclaredSymbol(node); 779internal static ImmutableArray<(string key, string value)> GetAdditionalFindUsagesProperties(ISymbol definition) 789var containingSymbol = definition.ContainingSymbol; 798where TSymbol : ISymbol 819ISymbol symbol, Project project, CancellationToken cancellationToken) 827ISymbol symbol, HashSet<string>? globalAliases, Project project, 838ISymbol symbol, FindReferencesDocumentState state, Action<FinderLocation, TData> processResult, TData processResultData, FindReferencesSearchOptions options, CancellationToken cancellationToken) 844public sealed override ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 845ISymbol symbol, Solution solution, FindReferencesSearchOptions options, CancellationToken cancellationToken) 857protected virtual ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync(
FindSymbols\FindReferences\Finders\AbstractReferenceFinder_GlobalSuppressions.cs (3)
18private static bool ShouldFindReferencesInGlobalSuppressions(ISymbol symbol, [NotNullWhen(returnValue: true)] out string? documentationCommentId) 31static bool SupportsGlobalSuppression(ISymbol symbol) 53ISymbol symbol,
FindSymbols\FindReferences\Finders\AbstractTypeParameterSymbolReferenceFinder.cs (1)
62var boundSymbol = state.SemanticModel.GetSymbolInfo(token.Parent, cancellationToken).Symbol;
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (4)
27protected override ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync(IMethodSymbol symbol, Solution solution, FindReferencesSearchOptions options, CancellationToken cancellationToken) 37private static ImmutableArray<ISymbol> GetOtherPartsOfPartial(IMethodSymbol symbol) 270var constructor = state.SemanticModel.GetSymbolInfo(node, cancellationToken).Symbol; 311var constructor = state.SemanticModel.GetSymbolInfo(node, cancellationToken).Symbol;
FindSymbols\FindReferences\Finders\EventSymbolReferenceFinder.cs (4)
20protected sealed override ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 29.ToImmutableArray<ISymbol>(); 33.CastArray<ISymbol>(); 38private static ImmutableArray<ISymbol> GetOtherPartsOfPartial(IEventSymbol symbol)
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.UnderlyingNamedTypeVisitor.cs (1)
37public override INamedTypeSymbol? DefaultVisit(ISymbol symbol)
FindSymbols\FindReferences\Finders\FieldSymbolReferenceFinder.cs (2)
18protected override ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 26: new(ImmutableArray<ISymbol>.Empty);
FindSymbols\FindReferences\Finders\ILanguageServiceReferenceFinder.cs (2)
19Task<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 20ISymbol symbol, Project project, CancellationToken cancellationToken);
FindSymbols\FindReferences\Finders\IReferenceFinder.cs (5)
28ISymbol symbol, Project project, CancellationToken cancellationToken); 38ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 39ISymbol symbol, Solution solution, FindReferencesSearchOptions options, CancellationToken cancellationToken); 54ISymbol symbol, HashSet<string>? globalAliases, 67ISymbol symbol,
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (1)
19protected override ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync(
FindSymbols\FindReferences\Finders\NamedTypeSymbolReferenceFinder.cs (5)
27protected override ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 33using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 47private static void Add<TSymbol>(ArrayBuilder<ISymbol> result, ImmutableArray<TSymbol> enumerable) where TSymbol : ISymbol 49result.AddRange(enumerable.Cast<ISymbol>());
FindSymbols\FindReferences\Finders\OrdinaryMethodReferenceFinder.cs (3)
22protected override ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 31? new(ImmutableArray.Create<ISymbol>(symbol.ContainingType)) 35private static ImmutableArray<ISymbol> GetOtherPartsOfPartial(IMethodSymbol symbol)
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (13)
53protected override async ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 62using var _ = ArrayBuilder<ISymbol>.GetInstance(out var symbols); 74private static void CascadeBetweenAnonymousDelegateParameters(IParameterSymbol parameter, ArrayBuilder<ISymbol> symbols) 84IParameterSymbol parameter, ArrayBuilder<ISymbol> symbols, CancellationToken cancellationToken) 92ArrayBuilder<ISymbol> results, 134ArrayBuilder<ISymbol> results, 142var symbol = semanticModel.GetDeclaredSymbol(token.GetRequiredParent(), cancellationToken); 173var declaredSymbol = semanticModel.GetDeclaredSymbol(current); 184ArrayBuilder<ISymbol> results) 187var containingSymbol = parameter.ContainingSymbol; 205ArrayBuilder<ISymbol> results) 232ArrayBuilder<ISymbol> results, 242ArrayBuilder<ISymbol> results)
FindSymbols\FindReferences\Finders\PropertyAccessorSymbolReferenceFinder.cs (2)
19protected override ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 28? new(ImmutableArray<ISymbol>.Empty)
FindSymbols\FindReferences\Finders\PropertySymbolReferenceFinder.cs (7)
30protected override ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 36using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 46private static void CascadeToOtherPartOfPartial(IPropertySymbol symbol, ArrayBuilder<ISymbol> result) 52private static void CascadeToBackingFields(IPropertySymbol symbol, ArrayBuilder<ISymbol> result) 54foreach (var member in symbol.ContainingType.GetMembers()) 64private static void CascadeToAccessors(IPropertySymbol symbol, ArrayBuilder<ISymbol> result) 70private static void CascadeToPrimaryConstructorParameters(IPropertySymbol property, ArrayBuilder<ISymbol> result, CancellationToken cancellationToken)
FindSymbols\FindReferences\FindReferencesProgress.cs (2)
31public void OnDefinitionFound(ISymbol symbol) 35public void OnReferenceFound(ISymbol symbol, ReferenceLocation location)
FindSymbols\FindReferences\FindReferencesSearchEngine.BidirectionalSymbolSet.cs (3)
44public override ImmutableArray<ISymbol> GetAllSymbols() 50using var _ = ArrayBuilder<ISymbol>.GetInstance(out var workQueue); 55while (workQueue.TryPop(out var current))
FindSymbols\FindReferences\FindReferencesSearchEngine.cs (25)
35private static readonly ObjectPool<Dictionary<ISymbol, SymbolGroup>> s_symbolToGroupPool = new(() => new(MetadataUnifyingEquivalenceComparer.Instance)); 59public Task FindReferencesAsync(ISymbol symbol, CancellationToken cancellationToken) 63ImmutableArray<ISymbol> symbols, CancellationToken cancellationToken) 82ImmutableArray<ISymbol> symbols, Action<Reference> onReferenceFound, CancellationToken cancellationToken) 125private async IAsyncEnumerable<(Project project, ImmutableArray<(ISymbol symbol, SymbolGroup group)> allSymbols)> GetProjectsAndSymbolsToSearchSeriallyAsync( 128Dictionary<ISymbol, SymbolGroup> symbolToGroup, 163private async Task<ImmutableArray<(ISymbol symbol, SymbolGroup group)>> ReportGroupsSeriallyAsync( 164ImmutableArray<ISymbol> symbols, Dictionary<ISymbol, SymbolGroup> symbolToGroup, CancellationToken cancellationToken) 166var result = new FixedSizeArrayBuilder<(ISymbol symbol, SymbolGroup group)>(symbols.Length); 169foreach (var symbol in symbols) 176ISymbol symbol, Dictionary<ISymbol, SymbolGroup> symbolToGroup, CancellationToken cancellationToken) 192foreach (var groupSymbol in group.Symbols) 206ImmutableArray<ISymbol> symbols, CancellationToken cancellationToken) 216Project project, ImmutableArray<(ISymbol symbol, SymbolGroup group)> allSymbols, Action<Reference> onReferenceFound, CancellationToken cancellationToken) 218using var _1 = PooledDictionary<ISymbol, PooledHashSet<string>>.GetInstance(out var symbolToGlobalAliases); 219using var _2 = PooledDictionary<Document, Dictionary<ISymbol, SymbolGroup>>.GetInstance(out var documentToSymbolsWithin); 274Dictionary<ISymbol, SymbolGroup> symbolsToSearchFor, 275Dictionary<ISymbol, PooledHashSet<string>> symbolToGlobalAliases, 319ISymbol symbolToSearchFor, SymbolGroup symbolGroup, FindReferencesDocumentState state, Action<Reference> onReferenceFound) 343ImmutableArray<(ISymbol symbol, SymbolGroup group)> allSymbols, 344PooledDictionary<ISymbol, PooledHashSet<string>> symbolToGlobalAliases, 362private static void FreeGlobalAliases(PooledDictionary<ISymbol, PooledHashSet<string>> symbolToGlobalAliases) 368private static bool InvolvesInheritance(ISymbol symbol)
FindSymbols\FindReferences\FindReferencesSearchEngine.NonCascadingSymbolSet.cs (2)
19private readonly ImmutableArray<ISymbol> _symbols = [.. searchSymbols]; 21public override ImmutableArray<ISymbol> GetAllSymbols()
FindSymbols\FindReferences\FindReferencesSearchEngine.SymbolSet.cs (25)
43public abstract ImmutableArray<ISymbol> GetAllSymbols(); 96foreach (var symbol in symbols) 102private static ISymbol? TryMapToAppropriateSymbol( 103Solution solution, ISymbol symbol, CancellationToken cancellationToken) 108var searchSymbol = symbol; 135var sourceSymbol = SymbolFinder.FindSourceDefinition(searchSymbol, solution, cancellationToken); 150using var _ = ArrayBuilder<ISymbol>.GetInstance(out var workQueue); 153foreach (var symbol in symbols) 157while (workQueue.TryPop(out var currentSymbol)) 170using var _ = ArrayBuilder<ISymbol>.GetInstance(out var workQueue); 175while (workQueue.TryPop(out var currentSymbol)) 185FindReferencesSearchEngine engine, ImmutableArray<ISymbol> symbols, MetadataUnifyingSymbolHashSet seenSymbols, ArrayBuilder<ISymbol> workQueue, CancellationToken cancellationToken) 187foreach (var symbol in symbols) 192FindReferencesSearchEngine engine, ISymbol symbol, MetadataUnifyingSymbolHashSet seenSymbols, ArrayBuilder<ISymbol> workQueue, CancellationToken cancellationToken) 195var mapped = await TryMapAndAddLinkedSymbolsAsync(symbol).ConfigureAwait(false); 210async Task<ISymbol?> TryMapAndAddLinkedSymbolsAsync(ISymbol symbol) 212var mapped = TryMapToAppropriateSymbol(solution, symbol, cancellationToken); 237FindReferencesSearchEngine engine, ISymbol symbol, 238MetadataUnifyingSymbolHashSet seenSymbols, ArrayBuilder<ISymbol> workQueue, 271ISymbol symbol, 273ArrayBuilder<ISymbol> workQueue, 294if (symbol.GetOverriddenMember() is ISymbol overriddenMember)
FindSymbols\FindReferences\FindReferencesSearchEngine.UnidirectionalSymbolSet.cs (4)
35private readonly ImmutableHashSet<ISymbol> _upSymbols = upSymbols.ToImmutableHashSet(MetadataUnifyingEquivalenceComparer.Instance); 37public override ImmutableArray<ISymbol> GetAllSymbols() 48using var _ = ArrayBuilder<ISymbol>.GetInstance(out var workQueue); 54while (workQueue.TryPop(out var current))
FindSymbols\FindReferences\FindReferencesSearchEngine_FindReferencesInDocuments.cs (15)
22ISymbol originalSymbol, IImmutableSet<Document> documents, CancellationToken cancellationToken) 47var hasInheritanceRelationshipCache = new Dictionary<(ISymbol searchSymbol, ISymbol candidateSymbol), bool>(); 75async ValueTask PerformSearchInProjectSeriallyAsync(ImmutableArray<(ISymbol symbol, SymbolGroup group)> symbols, Project project) 77using var _ = PooledDictionary<ISymbol, PooledHashSet<string>>.GetInstance(out var symbolToGlobalAliases); 100ImmutableArray<(ISymbol symbol, SymbolGroup group)> symbols, 102PooledDictionary<ISymbol, PooledHashSet<string>> symbolToGlobalAliases) 121ISymbol symbol, SymbolGroup group, FindReferencesDocumentState state) 133async ValueTask DirectSymbolSearchAsync(ISymbol symbol, SymbolGroup group, FindReferencesDocumentState state) 164static async Task<ImmutableArray<(SymbolGroup group, ISymbol symbol, ReferenceLocation location)>> ConvertLocationsAsync( 165FindReferencesSearchEngine @this, IAsyncEnumerable<FinderLocation> locations, ISymbol symbol, SymbolGroup group, CancellationToken cancellationToken) 167using var _ = ArrayBuilder<(SymbolGroup group, ISymbol symbol, ReferenceLocation location)>.GetInstance(out var result); 176async ValueTask InheritanceSymbolSearchSeriallyAsync(ISymbol symbol, FindReferencesDocumentState state) 245foreach (var symbolUp in searchSymbolUpSet.GetAllSymbols()) 255foreach (var candidateUp in candidateSymbolUpSet.GetAllSymbols())
FindSymbols\FindReferences\FindReferencesSearchOptions.cs (1)
83public static FindReferencesSearchOptions GetFeatureOptionsForStartingSymbol(ISymbol symbol)
FindSymbols\FindReferences\MetadataUnifyingEquivalenceComparer.cs (6)
11internal sealed class MetadataUnifyingEquivalenceComparer : IEqualityComparer<ISymbol> 13public static readonly IEqualityComparer<ISymbol> Instance = new MetadataUnifyingEquivalenceComparer(); 19public bool Equals(ISymbol? x, ISymbol? y) 38public int GetHashCode(ISymbol obj) 50private static bool IsInSource(ISymbol symbol)
FindSymbols\FindReferences\MetadataUnifyingSymbolHashSet.cs (1)
11internal sealed class MetadataUnifyingSymbolHashSet : HashSet<ISymbol>, IPooled
FindSymbols\FindReferences\NoOpStreamingFindReferencesProgress.cs (1)
30public ValueTask OnReferencesFoundAsync(ImmutableArray<(SymbolGroup group, ISymbol symbol, ReferenceLocation location)> references, CancellationToken cancellationToken) => default;
FindSymbols\FindReferences\StreamingFindReferencesProgress.cs (2)
45foreach (var symbol in group.Symbols) 56public ValueTask OnReferencesFoundAsync(ImmutableArray<(SymbolGroup group, ISymbol symbol, ReferenceLocation location)> references, CancellationToken cancellationToken)
FindSymbols\IFindReferencesProgress.cs (2)
19void OnDefinitionFound(ISymbol symbol); 20void OnReferenceFound(ISymbol symbol, ReferenceLocation location);
FindSymbols\IStreamingFindReferencesProgress.cs (5)
18/// Represents a group of <see cref="ISymbol"/>s that should be treated as a single entity for 29public ImmutableHashSet<ISymbol> Symbols { get; } 33public SymbolGroup(ImmutableArray<ISymbol> symbols) 55foreach (var symbol in Symbols) 76ValueTask OnReferencesFoundAsync(ImmutableArray<(SymbolGroup group, ISymbol symbol, ReferenceLocation location)> references, CancellationToken cancellationToken);
FindSymbols\ReferencedSymbol.cs (2)
27public ISymbol Definition { get; } 40ISymbol definition,
FindSymbols\ReferenceLocationExtensions.cs (7)
16public static async Task<Dictionary<ISymbol, List<Location>>> FindReferencingSymbolsAsync( 22var result = new Dictionary<ISymbol, List<Location>>(); 51Dictionary<ISymbol, List<Location>> result) 55var containingSymbol = GetEnclosingMethodOrPropertyOrField(semanticModel, reference); 69private static ISymbol? GetEnclosingMethodOrPropertyOrField( 73var enclosingSymbol = semanticModel.GetEnclosingSymbol(reference.Location.SourceSpan.Start); 75for (var current = enclosingSymbol; current != null; current = current.ContainingSymbol)
FindSymbols\StreamingProgressCollector.cs (4)
17/// Collects all the <see cref="ISymbol"/> definitions and <see cref="ReferenceLocation"/> 27private readonly Dictionary<ISymbol, List<ReferenceLocation>> _symbolToLocations = []; 57foreach (var definition in group.Symbols) 70ImmutableArray<(SymbolGroup group, ISymbol symbol, ReferenceLocation location)> references, CancellationToken cancellationToken)
FindSymbols\SymbolCallerInfo.cs (4)
23public ISymbol CallingSymbol { get; } 33public ISymbol CalledSymbol { get; } 44ISymbol callingSymbol, 45ISymbol calledSymbol,
FindSymbols\SymbolFinder.cs (17)
26public static ISymbol FindSymbolAtPosition( 42public static Task<ISymbol> FindSymbolAtPositionAsync( 60internal static Task<ISymbol> FindSymbolAtPositionAsync( 76internal static async Task<ISymbol> FindSymbolAtPositionAsync( 123public static async Task<ISymbol> FindSymbolAtPositionAsync( 139public static Task<ISymbol?> FindSourceDefinitionAsync(ISymbol? symbol, Solution solution, CancellationToken cancellationToken = default) 142internal static ISymbol? FindSourceDefinition(ISymbol? symbol, Solution solution, CancellationToken cancellationToken) 158where TSymbol : ISymbol 183/// In order to be returned the other symbols must have the same <see cref="ISymbol.Name"/> and <see 184/// cref="ISymbol.Kind"/> as <paramref name="symbol"/>. This matches general user intuition that these are all 185/// the 'same' symbol, and should be examined, regardless of the project context and <see cref="ISymbol"/> they 188internal static async Task<ImmutableArray<ISymbol>> FindLinkedSymbolsAsync( 189ISymbol symbol, Solution solution, CancellationToken cancellationToken) 192var linkedSymbols = new HashSet<ISymbol> { symbol }; 222var linkedSymbol = semanticModel.GetDeclaredSymbol(linkedNode, cancellationToken);
FindSymbols\SymbolFinder.FindReferencesServerCallback.cs (4)
26private readonly Dictionary<SerializableSymbolAndProjectId, ISymbol> _definitionMap = []; 44using var _ = PooledDictionary<SerializableSymbolAndProjectId, ISymbol>.GetInstance(out var map); 70using var _ = ArrayBuilder<(SymbolGroup group, ISymbol symbol, ReferenceLocation location)>.GetInstance(references.Length, out var rehydrated); 75ISymbol? symbol;
FindSymbols\SymbolFinder_Callers.cs (4)
24ISymbol symbol, Solution solution, CancellationToken cancellationToken = default) 33ISymbol symbol, Solution solution, IImmutableSet<Document>? documents, CancellationToken cancellationToken = default) 41var foundSymbol = FindSourceDefinition(symbol, solution, cancellationToken); 77ISymbol symbol,
FindSymbols\SymbolFinder_Declarations_AllDeclarations.cs (2)
16public static async Task<IEnumerable<ISymbol>> FindDeclarationsAsync( 28public static async Task<IEnumerable<ISymbol>> FindDeclarationsAsync(
FindSymbols\SymbolFinder_Declarations_CustomQueries.cs (7)
28public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Solution solution, Func<string, bool> predicate, CancellationToken cancellationToken = default) 34public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Solution solution, Func<string, bool> predicate, SymbolFilter filter, CancellationToken cancellationToken = default) 43internal static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithCustomQueryAsync( 58using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 73public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Project project, Func<string, bool> predicate, CancellationToken cancellationToken = default) 79public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Project project, Func<string, bool> predicate, SymbolFilter filter, CancellationToken cancellationToken = default) 88internal static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithCustomQueryAsync(
FindSymbols\SymbolFinder_Declarations_SourceDeclarations.cs (8)
20public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Solution solution, string name, bool ignoreCase, CancellationToken cancellationToken = default) 26public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync( 40public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Project project, string name, bool ignoreCase, CancellationToken cancellationToken = default) 46public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync( 67public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsWithPatternAsync(Solution solution, string pattern, CancellationToken cancellationToken = default) 77public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsWithPatternAsync( 95public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsWithPatternAsync(Project project, string pattern, CancellationToken cancellationToken = default) 105public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsWithPatternAsync(
FindSymbols\SymbolFinder_FindReferences_Current.cs (3)
22ISymbol symbol, 71ISymbol symbol, 86ISymbol symbol,
FindSymbols\SymbolFinder_FindReferences_Legacy.cs (5)
26ISymbol symbol, 39ISymbol symbol, 59ISymbol symbol, 81ISymbol symbol, 97ISymbol symbol,
FindSymbols\SymbolFinder_FindRenamableReferences.cs (1)
16ImmutableArray<ISymbol> symbols,
FindSymbols\SymbolFinder_Helpers.cs (5)
16private static bool IsAccessible(ISymbol symbol) 31ISymbol? searchSymbol, 32ISymbol? symbolToMatch) 70Solution solution, ISymbol searchSymbol, ISymbol symbolToMatch)
FindSymbols\SymbolFinder_Hierarchy.cs (31)
26public static async Task<IEnumerable<ISymbol>> FindOverridesAsync( 27ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 36internal static async Task<ImmutableArray<ISymbol>> FindOverridesArrayAsync( 37ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 44using var _ = ArrayBuilder<ISymbol>.GetInstance(out var results); 64foreach (var m in type.GetMembers(symbol.Name)) 66var sourceMember = FindSourceDefinition(m, solution, cancellationToken); 67var bestMember = sourceMember ?? m; 76internal static bool IsOverride(Solution solution, ISymbol member, ISymbol symbol, bool allowLooseMatch) 78for (var current = member; 92public static async Task<IEnumerable<ISymbol>> FindImplementedInterfaceMembersAsync( 93ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 101internal static Task<ImmutableArray<ISymbol>> FindImplementedInterfaceMembersArrayAsync( 102ISymbol symbol, Solution solution, CancellationToken cancellationToken) 113internal static async Task<ImmutableArray<ISymbol>> FindImplementedInterfaceMembersArrayAsync( 114ISymbol symbol, 149using var _ = ArrayBuilder<ISymbol>.GetInstance(out var builder); 169var sourceMethod = FindSourceDefinition(interfaceMember, solution, cancellationToken); 173foreach (var implementation in implementations) 203/// "derived", but can be found with <see cref="FindImplementationsAsync(ISymbol, Solution, 220/// "derived", but can be found with <see cref="FindImplementationsAsync(ISymbol, Solution, 331public static async Task<IEnumerable<ISymbol>> FindImplementationsAsync( 332ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 351/// <inheritdoc cref="FindImplementationsAsync(ISymbol, Solution, IImmutableSet{Project}, CancellationToken)"/> 355internal static async Task<ImmutableArray<ISymbol>> FindMemberImplementationsArrayAsync( 356ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 370using var _ = ArrayBuilder<ISymbol>.GetInstance(out var results); 374foreach (var implementation in implementations) 376var sourceDef = FindSourceDefinition(implementation, solution, cancellationToken); 377var bestDef = sourceDef ?? implementation;
FindSymbols\SymbolTree\SymbolTreeInfo.cs (13)
22/// produce a corresponding <see cref="ISymbol"/> that can be used by a feature. The primary purpose of this index 118public Task<ImmutableArray<ISymbol>> FindAsync( 129public async Task<ImmutableArray<ISymbol>> FindAsync( 142private Task<ImmutableArray<ISymbol>> FindCoreAsync( 167private async Task<ImmutableArray<ISymbol>> FuzzyFindAsync( 171using var result = TemporaryArray<ISymbol>.Empty; 213private async Task<ImmutableArray<ISymbol>> FindAsync( 219using var results = TemporaryArray<ISymbol>.Empty; 397int index, INamespaceOrTypeSymbol rootContainer, ref TemporaryArray<ISymbol> results, CancellationToken cancellationToken) 414using var containerSymbols = TemporaryArray<ISymbol>.Empty; 416foreach (var containerSymbol in containerSymbols) 504using var tempBuilder = TemporaryArray<ISymbol>.Empty; 511foreach (var symbol in tempBuilder)
FindSymbols\TopLevelSyntaxTree\DeclaredSymbolInfo.cs (1)
221public ISymbol? TryResolve(SemanticModel semanticModel, CancellationToken cancellationToken)
LanguageServices\FixAllSpanMappingService\AbstractFixAllSpanMappingService.cs (1)
45var symbol = semanticModel.GetDeclaredSymbol(decl, cancellationToken);
ObsoleteSymbol\AbstractObsoleteSymbolService.cs (6)
117var symbol = semanticModel.GetDeclaredSymbol(name.GetRequiredParent(), cancellationToken); 135var symbol = semanticModel.GetSymbolInfo(node, cancellationToken).Symbol; 150var symbol = semanticModel.GetSymbolInfo(node, cancellationToken).Symbol; 175var symbol = semanticModel.GetDeclaredSymbol(token.Parent, cancellationToken); 181var symbol = semanticModel.GetSymbolInfo(token, cancellationToken).Symbol; 188protected static bool IsSymbolObsolete([NotNullWhen(true)] ISymbol? symbol)
ReassignedVariable\AbstractReassignedVariableService.cs (9)
48using var _1 = PooledDictionary<ISymbol, bool>.GetInstance(out var symbolToIsReassigned); 129var symbol = semanticModel.GetSymbolInfo(identifier, cancellationToken).Symbol; 155bool IsSymbolReassigned(SemanticModel semanticModel, [NotNullWhen(true)] ISymbol? symbol) 181var methodOrProperty = parameter.ContainingSymbol; 292ISymbol localOrParameter, 326var symbol = semanticModel.GetSymbolInfo(id, cancellationToken).Symbol; 350bool AreEquivalent(ISymbol localOrParameter, ISymbol? symbol) 373bool DefinitelyAssignedOnEntry(DataFlowAnalysis? analysis, ISymbol? localOrParameter)
Recommendations\AbstractRecommendationService.cs (1)
72internal bool ShouldIncludeSymbol(ISymbol symbol)
Recommendations\AbstractRecommendationServiceRunner.cs (17)
49private ImmutableArray<ISymbol> GetMemberSymbolsForParameter(IParameterSymbol parameter, int position, bool useBaseReferenceAccessibility, bool unwrapNullable, bool isForDereference) 57private ImmutableArray<ISymbol> TryGetMemberSymbolsForLambdaParameter( 148foreach (var invocationSymbol in invocationSymbols) 185ImmutableArray<ISymbol> candidateSymbols, 195foreach (var candidateSymbol in candidateSymbols) 270protected ImmutableArray<ISymbol> GetSymbolsForNamespaceDeclarationNameContext<TNamespaceDeclarationSyntax>() 287protected ImmutableArray<ISymbol> GetSymbolsForEnumBaseList(INamespaceOrTypeSymbol container) 295using var _ = ArrayBuilder<ISymbol>.GetInstance(out var builder); 331protected static bool IsNonIntersectingNamespace(ISymbol recommendationSymbol, SyntaxNode declarationSyntax) 356protected ImmutableArray<ISymbol> GetMemberSymbols( 357ISymbol container, 387protected ImmutableArray<ISymbol> LookupSymbolsInContainer( 412using var _ = ArrayBuilder<ISymbol>.GetInstance(containerMembers.Length, out var result); 414foreach (var member in containerMembers) 423var originalMember = member.GetOriginalUnreducedDefinition(); 537protected static ImmutableArray<ISymbol> SuppressDefaultTupleElements(INamespaceOrTypeSymbol container, ImmutableArray<ISymbol> symbols)
Recommendations\IRecommendationService.cs (5)
21ImmutableArray<ISymbol> namedSymbols, 22ImmutableArray<ISymbol> unnamedSymbols = default) 28public ImmutableArray<ISymbol> NamedSymbols => namedSymbols.NullToEmpty(); 33public ImmutableArray<ISymbol> UnnamedSymbols => unnamedSymbols.NullToEmpty(); 35public RecommendedSymbols(ImmutableArray<ISymbol> namedSymbols)
Recommendations\Recommender.cs (3)
19public static IEnumerable<ISymbol> GetRecommendedSymbolsAtPosition( 35public static Task<IEnumerable<ISymbol>> GetRecommendedSymbolsAtPositionAsync( 45public static async Task<ImmutableArray<ISymbol>> GetRecommendedSymbolsAtPositionAsync(
Remote\RemoteArguments.cs (6)
60Solution solution, ISymbol symbol, CancellationToken cancellationToken) 68public static SerializableSymbolAndProjectId Create(ISymbol symbol, Project project, CancellationToken cancellationToken) 72ISymbol symbol, Solution solution, CancellationToken cancellationToken, 86ISymbol symbol, Project project, CancellationToken cancellationToken, 99public async ValueTask<ISymbol?> TryRehydrateAsync( 108var symbol = SymbolKey.ResolveString(
Rename\ConflictEngine\ConflictResolver.cs (18)
52ISymbol symbol, 129private static ImmutableArray<ISymbol> SymbolsForEnclosingInvocationExpressionWorker(SyntaxNode invocationExpression, SemanticModel semanticModel, CancellationToken cancellationToken) 144private static bool LocalVariableConflictPerLanguage(SyntaxToken tokenOrNode, Document document, ImmutableArray<ISymbol> newReferencedSymbols) 167private static bool IsRenameValid(MutableConflictResolution conflictResolution, ISymbol renamedSymbol) 175ISymbol renamedSymbol, 176ISymbol originalSymbol, 228ISymbol renamedSymbol, 229ISymbol renameSymbol, 230IEnumerable<ISymbol> referencedSymbols, 245IEnumerable<ISymbol> otherThingsNamedTheSameExcludeMethodAndParameterizedProperty; 324private static void AddConflictingSymbolLocations(IEnumerable<ISymbol> conflictingSymbols, MutableConflictResolution conflictResolution, IDictionary<Location, Location> reverseMappedLocations) 326foreach (var newSymbol in conflictingSymbols) 345IEnumerable<ISymbol> symbols, 351foreach (var symbol in symbols) 358var overriddenSymbol = symbol.GetOverriddenMember(); 383private static string GetString(ISymbol symbol) 400private static Location? GetSymbolLocation(Solution solution, ISymbol symbol, CancellationToken cancellationToken) 404var originalsourcesymbol = SymbolFinder.FindSourceDefinition(symbol, solution, cancellationToken);
Rename\ConflictEngine\ConflictResolver.Session.cs (15)
210var renamedSymbolInNewSolution = await GetRenamedSymbolInCurrentSolutionAsync(conflictResolution).ConfigureAwait(false); 313var renamedSymbolInNewSolution = await GetRenamedSymbolInCurrentSolutionAsync(conflictResolution).ConfigureAwait(false); 370ImmutableArray<ISymbol> newReferencedSymbols = default; 455var renameSymbol = _renameLocationSet.Symbol; 468private async Task<ImmutableHashSet<ISymbol>?> GetNonConflictSymbolsAsync(Project currentProject) 478ImmutableArray<ISymbol> symbols, ImmutableHashSet<ISymbol>? nonConflictSymbols) 482foreach (var symbol in symbols) 511ISymbol renamedSymbolInNewSolution, 513ImmutableArray<ISymbol> newReferencedSymbols) 574foreach (var symbol in newReferencedSymbols) 612var overriddenSymbol = overridingSymbol.GetOverriddenMember(); 651private ImmutableArray<ISymbol> GetSymbolsInNewSolution(Document newDocument, SemanticModel newDocumentSemanticModel, RenameActionAnnotation conflictAnnotation, SyntaxNodeOrToken tokenOrNode) 674private async Task<ISymbol> GetRenamedSymbolInCurrentSolutionAsync(MutableConflictResolution conflictResolution) 705var symbol = _renameLocationSet.Symbol;
Rename\ConflictEngine\DeclarationConflictHelpers.cs (6)
37private static ImmutableArray<Location> GetConflictLocations(ISymbol renamedMember, 38IEnumerable<ISymbol> potentiallyConflictingMembers, 40Func<ISymbol, ImmutableArray<ImmutableArray<ITypeSymbol>>> getAllSignatures) 42var signatureToConflictingMember = new Dictionary<ImmutableArray<ITypeSymbol>, ISymbol>(ConflictingSignatureComparer.Instance); 44foreach (var member in potentiallyConflictingMembers) 56if (signatureToConflictingMember.TryGetValue(signature, out var conflictingSymbol))
Rename\IRenameRewriterLanguageService.cs (18)
36ISymbol symbol, 54ISymbol renamedSymbol, 55ISymbol renameSymbol, 56IEnumerable<ISymbol> referencedSymbols, 71ISymbol renameSymbol, 72ISymbol renamedSymbol, 86ISymbol renamedSymbol, 101IEnumerable<ISymbol> newReferencedSymbols); 124public abstract Task<ImmutableArray<Location>> ComputeDeclarationConflictsAsync(string replacementText, ISymbol renamedSymbol, ISymbol renameSymbol, IEnumerable<ISymbol> referencedSymbols, Solution baseSolution, Solution newSolution, IDictionary<Location, Location> reverseMappedLocations, CancellationToken cancellationToken); 125public abstract Task<ImmutableArray<Location>> ComputeImplicitReferenceConflictsAsync(ISymbol renameSymbol, ISymbol renamedSymbol, IEnumerable<ReferenceLocation> implicitReferenceLocations, CancellationToken cancellationToken); 126public abstract ImmutableArray<Location> ComputePossibleImplicitUsageConflicts(ISymbol renamedSymbol, SemanticModel semanticModel, Location originalDeclarationLocation, int newDeclarationLocationStartingPosition, CancellationToken cancellationToken); 129public abstract bool LocalVariableConflict(SyntaxToken token, IEnumerable<ISymbol> newReferencedSymbols); 130public abstract void TryAddPossibleNameConflicts(ISymbol symbol, string newName, ICollection<string> possibleNameConflicts); 133IEnumerable<ISymbol> properties, string newPropertyName, ArrayBuilder<Location> conflicts) 137foreach (var symbol in properties)
Rename\LightweightRenameLocations.cs (3)
49public async Task<SymbolicRenameLocations?> ToSymbolicLocationsAsync(ISymbol symbol, CancellationToken cancellationToken) 73ISymbol symbol, Solution solution, SymbolRenameOptions options, CancellationToken cancellationToken) 117public Task<ConflictResolution> ResolveConflictsAsync(ISymbol symbol, string replacementText, ImmutableArray<SymbolKey> nonConflictSymbolKeys, CancellationToken cancellationToken)
Rename\Renamer.cs (5)
38public static Task<Solution> RenameSymbolAsync(Solution solution, ISymbol symbol, string newName, OptionSet? optionSet, CancellationToken cancellationToken = default) 42Solution solution, ISymbol symbol, SymbolRenameOptions options, string newName, CancellationToken cancellationToken = default) 139internal static Task<LightweightRenameLocations> FindRenameLocationsAsync(Solution solution, ISymbol symbol, SymbolRenameOptions options, CancellationToken cancellationToken) 144ISymbol symbol, 189ISymbol symbol,
Rename\Renamer.RenameSymbolDocumentAction.cs (2)
51var symbol = semanticModel.GetRequiredDeclaredSymbol(matchingTypeDeclaration, cancellationToken); 107var symbol = semanticModel.GetDeclaredSymbol(matchingDeclaration, cancellationToken);
Rename\RenameRewriterParameters.cs (2)
25ISymbol renameSymbol, 44internal readonly ISymbol RenameSymbol = renameSymbol;
Rename\RenameUtilities.cs (22)
26internal static SyntaxToken UpdateAliasAnnotation(SyntaxToken token, ISymbol aliasSymbol, string replacementText) 44internal static ImmutableArray<ISymbol> GetSymbolsTouchingPosition( 73private static bool IsSymbolDefinedInsideMethod(ISymbol symbol) 82internal static IEnumerable<Document> GetDocumentsAffectedByRename(ISymbol symbol, Solution solution, IEnumerable<RenameLocation> renameLocations) 120private static bool ShouldRenameOnlyAffectDeclaringProject(ISymbol symbol) 151var symbol = semanticFacts.GetDeclaredSymbol(semanticModel, token, cancellationToken); 192public static IEnumerable<ISymbol> GetOverloadedSymbols(ISymbol symbol) 199foreach (var member in containingType.GetMembers()) 210public static async Task<ISymbol?> TryGetPropertyFromAccessorOrAnOverrideAsync( 211ISymbol symbol, Solution solution, CancellationToken cancellationToken) 218var originalSourceSymbol = SymbolFinder.FindSourceDefinition( 231foreach (var methodImplementor in methodImplementors) 233var propertyAccessorOrAnOverride = await TryGetPropertyFromAccessorOrAnOverrideAsync(methodImplementor, solution, cancellationToken).ConfigureAwait(false); 299public static async Task<ISymbol?> TryGetRenamableSymbolAsync( 302var symbol = await SymbolFinder.FindSymbolAtPositionAsync(document, position, cancellationToken: cancellationToken).ConfigureAwait(false); 306var definitionSymbol = await FindDefinitionSymbolAsync(symbol, document.Project.Solution, cancellationToken).ConfigureAwait(false); 315public static async Task<ISymbol> FindDefinitionSymbolAsync( 316ISymbol symbol, Solution solution, CancellationToken cancellationToken) 322var foundSymbol = SymbolFinder.FindSourceDefinition( 325var bestSymbol = foundSymbol ?? symbol; 350var property = await TryGetPropertyFromAccessorOrAnOverrideAsync(bestSymbol, solution, cancellationToken).ConfigureAwait(false);
Rename\SymbolicRenameLocations.cs (9)
26public readonly ISymbol Symbol; 31public readonly ImmutableArray<ISymbol> ReferencedSymbols; 34ISymbol symbol, 39ImmutableArray<ISymbol> referencedSymbols) 58ISymbol symbol, Solution solution, SymbolRenameOptions options, CancellationToken cancellationToken) 82using var _1 = ArrayBuilder<ISymbol>.GetInstance(out var mergedReferencedSymbols); 114ISymbol symbol, Solution solution, CancellationToken cancellationToken) 118foreach (var overloadedSymbol in RenameUtilities.GetOverloadedSymbols(symbol)) 125ISymbol symbol,
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (13)
31ISymbol referencedSymbol, ISymbol originalSymbol, Solution solution, bool considerSymbolReferences, CancellationToken cancellationToken) 123static bool IsConstructorForType(ISymbol possibleConstructor, ISymbol possibleType) 132ISymbol propertySymbol, ISymbol parameterSymbol, CancellationToken cancellationToken) 136ISymbol symbol, Solution solution, CancellationToken cancellationToken) 138var result = await RenameUtilities.TryGetPropertyFromAccessorOrAnOverrideAsync( 161ISymbol referencedSymbol, ISymbol originalSymbol, Solution solution, CancellationToken cancellationToken) 244internal static async Task<IEnumerable<RenameLocation>> GetRenamableReferenceLocationsAsync(ISymbol referencedSymbol, ISymbol originalSymbol, ReferenceLocation location, Solution solution, CancellationToken cancellationToken) 320ISymbol originalSymbol,
Rename\SymbolicRenameLocations.SearchResult.cs (2)
16public readonly ImmutableArray<ISymbol> ReferencedSymbols; 21ImmutableArray<ISymbol> referencedSymbols)
Rename\TokenRenameInfo.cs (4)
9internal sealed class TokenRenameInfo(bool hasSymbols, IEnumerable<ISymbol> symbols, bool isMemberGroup) 12public IEnumerable<ISymbol> Symbols { get; private set; } = symbols; 15public static TokenRenameInfo CreateMemberGroupTokenInfo(IEnumerable<ISymbol> symbols) 25public static TokenRenameInfo CreateSingleSymbolTokenInfo(ISymbol symbol)
Shared\Extensions\IFindReferencesResultExtensions.cs (4)
20this ISymbol definition) 47this ISymbol definition, FindReferencesSearchOptions options, bool showMetadataSymbolsWithoutReferences) 116ISymbol symbol) 126ISymbol symbol)
Shared\Extensions\INamespaceSymbolExtensions.cs (1)
185foreach (var namespaceOrType in members)
Shared\Extensions\ISymbolExtensions.cs (21)
36this ISymbol symbol, 52this ISymbol symbol, 87ISymbol symbol, 107ISymbol symbol, INamedTypeSymbol? hideModuleNameAttribute, ImmutableArray<AttributeData> attributes = default) 221public static DocumentationComment GetDocumentationComment(this ISymbol symbol, Compilation compilation, CultureInfo? preferredCulture = null, bool expandIncludes = false, bool expandInheritdoc = false, CancellationToken cancellationToken = default) 224private static DocumentationComment GetDocumentationComment(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, CultureInfo? preferredCulture, bool expandIncludes, bool expandInheritdoc, CancellationToken cancellationToken) 260static bool IsEligibleForAutomaticInheritdoc(ISymbol symbol) 297private static XNode[] RewriteInheritdocElements(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XNode node, CancellationToken cancellationToken) 334private static XNode[] RewriteMany(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XNode[] nodes, CancellationToken cancellationToken) 345private static XNode[]? RewriteInheritdocElement(ISymbol memberSymbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XElement element, CancellationToken cancellationToken) 350var candidate = GetCandidateSymbol(memberSymbol); 361ISymbol? symbol; 462static ISymbol? GetCandidateSymbol(ISymbol memberSymbol) 646this ImmutableArray<T> symbols, bool hideAdvancedMembers, Compilation compilation) where T : ISymbol 655var overriddenMember = symbol.GetOverriddenMember(); 682this ImmutableArray<T> symbols, bool hideAdvancedMembers, Compilation compilation) where T : ISymbol
Shared\Extensions\ISymbolExtensions_2.cs (1)
11public static bool IsImplicitValueParameter([NotNullWhen(returnValue: true)] this ISymbol? symbol)
Shared\Extensions\ITypeSymbolExtensions.cs (10)
27public static ImmutableArray<ISymbol> FindImplementationsForInterfaceMember( 29ISymbol interfaceMember, 42using var _ = ArrayBuilder<ISymbol>.GetInstance(out var builder); 85var originalInterfaceMember = interfaceMember.OriginalDefinition; 96var constructedInterfaceMember = 113var result = currentType.FindImplementations(constructedInterfaceMember, solution.Services); 127public static ISymbol? FindImplementations(this ITypeSymbol typeSymbol, ISymbol constructedInterfaceMember, SolutionServices services) 136private static ISymbol? FindImplementations<TSymbol>( 139SolutionServices services) where TSymbol : class, ISymbol
Shared\Extensions\SemanticModelExtensions.cs (6)
22private static ISymbol? MapSymbol(ISymbol? symbol, ITypeSymbol? type) 89ISymbol? declaredSymbol = null; 91var allSymbols = ImmutableArray<ISymbol?>.Empty; 103var overridingSymbol = semanticFacts.GetDeclaredSymbol(semanticModel, overridingIdentifier.Value, cancellationToken); 104var overriddenSymbol = overridingSymbol.GetOverriddenMember(allowLooseMatch: true);
Shared\Extensions\SyntaxGeneratorExtensions.cs (3)
192public static async Task<ISymbol> OverrideAsync( 194ISymbol symbol, 222private static DeclarationModifiers GetOverrideModifiers(ISymbol symbol)
Shared\Extensions\TokenSemanticInfo.cs (7)
15ISymbol declaredSymbol, 18ImmutableArray<ISymbol> referencedSymbols, 26public readonly ISymbol DeclaredSymbol = declaredSymbol; 29public readonly ImmutableArray<ISymbol> ReferencedSymbols = referencedSymbols; 34public ImmutableArray<ISymbol> GetSymbols(bool includeType) 36var result = ArrayBuilder<ISymbol>.GetInstance(); 50public ISymbol GetAnySymbol(bool includeType)
Shared\Utilities\SemanticMap.cs (1)
31public IEnumerable<ISymbol> AllReferencedSymbols
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
19ISymbol symbol, INamedTypeSymbol generatedCodeAttribute)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\CompilationExtensions.cs (1)
77foreach (var candidateMember in candidateTopLevelType.GetMembers(WellKnownMemberNames.TopLevelStatementsEntryPointMethodName))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (63)
67public static ISymbol? FindImplementationForAbstractMember(this INamedTypeSymbol? type, ISymbol symbol) 78private static bool ImplementationExists(INamedTypeSymbol classOrStructType, ISymbol member) 83ISymbol member, 84Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation, 152ISymbol member, 153Func<INamedTypeSymbol, ISymbol, bool> isValid, 156var implementation = classOrStructType.FindImplementationForInterfaceMember(member); 176public static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedMembers( 194static ImmutableArray<ISymbol> GetImplicitlyImplementableMembers(INamedTypeSymbol type, ISymbol within) 209static bool IsPropertyWithNonPublicImplementableAccessor(ISymbol member) 226static bool IsImplicitlyImplementable(ISymbol member, ISymbol within) 243private static bool IsImplementable(ISymbol m) 246public static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedMembersInThis( 256var implementation = classOrStructType.FindImplementationForInterfaceMember(m); 264public static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedMembersInThis( 267Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter, 275var implementation = classOrStructType.FindImplementationForInterfaceMember(m); 283public static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedExplicitMembers( 297private static ImmutableArray<ISymbol> GetExplicitlyImplementableMembers(INamedTypeSymbol type, ISymbol within) 309private static bool IsPropertyWithInaccessibleImplementableAccessor(ISymbol member, ISymbol within) 321private static bool IsInaccessibleImplementableAccessor(IMethodSymbol? accessor, ISymbol within) 324private static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedMembers( 327Func<INamedTypeSymbol, ISymbol, Func<INamedTypeSymbol, ISymbol, bool>, CancellationToken, bool> isImplemented, 328Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation, 329Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter, 399private static ImmutableArray<ISymbol> GetUnimplementedMembers( 402Func<INamedTypeSymbol, ISymbol, Func<INamedTypeSymbol, ISymbol, bool>, CancellationToken, bool> isImplemented, 403Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation, 404Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter, 407using var _ = ArrayBuilder<ISymbol>.GetInstance(out var results); 409foreach (var member in interfaceMemberGetter(interfaceType, classOrStructType)) 438void AddIfNotImplemented(ISymbol member) 445public static IEnumerable<ISymbol> GetAttributeNamedParameters( 448ISymbol within) 461foreach (var member in type.GetMembers()) 463var namedParameter = IsAttributeNamedParameter(member, within ?? compilation.Assembly); 472private static ISymbol? IsAttributeNamedParameter( 473ISymbol symbol, 474ISymbol within) 514private static ImmutableArray<ISymbol> GetMembers(INamedTypeSymbol type, ISymbol within) 527public static ImmutableArray<ISymbol> GetOverridableMembers( 533using var _ = PooledDictionary<ISymbol, int>.GetInstance(out var result); 566Dictionary<ISymbol, int> result, INamedTypeSymbol containingType, CancellationToken cancellationToken) 568foreach (var member in containingType.GetMembers()) 579var overriddenMember = member.GetOverriddenMember(); 587Dictionary<ISymbol, int> result, INamedTypeSymbol containingType, CancellationToken cancellationToken) 591foreach (var member in containingType.GetMembers()) 609Dictionary<ISymbol, int> result, INamedTypeSymbol containingType, 612foreach (var member in type.GetMembers()) 623private static bool IsOverridable(ISymbol member, INamedTypeSymbol containingType) 643private static bool IsEqualsObjectOverride(ISymbol? member) 654private static bool IsEqualsObject(ISymbol member)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IParameterSymbolExtensions.cs (1)
42foreach (var member in containingType.GetMembers(parameter.Name))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (94)
20public static string ToNameDisplayString(this ISymbol symbol) 23public static string ToSignatureDisplayString(this ISymbol symbol) 26public static bool HasPublicResultantVisibility(this ISymbol symbol) 29public static SymbolVisibility GetResultantVisibility(this ISymbol symbol) 76public static ISymbol? GetOverriddenMember(this ISymbol? symbol, bool allowLooseMatch = false) 81ISymbol? exactMatch = symbol switch 97if (TryFindLooseMatch(symbol, baseType, out var looseMatch)) 104bool TryFindLooseMatch(ISymbol symbol, INamedTypeSymbol baseType, [NotNullWhen(true)] out ISymbol? looseMatch) 109foreach (var member in baseType.GetMembers(symbol.Name)) 137public static ImmutableArray<ISymbol> ExplicitInterfaceImplementations(this ISymbol symbol) 140IEventSymbol @event => ImmutableArray<ISymbol>.CastUp(@event.ExplicitInterfaceImplementations), 141IMethodSymbol method => ImmutableArray<ISymbol>.CastUp(method.ExplicitInterfaceImplementations), 142IPropertySymbol property => ImmutableArray<ISymbol>.CastUp(property.ExplicitInterfaceImplementations), 146public static ImmutableArray<ISymbol> ExplicitOrImplicitInterfaceImplementations(this ISymbol symbol) 151using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 155foreach (var interfaceMember in iface.GetMembers()) 157var impl = symbol.ContainingType.FindImplementationForInterfaceMember(interfaceMember); 171public static ImmutableArray<ISymbol> ImplicitInterfaceImplementations(this ISymbol symbol) 174public static bool IsOverridable([NotNullWhen(true)] this ISymbol? symbol) 181public static bool IsImplementableMember([NotNullWhen(true)] this ISymbol? symbol) 213public static INamedTypeSymbol? GetContainingTypeOrThis(this ISymbol symbol) 223public static bool IsErrorType([NotNullWhen(true)] this ISymbol? symbol) 226public static bool IsModuleType([NotNullWhen(true)] this ISymbol? symbol) 229public static bool IsInterfaceType([NotNullWhen(true)] this ISymbol? symbol) 232public static bool IsArrayType([NotNullWhen(true)] this ISymbol? symbol) 235public static bool IsTupleType([NotNullWhen(true)] this ISymbol? symbol) 238public static bool IsAnonymousFunction([NotNullWhen(true)] this ISymbol? symbol) 241public static bool IsKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind) 244public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind) 247public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind1, SymbolKind kind2) 253public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind1, SymbolKind kind2, SymbolKind kind3) 259public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, params SymbolKind[] kinds) 265public static bool IsReducedExtension([NotNullWhen(true)] this ISymbol? symbol) 268public static bool IsEnumMember([NotNullWhen(true)] this ISymbol? symbol) 271public static bool IsExtensionMethod(this ISymbol symbol) 274public static bool IsLocalFunction([NotNullWhen(true)] this ISymbol? symbol) 277public static bool IsAnonymousOrLocalFunction([NotNullWhen(true)] this ISymbol? symbol) 280public static bool IsModuleMember([NotNullWhen(true)] this ISymbol? symbol) 283public static bool IsConstructor([NotNullWhen(true)] this ISymbol? symbol) 286public static bool IsStaticConstructor([NotNullWhen(true)] this ISymbol? symbol) 289public static bool IsDestructor([NotNullWhen(true)] this ISymbol? symbol) 292public static bool IsUserDefinedOperator([NotNullWhen(true)] this ISymbol? symbol) 295public static bool IsConversion([NotNullWhen(true)] this ISymbol? symbol) 298public static bool IsOrdinaryMethod([NotNullWhen(true)] this ISymbol? symbol) 301public static bool IsOrdinaryMethodOrLocalFunction([NotNullWhen(true)] this ISymbol? symbol) 304public static bool IsDelegateType([NotNullWhen(true)] this ISymbol? symbol) 307public static bool IsAnonymousType([NotNullWhen(true)] this ISymbol? symbol) 310public static bool IsNormalAnonymousType([NotNullWhen(true)] this ISymbol? symbol) 313public static bool IsAnonymousDelegateType([NotNullWhen(true)] this ISymbol? symbol) 316public static bool IsAnonymousTypeProperty([NotNullWhen(true)] this ISymbol? symbol) 319public static bool IsTupleField([NotNullWhen(true)] this ISymbol? symbol) 322public static bool IsIndexer([NotNullWhen(true)] this ISymbol? symbol) 325public static bool IsWriteableFieldOrProperty([NotNullWhen(true)] this ISymbol? symbol) 333public static bool IsRequired([NotNullWhen(true)] this ISymbol? symbol) 336public static ITypeSymbol? GetMemberType(this ISymbol? symbol) 348public static int GetArity(this ISymbol symbol) 357public static ISymbol? GetOriginalUnreducedDefinition(this ISymbol? symbol) 400public static bool IsFunctionValue([NotNullWhen(true)] this ISymbol? symbol) 403public static bool IsThisParameter([NotNullWhen(true)] this ISymbol? symbol) 407public static ISymbol? ConvertThisParameterToType(this ISymbol? symbol) 417public static bool IsParams([NotNullWhen(true)] this ISymbol? symbol) 420public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol? symbol) 428public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 436public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 449public static ImmutableArray<ITypeSymbol> GetTypeArguments(this ISymbol? symbol) 457public static ImmutableArray<ITypeSymbol> GetAllTypeArguments(this ISymbol symbol) 472public static bool IsAttribute([NotNullWhen(true)] this ISymbol? symbol) 481public static bool RequiresUnsafeModifier([NotNullWhen(true)] this ISymbol? member) 488this ISymbol? symbol, 531public static bool IsStaticType([NotNullWhen(true)] this ISymbol? symbol) 535[NotNullWhen(true)] this ISymbol? symbol, ISymbol withinType, IAssemblySymbol withinAssembly, CancellationToken cancellationToken) 555public static IEnumerable<IPropertySymbol> GetValidAnonymousTypeProperties(this ISymbol symbol) 561public static Accessibility ComputeResultantAccessibility(this ISymbol? symbol, ITypeSymbol finalDestination) 587public static bool IsInaccessibleLocal(this ISymbol symbol, int position) 605public static bool IsAccessor([NotNullWhen(true)] this ISymbol? symbol) 608public static bool IsPropertyAccessor([NotNullWhen(true)] this ISymbol? symbol) 611public static bool IsEventAccessor([NotNullWhen(true)] this ISymbol? symbol) 614public static bool IsFromSource(this ISymbol symbol) 617public static bool IsNonImplicitAndFromSource(this ISymbol symbol) 620public static ITypeSymbol? GetSymbolType(this ISymbol? symbol) 636public static bool IsAwaitableNonDynamic([NotNullWhen(true)] this ISymbol? symbol, SemanticModel semanticModel, int position) 775public static bool IsKind<TSymbol>(this ISymbol symbol, SymbolKind kind, [NotNullWhen(true)] out TSymbol? result) where TSymbol : class, ISymbol 792public static bool IsSymbolWithSpecialDiscardName(this ISymbol symbol) 801public static bool IsObsolete(this ISymbol symbol) 808public static bool HasAttribute([NotNullWhen(true)] this ISymbol? symbol, [NotNullWhen(true)] INamedTypeSymbol? attributeClass)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (2)
20private readonly HashSet<ISymbol> _visited = []; 22public override bool DefaultVisit(ISymbol node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (11)
16this ISymbol symbol, 17ISymbol within, 38this ISymbol symbol, 50this ISymbol symbol, 63ISymbol symbol, 82ISymbol symbol, 83ISymbol within, // must be assembly or named type symbol 173private static bool IsNamedTypeAccessible(INamedTypeSymbol type, ISymbol within) 211ISymbol within) 246ISymbol within, 406ISymbol within,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
16public override ITypeSymbol DefaultVisit(ISymbol node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (3)
16private readonly PooledHashSet<ISymbol> _visited = PooledHashSet<ISymbol>.GetInstance(); 23public override void DefaultVisit(ISymbol node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (13)
404public static bool CanSupportCollectionInitializer(this ITypeSymbol typeSymbol, ISymbol within) 435public static IEnumerable<T> GetAccessibleMembersInBaseTypes<T>(this ITypeSymbol containingType, ISymbol within) where T : class, ISymbol 444public static ImmutableArray<T> GetAccessibleMembersInThisAndBaseTypes<T>(this ITypeSymbol? containingType, ISymbol within) where T : class, ISymbol 454public static ImmutableArray<T> GetAccessibleMembersInThisAndBaseTypes<T>(this ITypeSymbol? containingType, string memberName, ISymbol within) where T : class, ISymbol 499public static IEnumerable<T> SelectAccessibleMembers<T>(this IEnumerable<ITypeSymbol>? types, ISymbol within) where T : class, ISymbol 509private static IEnumerable<T> SelectAccessibleMembers<T>(this IEnumerable<ITypeSymbol>? types, string memberName, ISymbol within) where T : class, ISymbol 694foreach (var member in type.GetMembers()) 755public static bool IsReadOnlySpan([NotNullWhen(true)] this ISymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
15public override Accessibility DefaultVisit(ISymbol node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
31public override ITypeSymbol DefaultVisit(ISymbol node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
17public override ITypeSymbol DefaultVisit(ISymbol node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
16public override ITypeSymbol DefaultVisit(ISymbol node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (2)
34public static ValueUsageInfo GetValueUsageInfo(this IOperation operation, ISymbol containingSymbol) 233public static RefKind GetRefKind(this IReturnOperation? operation, ISymbol containingSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (1)
135? EqualityComparer<ISymbol?>.Default.Equals(info1.Symbol, info2.Symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (9)
48public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 60public static ISymbol GetRequiredEnclosingSymbol(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 67where TSymbol : class, ISymbol 69for (var symbol = semanticModel.GetEnclosingSymbol(position, cancellationToken); 82public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 85(ISymbol)semanticModel.Compilation.Assembly; 107public static HashSet<ISymbol> GetAllDeclaredSymbols( 110var symbols = new HashSet<ISymbol>(); 117var symbol = semanticModel.GetDeclaredSymbol(current, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolInfoExtensions.cs (6)
15public static ImmutableArray<ISymbol> GetAllSymbols(this SymbolInfo info) 18private static ImmutableArray<ISymbol> GetAllSymbolsWorker(this SymbolInfo info) 21public static ISymbol? GetAnySymbol(this SymbolInfo info) 24public static ImmutableArray<ISymbol> GetBestOrAllSymbols(this SymbolInfo info) 31using var result = TemporaryArray<ISymbol>.Empty; 32foreach (var symbol in info.CandidateSymbols)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (14)
35private readonly PooledHashSet<ISymbol> _referenceTakenSymbolsBuilder; 40_referenceTakenSymbolsBuilder = PooledHashSet<ISymbol>.GetInstance(); 61protected abstract PooledDictionary<(ISymbol symbol, IOperation operation), bool> SymbolsWriteBuilder { get; } 66protected abstract PooledHashSet<ISymbol> SymbolsReadBuilder { get; } 132public abstract void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId); 137public abstract void SetTargetsFromSymbolForDelegate(IOperation write, ISymbol symbol); 143protected static PooledDictionary<(ISymbol Symbol, IOperation Write), bool> CreateSymbolsWriteMap( 146var symbolsWriteMap = PooledDictionary<(ISymbol Symbol, IOperation Write), bool>.GetInstance(); 150protected static PooledDictionary<(ISymbol Symbol, IOperation Write), bool> UpdateSymbolsWriteMap( 151PooledDictionary<(ISymbol Symbol, IOperation Write), bool> symbolsWriteMap, 158(ISymbol, IOperation) key = (parameter, null); 178public void OnReadReferenceFound(ISymbol symbol) 201public void OnWriteReferenceFound(ISymbol symbol, IOperation operation, bool maybeWritten, bool isRef) 237foreach (var symbol in SymbolsWriteBuilder.Keys.Select(d => d.symbol).ToArray())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (7)
28private readonly Dictionary<ISymbol, PooledHashSet<IOperation>> _reachingWrites; 62public void Clear(ISymbol symbol) 74public void ForEachCurrentWrite<TArg>(ISymbol symbol, Action<IOperation, TArg> action, TArg arg) 86public bool ForEachCurrentWrite<TArg>(ISymbol symbol, Func<IOperation, TArg, bool> action, TArg arg) 104public void OnWriteReferenceFound(ISymbol symbol, IOperation operation, bool maybeWritten) 130foreach (var key in _reachingWrites.Keys) 223private static void AddEntries(Dictionary<ISymbol, PooledHashSet<IOperation>> result, BasicBlockAnalysisData source)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.cs (2)
25public static SymbolUsageResult Run(ControlFlowGraph cfg, ISymbol owningSymbol, CancellationToken cancellationToken) 32public static SymbolUsageResult Run(IOperation rootOperation, ISymbol owningSymbol, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (2)
25private DataFlowAnalyzer(ControlFlowGraph cfg, ISymbol owningSymbol) 40public static SymbolUsageResult RunAnalysis(ControlFlowGraph cfg, ISymbol owningSymbol, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (17)
41private readonly PooledDictionary<CaptureId, PooledHashSet<(ISymbol, IOperation)>> _lValueFlowCapturesMap; 69private readonly PooledDictionary<(int firstBlockOrdinal, int lastBlockOrdinal), PooledHashSet<(ISymbol, IOperation)>> _symbolWritesInsideBlockRangeMap; 73ISymbol owningSymbol, 77PooledDictionary<(ISymbol symbol, IOperation operation), bool> symbolsWriteMap, 78PooledHashSet<ISymbol> symbolsRead, 99_lValueFlowCapturesMap = PooledDictionary<CaptureId, PooledHashSet<(ISymbol, IOperation)>>.GetInstance(); 103_symbolWritesInsideBlockRangeMap = PooledDictionary<(int firstBlockOrdinal, int lastBlockOrdinal), PooledHashSet<(ISymbol, IOperation)>>.GetInstance(); 106public ISymbol OwningSymbol { get; } 108protected override PooledHashSet<ISymbol> SymbolsReadBuilder { get; } 110protected override PooledDictionary<(ISymbol symbol, IOperation operation), bool> SymbolsWriteBuilder { get; } 118ISymbol owningSymbol, 131symbolsRead: PooledHashSet<ISymbol>.GetInstance(), 215private PooledHashSet<(ISymbol, IOperation)> GetOrCreateSymbolWritesInBlockRange(int firstBlockOrdinal, int lastBlockOrdinal, CancellationToken cancellationToken) 224writesInBlockRange = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 462public override void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId) 466captures = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 514public override void SetTargetsFromSymbolForDelegate(IOperation write, ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.OperationTreeAnalysisData.cs (8)
21PooledDictionary<(ISymbol symbol, IOperation operation), bool> symbolsWriteMap, 22PooledHashSet<ISymbol> symbolsRead, 32protected override PooledHashSet<ISymbol> SymbolsReadBuilder { get; } 34protected override PooledDictionary<(ISymbol symbol, IOperation operation), bool> SymbolsWriteBuilder { get; } 39ISymbol owningSymbol, 44symbolsRead: PooledHashSet<ISymbol>.GetInstance(), 63public override void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId) 75public override void SetTargetsFromSymbolForDelegate(IOperation write, ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (13)
26private ISymbol _currentContainingSymbol; 29private PooledDictionary<IAssignmentOperation, PooledHashSet<(ISymbol, IOperation)>> _pendingWritesMap; 35ISymbol containingSymbol, 51private void Visit(ISymbol containingSymbol, IEnumerable<IOperation> operations, AnalysisData analysisData, CancellationToken cancellationToken) 58_pendingWritesMap = PooledDictionary<IAssignmentOperation, PooledHashSet<(ISymbol, IOperation)>>.GetInstance(); 90private void OnReadReferenceFound(ISymbol symbol) 93private void OnWriteReferenceFound(ISymbol symbol, IOperation operation, ValueUsageInfo valueUsageInfo) 101private void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId) 107private void OnReferenceFound(ISymbol symbol, IOperation operation) 159private bool MakePendingWrite(IOperation operation, ISymbol symbolOpt) 166var set = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 175set = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 407private void ProcessPossibleDelegateCreationAssignment(ISymbol symbol, IOperation write)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (6)
13ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 14ImmutableHashSet<ISymbol> symbolsRead) 33public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } = symbolWritesMap; 38public ImmutableHashSet<ISymbol> SymbolsRead { get; } = symbolsRead; 47public IEnumerable<(ISymbol Symbol, IOperation WriteOperation)> GetUnreadSymbolWrites() 71public int GetSymbolWriteCount(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (2)
19public static IdentifierNameParts CreateIdentifierNameParts(ISymbol symbol, ImmutableArray<NamingRule> rules) 35private static string RemovePrefixesAndSuffixes(ISymbol symbol, ImmutableArray<NamingRule> rules, string baseName)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (5)
18internal bool TryGetApplicableRule(ISymbol symbol, out NamingRule applicableRule) 37private bool IsSymbolNameAnalyzable(ISymbol symbol) 58private static bool DoesSymbolImplementAnotherSymbol(ISymbol symbol) 80private static bool IsInterfaceImplementation(ISymbol symbol) 93foreach (var implementedInterfaceMember in implementedInterfaceMembersWithSameName)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (5)
96public bool AppliesTo(ISymbol symbol) 158private static Accessibility GetAccessibility(ISymbol symbol) 160for (var currentSymbol = symbol; currentSymbol != null; currentSymbol = currentSymbol.ContainingSymbol) 363public bool MatchesSymbol(ISymbol symbol) 503public bool MatchesSymbol(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (7)
65ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 90IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken); 95ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 96ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 98ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken); 105ImmutableArray<IMethodSymbol> GetLocalFunctionSymbols(Compilation compilation, ISymbol symbol, CancellationToken cancellationToken); 130Task<ISymbol?> GetInterceptorSymbolAsync(Document document, int position, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (2)
100foreach (var symbol in symbolInfo.CandidateSymbols) 111private static bool IsUserDefinedOperator([NotNullWhen(returnValue: true)] ISymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Simplification\SymbolAnnotation.cs (3)
17public static SyntaxAnnotation Create(ISymbol symbol) 20public static ISymbol? GetSymbol(SyntaxAnnotation annotation, Compilation compilation) 23public static ImmutableArray<ISymbol> GetSymbols(SyntaxAnnotation annotation, Compilation compilation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AbstractSymbolKey.cs (1)
10where TSymbol : class, ISymbol
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (3)
41var target = targetResolution.GetAnySymbol(); 59SemanticModel semanticModel, SyntaxNode syntaxNode, string name, ISymbol target, 66var symbol = semanticModel.GetDeclaredSymbol(syntaxNode, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (2)
21public static void Create(ISymbol symbol, SymbolKeyWriter visitor) 57var symbol = semanticModel.GetSymbolInfo(node, reader.CancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (7)
19public static ImmutableArray<Location?> GetBodyLevelSourceLocations(ISymbol symbol, CancellationToken cancellationToken) 38public static void Create(ISymbol symbol, SymbolKeyWriter visitor) 69var container = symbol.ContainingSymbol; 100private static SyntaxNode? TryGetContainerDeclaration(ISymbol container, SyntaxTree? syntaxTree, CancellationToken cancellationToken) 230var symbol = resolution.GetAnySymbol(); 254private static IEnumerable<(ISymbol symbol, int ordinal)> EnumerateSymbols( 263var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (31)
29/// the "same" <see cref="ISymbol.ContainingType"/> and 30/// equal <see cref="ISymbol.MetadataName"/>.</item> 32/// the "same" <see cref="ISymbol.ContainingType"/>, 33/// equal <see cref="ISymbol.MetadataName"/>, 39/// the "same" <see cref="ISymbol.ContainingAssembly"/>. 40/// <see cref="ISymbol.MetadataName"/> is not used because module identity is not important in practice.</item> 42/// the "same" <see cref="ISymbol.ContainingSymbol"/>, 43/// equal <see cref="ISymbol.MetadataName"/>, 47/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 48/// equal <see cref="ISymbol.MetadataName"/>. 53/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 54/// equal <see cref="ISymbol.MetadataName"/>.</item> 58/// the "same" the "same" <see cref="ISymbol.ContainingType"/>, 59/// the "same" <see cref="ISymbol.MetadataName"/>, and have 63/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 64/// the "same" <see cref="ISymbol.MetadataName"/>.</item> 66/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 67/// the "same" <see cref="ISymbol.MetadataName"/>.</item> 69/// the "same" <see cref="ISymbol.Name"/>.</item> 76/// cref="SyntaxTree"/> is enumerated to list all the symbols with the same <see cref="ISymbol.Name"/> and <see 77/// cref="ISymbol.Kind"/> as the original symbol. The symbol with the same index in the destination tree as the 127public static SymbolKey Create(ISymbol? symbol, CancellationToken cancellationToken = default) 146public static bool CanCreate(ISymbol symbol, CancellationToken cancellationToken) 200public static string CreateString(ISymbol? symbol, CancellationToken cancellationToken = default) 204internal static string CreateStringWorker(int version, ISymbol? symbol, CancellationToken cancellationToken = default) 231/// to the corresponding <see cref="ISymbol"/> in a future <see cref="Compilation"/>. 243where TSymbol : class, ISymbol 259ImmutableArray<ISymbol>.CastUp(symbols.Builder.ToImmutableAndClear()), 296string? metadataName) where TSymbol : ISymbol 305foreach (var member in members) 315public static bool IsBodyLevelSymbol(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (2)
63var containingContextualSymbol = containerKind switch 683 => (ISymbol?)null,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (13)
332private readonly Stack<ISymbol?> _contextualSymbolStack = new(); 385where TOwningSymbol : ISymbol 425public ContextualSymbolPopper PushContextualSymbol(ISymbol? contextualSymbol) 431private void PopContextualSymbol(ISymbol? contextualSymbol) 438public ISymbol? CurrentContextualSymbol 447public readonly ref struct ContextualSymbolPopper(SymbolKeyReader reader, ISymbol? contextualSymbol) 468public SymbolKeyResolution ReadSymbolKey(ISymbol? contextualSymbol, out string? failureReason) 539Func<TContextualSymbol, int, ISymbol?>? getContextualSymbol, 558var nextContextualSymbol = contextualSymbol is null ? null : getContextualSymbol?.Invoke(contextualSymbol, i); 591Func<TContextualSymbol, int, ISymbol?>? getContextualSymbol, 593where TContextualSymbol : ISymbol 594where TSymbol : ISymbol 729var symbol = semanticModel.GetDeclaredSymbol(node, CancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (5)
57private readonly Action<ISymbol> _writeSymbolKey; 64private readonly Dictionary<ISymbol, int> _symbolToId = []; 128internal void WriteSymbolKey(ISymbol? symbol) 278where TSymbol : ISymbol 493public bool ShouldWriteTypeParameterOrdinal(ISymbol symbol, out int methodIndex)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
39using var _3 = ArrayBuilder<ISymbol>.GetInstance(out var elementTypes);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKeyExtensions.cs (1)
11public static SymbolKey GetSymbolKey(this ISymbol? symbol, CancellationToken cancellationToken = default)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKeyResolution.cs (8)
11/// single <see cref="ISymbol"/> then that will be returned in <see cref="Symbol"/>. Otherwise, if the key resolves 20private readonly ImmutableArray<ISymbol> _candidateSymbols; 22internal SymbolKeyResolution(ISymbol? symbol) 29internal SymbolKeyResolution(ImmutableArray<ISymbol> candidateSymbols, CandidateReason candidateReason) 38public ISymbol? Symbol { get; } 40public ImmutableArray<ISymbol> CandidateSymbols => _candidateSymbols.NullToEmpty(); 42public Enumerator<ISymbol> GetEnumerator() 45internal Enumerable<TSymbol> OfType<TSymbol>() where TSymbol : ISymbol
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKeyResolution.Enumeration.cs (2)
9public readonly struct Enumerable<TSymbol> where TSymbol : ISymbol 20public struct Enumerator<TSymbol> where TSymbol : ISymbol
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKeyResolutionExtensions.cs (1)
9internal static ISymbol? GetAnySymbol(this SymbolKeyResolution resolution)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (26)
357protected bool SymbolsAreCompatible(ISymbol? symbol, ISymbol? newSymbol, bool requireNonNullSymbols = false) 361ISymbol? symbol, 362ISymbol? newSymbol, 445private static bool CompareAcrossSemanticModels(ISymbol symbol, ISymbol newSymbol) 696private static bool IsStaticAccess(ISymbol? symbol) 734var originalExpressionSymbol = this.OriginalSemanticModel.GetSymbolInfo(currentOriginalNode).Symbol; 735var replacedExpressionSymbol = this.SpeculativeSemanticModel.GetSymbolInfo(currentReplacedNode).Symbol; 754private static bool IsSymbolSystemObjectInstanceMethod([NotNullWhen(true)] ISymbol? symbol) 765var attributeSym = this.OriginalSemanticModel.GetSymbolInfo(attribute).Symbol; 766var newAttributeSym = this.SpeculativeSemanticModel.GetSymbolInfo(newAttribute).Symbol; 828var implementationMember = expressionType.FindImplementationForInterfaceMember(getEnumerator); 859var symbol = this.OriginalSemanticModel.GetSymbolInfo(type).Symbol; 861ISymbol? newSymbol; 875private static bool IsDelegateInvoke(ISymbol symbol) 878private static bool IsAnonymousDelegateInvoke(ISymbol symbol) 894var symbol = originalSymbolInfo.Symbol; 895var newSymbol = newSymbolInfo.Symbol; 921for (var overriddenMember = newSymbol.GetOverriddenMember(); overriddenMember != null; overriddenMember = overriddenMember.GetOverriddenMember()) 972ISymbol symbol, 973ISymbol newSymbol, 1003var implementationMember = newSymbolContainingType.FindImplementationForInterfaceMember(symbol); 1050var receiverSymbol = semanticModel.GetSymbolInfo(receiver).GetAnySymbol(); 1060private bool SymbolsHaveCompatibleParameterLists(ISymbol originalSymbol, ISymbol newSymbol, TExpressionSyntax originalInvocation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (6)
28public bool HaveSameSignature(ISymbol symbol1, ISymbol symbol2, bool caseSensitive) 134public bool HaveSameSignatureAndConstraintsAndReturnTypeAndAccessors(ISymbol symbol1, ISymbol symbol2, bool caseSensitive) 149public bool HaveSameSignatureAndConstraintsAndReturnType(ISymbol symbol1, ISymbol symbol2, bool caseSensitive)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.cs (13)
38internal sealed partial class SymbolEquivalenceComparer : IEqualityComparer<ISymbol?> 152public bool Equals(ISymbol? x, ISymbol? y) 161public bool Equals(ISymbol? x, ISymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 167private bool EqualsCore(ISymbol? x, ISymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 170public int GetHashCode(ISymbol? x) 173private static ISymbol UnwrapAlias(ISymbol symbol) 176private static SymbolKind GetKindAndUnwrapAlias(ref ISymbol symbol) 194private static bool IsObjectType(ISymbol symbol) 219foreach (var candidate in errorType.CandidateSymbols)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (6)
20public bool AreEquivalent(ISymbol? x, ISymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 110private bool AreEquivalentWorker(ISymbol x, ISymbol y, SymbolKind k, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 270private static bool HaveSameLocation(ISymbol x, ISymbol y)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (4)
21private readonly Func<int, ISymbol, int> _symbolAggregator; 33public int GetHashCode(ISymbol? x, int currentHash) 56private int GetHashCodeWorker(ISymbol x, int currentHash) 149foreach (var candidate in errorType.CandidateSymbols)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (12)
65public TDeclarationNode AddMembers<TDeclarationNode>(TDeclarationNode destination, IEnumerable<ISymbol> members, CodeGenerationContextInfo info, CancellationToken cancellationToken) 115public TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 140public abstract TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 271IEnumerable<ISymbol> members, 294IEnumerable<ISymbol> members, 301foreach (var member in members) 325IEnumerable<ISymbol> members, 333foreach (var member in members) 342private SyntaxNode? GetNewMember(TCodeGenerationContextInfo info, CodeGenerationDestination codeGenerationDestination, ISymbol member, CancellationToken cancellationToken) 358ISymbol member, 373private static bool GeneratingEnum(IEnumerable<ISymbol> members) 455public Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
25public bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (3)
38public static TSyntaxNode? AddAnnotationsTo<TSyntaxNode>(ISymbol symbol, TSyntaxNode? syntax) where TSyntaxNode : SyntaxNode 116ISymbol symbol, string commentToken, [NotNullWhen(true)] out string? comment, CancellationToken cancellationToken = default) 150public static IEnumerable<ISymbol> GetMembers(INamedTypeSymbol namedType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (4)
27public static bool IsCodeGenerationSymbol(this ISymbol symbol) 428ImmutableArray<ISymbol> members = default, 447ImmutableArray<ISymbol> members = default, 508public static INamespaceSymbol CreateNamespaceSymbol(string name, IList<ISymbol>? imports = null, IList<INamespaceOrTypeSymbol>? members = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (2)
85public static Task<Document> AddMemberDeclarationsAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken) 91public static bool CanAdd(Solution solution, ISymbol destination, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (4)
83TDeclarationNode AddMembers<TDeclarationNode>(TDeclarationNode destination, IEnumerable<ISymbol> members, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 123TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 173Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken); 178bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
91public override ISymbol ContainingSymbol => this.ContainingType; 101public virtual ISymbol AssociatedSymbol => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
114public ISymbol AssociatedSymbol { get; internal set; }
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationFieldSymbol.cs (1)
96public ISymbol AssociatedSymbol => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (4)
25private readonly ImmutableArray<ISymbol> _members; 41ImmutableArray<ISymbol> members, 119public static ImmutableArray<ISymbol> CandidateSymbols 162public override ImmutableArray<ISymbol> GetMembers()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceInfo.cs (6)
17private readonly IList<ISymbol> _imports; 19private CodeGenerationNamespaceInfo(IList<ISymbol> imports) 24IList<ISymbol> imports) 26var info = new CodeGenerationNamespaceInfo(imports ?? SpecializedCollections.EmptyList<ISymbol>()); 36public static IList<ISymbol> GetImports(INamespaceSymbol @namespace) 39private static IList<ISymbol> GetImports(CodeGenerationNamespaceInfo info)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceOrTypeSymbol.cs (2)
28public virtual ImmutableArray<ISymbol> GetMembers() 31public ImmutableArray<ISymbol> GetMembers(string name)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (4)
82public virtual ISymbol ContainingSymbol => null; 173public ISymbol OriginalDefinition 222public bool Equals(ISymbol other) 225public bool Equals(ISymbol other, SymbolEqualityComparer equalityComparer)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (2)
60public ISymbol FindImplementationForInterfaceMember(ISymbol interfaceMember) => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\SyntaxAnnotationExtensions.cs (1)
15where TSymbol : ISymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (2)
142this IMethodSymbol method, ISymbol accessibleWithin, 172static bool shouldRemoveAttribute(AttributeData a, (INamedTypeSymbol[] removeAttributeTypes, ISymbol accessibleWithin) arg)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IPropertySymbolExtensions.cs (2)
41this IPropertySymbol property, ISymbol accessibleWithin, params INamedTypeSymbol[] attributesToRemove) 69static bool ShouldRemoveAttribute(AttributeData a, (INamedTypeSymbol[] attributesToRemove, ISymbol accessibleWithin) arg)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISymbolExtensions.cs (1)
15public static DeclarationModifiers GetSymbolModifiers(this ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (14)
86private static ITypeSymbol GetType(Compilation compilation, ISymbol symbol) 101this SyntaxGenerator generator, IMethodSymbol method, ISymbol throughMember) 116this SyntaxGenerator generator, ISymbol member, ISymbol throughMember) 180static SyntaxNode GenerateContainerName(SyntaxGenerator factory, ISymbol throughMember) 194ISymbol? throughMember, 233ISymbol? throughMember, 277private static bool TryGetValue(IDictionary<string, ISymbol>? dictionary, string key, [NotNullWhen(true)] out string? value) 280if (dictionary != null && dictionary.TryGetValue(key, out var symbol)) 289public static ImmutableArray<ISymbol> CreateFieldsForParameters( 292using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 311public static ImmutableArray<ISymbol> CreatePropertiesForParameters( 314using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 346IDictionary<string, ISymbol>? parameterToExistingFieldMap,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (9)
38ImmutableArray<ISymbol> symbols, 69ImmutableArray<ISymbol> symbols, 115ImmutableArray<ISymbol> members, 220ImmutableArray<ISymbol> members, SyntaxNode localNameExpression, 229foreach (var member in members) 277ImmutableArray<ISymbol> members) 456public static ImmutableArray<ISymbol> CreateMemberDelegatingConstructor( 464ImmutableDictionary<string, ISymbol>? parameterToExistingMemberMap, 496IDictionary<string, ISymbol>? parameterToExistingFieldMap)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (5)
22ImmutableArray<ISymbol> members, 33foreach (var member in members) 84ImmutableArray<ISymbol> members, 104foreach (var symbol in members) 221ISymbol member,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\FindSymbols\LinkedFileReferenceLocationEqualityComparer.cs (1)
11/// Helper comparer to enable consumers of <see cref="SymbolFinder.FindReferencesAsync(ISymbol, Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (5)
29protected abstract bool TryUpdateTupleAssignment(IBlockOperation? blockStatement, IParameterSymbol parameter, ISymbol fieldOrProperty, SyntaxEditor editor); 31Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken); 85ISymbol fieldOrProperty, 114ISymbol fieldOrProperty, 138ISymbol fieldOrProperty,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
22Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\InitializeParameterHelpersCore.cs (3)
80IParameterSymbol parameter, IBlockOperation? blockStatement, out ISymbol? fieldOrProperty) 147[NotNullWhen(true)] out ISymbol? fieldOrProperty) 169[NotNullWhen(true)] out ISymbol? fieldOrProperty)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (11)
32private static readonly Func<ISymbol, bool> s_LocalNameFilter = s => 75string baseName, Func<ISymbol, bool> filter, 92protected virtual IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode container, CancellationToken cancellationToken) 115var impl = type.FindImplementationForInterfaceMember(disposeMethodToLookFor); 198public ISymbol GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 228public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 237public ISymbol FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 240public ISymbol FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 243public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode node, SyntaxToken token, CancellationToken cancellationToken) 249public ImmutableArray<IMethodSymbol> GetLocalFunctionSymbols(Compilation compilation, ISymbol symbol, CancellationToken cancellationToken) 266public Task<ISymbol> GetInterceptorSymbolAsync(Document document, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\ISemanticFactsService.cs (1)
35Func<ISymbol, bool> filter, IEnumerable<string> usedNames, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SymbolDeclarationService\ISymbolDeclarationService.cs (1)
17ImmutableArray<SyntaxReference> GetDeclarations(ISymbol symbol);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
116protected static bool IsEnumHasFlag(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (4)
63public static ISymbol? GetOriginalSymbolInfo(SemanticModel semanticModel, SyntaxNode expression) 69var typeSymbol = SymbolAnnotation.GetSymbol(annotation1, semanticModel.Compilation); 93public static bool IsValidSymbolInfo([NotNullWhen(true)] ISymbol? symbol) 114internal static bool ShouldSimplifyThisOrMeMemberAccessExpression(SimplifierOptions options, ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (5)
17internal static ISymbol? FindSourceDefinition( 18ISymbol? symbol, Solution solution, CancellationToken cancellationToken) 41private static ISymbol? FindSourceDefinitionWorker( 42ISymbol symbol, 91static bool InSource([NotNullWhen(true)] ISymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\AsyncSymbolVisitor`1.cs (2)
14public override ValueTask<TResult> Visit(ISymbol? symbol) 17public override ValueTask<TResult> DefaultVisit(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (2)
29var declaredSymbol = semanticModel.GetRequiredDeclaredSymbol(declarationSyntax, cancellationToken); 55ISymbol symbol,
Utilities\Documentation\DeferredDocumentationProvider.cs (1)
33var symbol = DocumentationCommentId.GetFirstSymbolForDeclarationId(documentationMemberID, _compilation);
Workspace\Solution\Solution.cs (3)
201internal ProjectId? GetOriginatingProjectId(ISymbol symbol) 205internal Project? GetOriginatingProject(ISymbol symbol) 213internal Compilation? GetOriginatingCompilation(ISymbol symbol)
Workspace\Solution\SolutionCompilationState.CompilationTracker.CompilationTrackerState.cs (3)
137/// queried for (for example: <see cref="Solution.GetOriginatingProject(ISymbol)"/>. If <see 258var symbol = compilation.GetAssemblyOrModuleSymbol(metadataReference); 264private static void RecordSourceOfAssemblySymbol(ISymbol? assemblyOrModuleSymbol, ProjectId projectId)
Workspace\Solution\SolutionCompilationState.cs (4)
33private static readonly ConditionalWeakTable<ISymbol, ProjectId> s_assemblyOrModuleSymbolToProjectMap = new(); 55private ConditionalWeakTable<ISymbol, OriginatingProjectInfo?>? _unrootedSymbolToProjectId; 56private static readonly Func<ConditionalWeakTable<ISymbol, OriginatingProjectInfo?>> s_createTable = () => new ConditionalWeakTable<ISymbol, OriginatingProjectInfo?>();
Workspace\Solution\SolutionCompilationState.ICompilationTracker.cs (1)
34ISymbol symbol, bool primary,
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
104ISymbol symbol, bool primary,
Workspace\Solution\SolutionCompilationState.RootedSymbolSet.cs (4)
41/// A helper type for mapping <see cref="ISymbol"/> back to an originating <see cref="Project"/>/<see 45/// In IDE scenarios we have the need to map from an <see cref="ISymbol"/> to the <see cref="Project"/> that 79var symbol = compilation.GetAssemblyOrModuleSymbol(reference); 94ISymbol symbol, bool primary,
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (5)
56public OriginatingProjectInfo? GetOriginatingProjectInfo(ISymbol? symbol) 112private OriginatingProjectInfo? GetOriginatingProjectInfoWorker(ISymbol symbol) 131private OriginatingProjectInfo? GetOriginatingProjectInfoDirectly(ISymbol symbol, ConditionalWeakTable<ISymbol, OriginatingProjectInfo?> unrootedSymbolToProjectId) 189OriginatingProjectInfo? FindProject(ISymbol symbol, bool primary)
Workspace\Solution\SolutionCompilationState.WithFrozenSourceGeneratedDocumentsCompilationTracker.cs (1)
58ISymbol symbol, bool primary,
Microsoft.CodeAnalysis.Workspaces.UnitTests (48)
FindAllDeclarationsTests.cs (2)
184var actualSymbol = (await SymbolFinder.FindDeclarationsAsync(solution.GetProject(submission1Id), "Inner", ignoreCase: false)).SingleOrDefault(); 185var expectedSymbol = (await solution.GetProject(submission0Id).GetCompilationAsync()).GlobalNamespace.GetMembers("Outer").SingleOrDefault().GetMembers("Inner").SingleOrDefault();
FindAllDeclarationsTests.TestSolutionsAndProject.cs (3)
28private static void Verify(string searchTerm, bool respectCase, SolutionKind workspaceKind, IEnumerable<ISymbol> declarations, params string[] expectedResults) 45private static void Verify(SolutionKind workspaceKind, IEnumerable<ISymbol> declarations, params string[] expectedResults) 60private static void VerifyResults(IEnumerable<ISymbol> declarations, string[] expectedResults)
FindReferencesTests.cs (8)
104var symbol = (await project.GetCompilationAsync()).GetTypeByMetadataName("C").GetMembers("X").First(); 187var symbol = semanticModel.GetDeclaredSymbol(declareMethod); 223var symbol = semanticModel.GetDeclaredSymbol(propertyStatement); 291var symbol = semanticModel.GetDeclaredSymbol(declareMethod); 328var boo = typeB.GetMembers("Boo").First(); 437var nameProperty = compilation.GetTypeByMetadataName("A.C").GetMembers("Uri").Single(); 481var baseVirtualMethodSymbol = baseType.GetMembers("SomeMethod").Single(); 485var overriddenMethodSymbol = derivedType.GetMembers("SomeMethod").Single();
SymbolKeyTests.cs (30)
59foreach (var symbol in GetDeclaredSymbols(compilation)) 66static void Test(ISymbol symbol, Compilation compilation) 73static void TestVersion(ISymbol symbol, Compilation compilation, int version) 421var resolved = SymbolKey.ResolveString(key, compilation2).Symbol; 445var resolved = SymbolKey.ResolveString(key, compilation2).Symbol; 785var a_b_m = a_b.GetMembers().Single(s => s.Name == "M"); 793var a_string_b_m = a_string_b.GetMembers().Single(s => s.Name == "M"); 799var a_string_b_int_m = a_string_b_int.GetMembers().Single(s => s.Name == "M"); 807var a_b_int_m = a_b_int.GetMembers().Single(s => s.Name == "M"); 985foreach (var symbol in symbols) 1021var symbol = GetAllSymbols( 1058var symbol = GetAllSymbols( 1438IEnumerable<ISymbol> symbols, Compilation compilation, Func<ISymbol, object> fnId = null, bool useSymbolEquivalence = false) 1440foreach (var symbol in symbols) 1445ISymbol symbol, Compilation compilation, Func<ISymbol, object> fnId = null, bool useSymbolEquivalence = false) 1493private static List<ISymbol> GetAllSymbols( 1496var list = new List<ISymbol>(); 1503List<ISymbol> list, Func<SyntaxNode, bool> predicate) 1507var symbol = model.GetDeclaredSymbol(node); 1529private static List<ISymbol> GetDeclaredSymbols(Compilation compilation) 1531var list = new List<ISymbol>(); 1536private static void GetDeclaredSymbols(INamespaceOrTypeSymbol container, List<ISymbol> symbols) 1538foreach (var member in container.GetMembers()) 1549private static IEnumerable<ISymbol> GetInteriorSymbols(ISymbol containingSymbol, Compilation compilation) 1551var results = new List<ISymbol>(); 1569private static void GetInteriorSymbols(SemanticModel model, SyntaxNode root, List<ISymbol> symbols) 1573var symbol = model.GetDeclaredSymbol(token);
UtilityTest\DocumentationCommentIdTests.cs (5)
28var sym = DocumentationCommentId.GetFirstSymbolForDeclarationId(id, compilation); 33where TSymbol : ISymbol 35var symbol = DocumentationCommentId.GetFirstSymbolForDeclarationId(expectedId, compilation); 43where TSymbol : ISymbol 56var sym = DocumentationCommentId.GetSymbolsForReferenceId(id, compilation).FirstOrDefault();
Microsoft.DotNet.CodeAnalysis (1)
Helpers.cs (1)
33internal static string GetMemberName(ISymbol symbol)
Microsoft.Extensions.Logging.Generators (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
94private static SymbolVisibility GetResultantVisibility(this ISymbol symbol)
Microsoft.Extensions.Options.SourceGeneration (14)
Emitter.cs (1)
92ImmutableArray<ISymbol> members = validatorTypeSymbol.GetMembers("TryValidateValue");
Parser.cs (8)
186private static string GetFQN(ISymbol type) 189private static string GetMinimalFQN(ISymbol type) 192private static string GetMinimalFQNWithoutGenerics(ISymbol type) 198private static bool AlreadyImplementsValidateMethod(INamespaceOrTypeSymbol validatorType, ISymbol modelType) 293foreach (var member in members) 316private ValidatedMember? GetMemberInfo(ISymbol member, bool speculate, Location location, ITypeSymbol modelType, ITypeSymbol validatorType) 684private string? AddSynthesizedValidator(ITypeSymbol modelType, ISymbol member, Location location, ITypeSymbol validatorType) 761private bool CanValidate(ITypeSymbol validatorType, ISymbol modelType)
ParserUtilities.cs (4)
14internal static AttributeData? GetSymbolAttributeAnnotationOrDefault(ISymbol? attribute, ISymbol symbol) 33internal static bool PropertyHasModifier(ISymbol property, SyntaxKind modifierToSearch, CancellationToken token) 40internal static Location? GetLocation(this ISymbol symbol)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
94private static SymbolVisibility GetResultantVisibility(this ISymbol symbol)
Microsoft.Gen.ComplianceReports (1)
Parser.cs (1)
157Dictionary<string, ClassifiedItem>? ClassifyMember(Dictionary<string, ClassifiedItem>? classifiedMembers, ISymbol member, ITypeSymbol memberType)
Microsoft.Gen.ContextualOptions (2)
ContextReceiver.cs (1)
51.ToDictionary<IGrouping<ISymbol?, TypeDeclarationSyntax>, INamedTypeSymbol, List<TypeDeclarationSyntax>>(
ContextualOptionsGenerator.cs (1)
43.ToDictionary<IGrouping<ISymbol?, TypeDeclarationSyntax>, INamedTypeSymbol, List<TypeDeclarationSyntax>>(
Microsoft.Gen.Logging (16)
Parsing\Parser.cs (5)
65ISymbol? secondLoggerMember = null; 470private static List<INamedTypeSymbol> GetDataClassificationAttributes(ISymbol symbol, SymbolHolder symbols) 609var attrCtor = sm.GetSymbolInfo(methodAttr, _cancellationToken).Symbol; 620private (string? member, ISymbol? secondMember, bool isNullable) FindLoggerMember(SemanticModel sm, TypeDeclarationSyntax classDec, ITypeSymbol loggerSymbol) 647foreach (ISymbol ms in currentClassType.GetMembers())
Parsing\Parser.LogProperties.cs (1)
334bool CanLogProperties(ISymbol sym, ITypeSymbol symType, SymbolHolder symbols, bool silent = false)
Parsing\Parser.Records.cs (1)
54foreach (var m in members)
Parsing\Parser.TagProvider.cs (1)
182static bool IsProviderMethodVisible(ISymbol symbol)
Parsing\TypeSymbolExtensions.cs (2)
20foreach (var member in sym.GetMembers("ToString")) 43foreach (var member in sym.GetMembers("ToString"))
src\Generators\Shared\ParserUtilities.cs (4)
19internal static AttributeData? GetSymbolAttributeAnnotationOrDefault(ISymbol? attribute, ISymbol symbol) 38internal static bool PropertyHasModifier(ISymbol property, SyntaxKind modifierToSearch, CancellationToken token) 45internal static Location? GetLocation(this ISymbol symbol)
src\Generators\Shared\RoslynExtensions.cs (1)
143private static SymbolVisibility GetResultantVisibility(this ISymbol symbol)
src\Generators\Shared\SymbolHelpers.cs (1)
15public static string GetFullNamespace(ISymbol symbol)
Microsoft.Gen.Logging.Unit.Tests (19)
LogParserUtilitiesTests.cs (3)
51.Returns(ImmutableArray<ISymbol>.Empty); 87: ImmutableArray<ISymbol>.Empty); 169: ImmutableArray<ISymbol>.Empty);
ParserUtilitiesTests.cs (4)
48var symbolMock = new Mock<ISymbol>(); 69var symbolMock = new Mock<ISymbol>(); 90var symbolMock = new Mock<ISymbol>(); 105var symbolMock = new Mock<ISymbol>();
TypeSymbolExtensionsTests.cs (12)
48IEnumerable<ISymbol> methodSymbols = compilation.GetSymbolsWithName("M1", SymbolFilter.Member); 52ISymbol symbol = Assert.Single(methodSymbols); 92IEnumerable<ISymbol> methodSymbols = compilation.GetSymbolsWithName("M1", SymbolFilter.Member); 96ISymbol symbol = Assert.Single(methodSymbols); 136IEnumerable<ISymbol> methodSymbols = compilation.GetSymbolsWithName("M1", SymbolFilter.Member); 140ISymbol symbol = Assert.Single(methodSymbols); 184IEnumerable<ISymbol> methodSymbols = compilation.GetSymbolsWithName("M1", SymbolFilter.Member); 188ISymbol symbol = Assert.Single(methodSymbols); 227IEnumerable<ISymbol> methodSymbols = compilation.GetSymbolsWithName("M1", SymbolFilter.Member); 231ISymbol symbol = Assert.Single(methodSymbols); 271IEnumerable<ISymbol> methodSymbols = compilation.GetSymbolsWithName("M1", SymbolFilter.Member); 275ISymbol symbol = Assert.Single(methodSymbols);
Microsoft.Gen.MetadataExtractor (15)
src\Generators\Microsoft.Gen.ComplianceReports\Parser.cs (1)
157Dictionary<string, ClassifiedItem>? ClassifyMember(Dictionary<string, ClassifiedItem>? classifiedMembers, ISymbol member, ITypeSymbol memberType)
src\Generators\Microsoft.Gen.Metrics\Exceptions\TransitiveTypeCycleException.cs (2)
13public TransitiveTypeCycleException(ISymbol parent, INamedTypeSymbol namedType) 19public ISymbol Parent { get; }
src\Generators\Microsoft.Gen.Metrics\Parser.cs (8)
255private static bool TryGetTagNameFromAttribute(ISymbol symbol, SymbolHolder symbols, out string tagName) 336private string GetSymbolXmlCommentSummary(ISymbol symbol) 376var symbol = semanticModel.GetSymbolInfo(arg.Expression, _cancellationToken).Symbol; 636foreach (var member in strongTypeSymbol.GetMembers()) 676ISymbol member, 852ISymbol parentSymbol, 881foreach (var member in namedTypeSymbol.GetMembers()) 912foreach (var member in parentObjectBase.GetMembers())
src\Generators\Shared\ParserUtilities.cs (4)
19internal static AttributeData? GetSymbolAttributeAnnotationOrDefault(ISymbol? attribute, ISymbol symbol) 38internal static bool PropertyHasModifier(ISymbol property, SyntaxKind modifierToSearch, CancellationToken token) 45internal static Location? GetLocation(this ISymbol symbol)
Microsoft.Gen.Metrics (16)
Exceptions\TransitiveTypeCycleException.cs (2)
13public TransitiveTypeCycleException(ISymbol parent, INamedTypeSymbol namedType) 19public ISymbol Parent { get; }
Parser.cs (8)
255private static bool TryGetTagNameFromAttribute(ISymbol symbol, SymbolHolder symbols, out string tagName) 336private string GetSymbolXmlCommentSummary(ISymbol symbol) 376var symbol = semanticModel.GetSymbolInfo(arg.Expression, _cancellationToken).Symbol; 636foreach (var member in strongTypeSymbol.GetMembers()) 676ISymbol member, 852ISymbol parentSymbol, 881foreach (var member in namedTypeSymbol.GetMembers()) 912foreach (var member in parentObjectBase.GetMembers())
src\Generators\Shared\ParserUtilities.cs (4)
19internal static AttributeData? GetSymbolAttributeAnnotationOrDefault(ISymbol? attribute, ISymbol symbol) 38internal static bool PropertyHasModifier(ISymbol property, SyntaxKind modifierToSearch, CancellationToken token) 45internal static Location? GetLocation(this ISymbol symbol)
src\Generators\Shared\RoslynExtensions.cs (1)
143private static SymbolVisibility GetResultantVisibility(this ISymbol symbol)
src\Generators\Shared\SymbolHelpers.cs (1)
15public static string GetFullNamespace(ISymbol symbol)
Microsoft.Gen.MetricsReports (14)
src\Generators\Microsoft.Gen.Metrics\Exceptions\TransitiveTypeCycleException.cs (2)
13public TransitiveTypeCycleException(ISymbol parent, INamedTypeSymbol namedType) 19public ISymbol Parent { get; }
src\Generators\Microsoft.Gen.Metrics\Parser.cs (8)
255private static bool TryGetTagNameFromAttribute(ISymbol symbol, SymbolHolder symbols, out string tagName) 336private string GetSymbolXmlCommentSummary(ISymbol symbol) 376var symbol = semanticModel.GetSymbolInfo(arg.Expression, _cancellationToken).Symbol; 636foreach (var member in strongTypeSymbol.GetMembers()) 676ISymbol member, 852ISymbol parentSymbol, 881foreach (var member in namedTypeSymbol.GetMembers()) 912foreach (var member in parentObjectBase.GetMembers())
src\Generators\Shared\ParserUtilities.cs (4)
19internal static AttributeData? GetSymbolAttributeAnnotationOrDefault(ISymbol? attribute, ISymbol symbol) 38internal static bool PropertyHasModifier(ISymbol property, SyntaxKind modifierToSearch, CancellationToken token) 45internal static Location? GetLocation(this ISymbol symbol)
Microsoft.Interop.ComInterfaceGenerator (10)
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (1)
76var declaringType = editor.SemanticModel.GetDeclaredSymbol(node, ct);
Analyzers\GeneratedComInterfaceAttributeAnalyzer.cs (1)
76private static bool GetAttribute(ISymbol symbol, string attributeDisplayName, [NotNullWhen(true)] out AttributeData? attribute)
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (5)
53var methodsOfInterest = new Dictionary<ISymbol, ImmutableArray<Func<IInvocationOperation, (ITypeSymbol, Location)?>>>(SymbolEqualityComparer.Default); 64foreach (var createAggregatedObject in marshalType.GetMembers("CreateAggregatedObject")) 76foreach (var createWrapperOfType in marshalType.GetMembers("CreateWrapperOfType")) 92foreach (var getComInterfaceForObject in marshalType.GetMembers("GetComInterfaceForObject")) 137var getObjectForIUnknown = marshalType.GetMembers("GetObjectForIUnknown")[0];
ComMethodInfo.cs (1)
43foreach (var member in data.ifaceSymbol.GetMembers())
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
94private static SymbolVisibility GetResultantVisibility(this ISymbol symbol)
VtableIndexStubGenerator.cs (1)
324private static MarshallingInfo CreateExceptionMarshallingInfo(AttributeData virtualMethodIndexAttr, ISymbol symbol, Compilation compilation, GeneratorDiagnosticsBag diagnostics, VirtualMethodIndexCompilationData virtualMethodIndexData)
Microsoft.Interop.LibraryImportGenerator (3)
Analyzers\NativeMarshallingAttributeAnalyzer.cs (1)
165private static ITypeSymbol GetSymbolType(ISymbol symbol)
Analyzers\ShapeBreakingDiagnosticSuppressor.cs (1)
36ISymbol diagnosedSymbol = model.GetDeclaredSymbol(diagnostic.Location.SourceTree.GetRoot(context.CancellationToken).FindNode(diagnostic.Location.SourceSpan), context.CancellationToken);
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
94private static SymbolVisibility GetResultantVisibility(this ISymbol symbol)
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
94private static SymbolVisibility GetResultantVisibility(this ISymbol symbol)
Microsoft.Interop.SourceGeneration (7)
DiagnosticExtensions.cs (4)
13this ISymbol symbol, 21this ISymbol symbol, 117this ISymbol symbol, 125this ISymbol symbol,
ISymbolExtensions.cs (1)
23for (ISymbol current = symbol.ContainingSymbol; current is INamedTypeSymbol currentType; current = currentType.ContainingSymbol)
MarshallingAttributeInfo.cs (1)
33/// To support incremental generation, they must not include any types derived from <see cref="ISymbol"/>.
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
94private static SymbolVisibility GetResultantVisibility(this ISymbol symbol)
Microsoft.Maui.Controls.BindingSourceGen (15)
BindingSourceGenerator.cs (5)
235 var symbol = semanticModel.GetSymbolInfo(identifier).Symbol; 240 var symbol = semanticModel.GetSymbolInfo(elementAccess).Symbol; 245 var symbol = semanticModel.GetSymbolInfo(elementBinding).Symbol; 262 static bool IsWritable(ISymbol? symbol) 271 static bool AcceptsNullValue(ISymbol? symbol, bool enabledNullable)
InvocationParser.cs (2)
33 var symbol = _context.SemanticModel.GetSymbolInfo(invocation.Expression).Symbol; 65 var symbol = _context.SemanticModel.GetSymbolInfo(invocation.Expression).Symbol;
ISymbolExtensions.cs (4)
7 internal static bool IsAccessible(this ISymbol symbol) => 12 internal static AccessorKind ToAccessorKind(this ISymbol symbol) 22 internal static string GetIndexerName(this ISymbol? elementAccessSymbol) 51 AttributeData? GetAttribute(ISymbol symbol, string attributeName)
PathParser.cs (4)
45 var symbol = _context.SemanticModel.GetSymbolInfo(memberAccess).Symbol; 73 var elementAccessSymbol = _context.SemanticModel.GetSymbolInfo(elementAccess).Symbol; 118 var elementAccessSymbol = _context.SemanticModel.GetSymbolInfo(elementBinding).Symbol; 176 private Result<List<IPathPart>> CreateIndexAccess(ISymbol? elementAccessSymbol, ITypeSymbol? typeSymbol, SeparatedSyntaxList<ArgumentSyntax> argumentList, Location location)
Microsoft.ML.InternalCodeAnalyzer (4)
BaseTestClassAnalyzer.cs (1)
74foreach (var member in namedType.GetMembers())
BestFriendAnalyzer.cs (1)
77var symbol = model.GetSymbolInfo(node).Symbol;
NameFixProvider.cs (1)
107ISymbol typeSymbol = semanticModel.GetDeclaredSymbol(identifier, cancellationToken);
RelaxTestNamingSuppressor.cs (1)
45var declaredSymbol = semanticModel.GetDeclaredSymbol(node, context.CancellationToken);
Microsoft.VisualStudio.LanguageServices (211)
CallHierarchy\CallHierarchyItem.cs (1)
33ISymbol symbol,
CallHierarchy\CallHierarchyProvider.cs (5)
55ISymbol symbol, Project project, ImmutableArray<Location> callsites, CancellationToken cancellationToken) 80private static ISymbol GetTargetSymbol(ISymbol symbol) 100public async Task<ImmutableArray<AbstractCallFinder>> CreateFindersAsync(ISymbol symbol, Project project, CancellationToken cancellationToken) 128foreach (var implementedInterfaceMember in implementedInterfaceMembers)
CallHierarchy\Finders\AbstractCallFinder.cs (4)
34ISymbol symbol, 104var symbol = resolution.Symbol; 148protected virtual async Task SearchWorkerAsync(ISymbol symbol, Project project, ICallHierarchySearchCallback callback, IImmutableSet<Document> documents, CancellationToken cancellationToken) 180protected abstract Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken);
CallHierarchy\Finders\BaseMemberFinder.cs (2)
19public BaseMemberFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 27protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\CallToOverrideFinder.cs (3)
16public CallToOverrideFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 23protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken) 28foreach (var @override in overrides)
CallHierarchy\Finders\FieldReferenceFinder.cs (2)
17public FieldReferenceFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 30protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\ImplementerFinder.cs (4)
20public ImplementerFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 33protected override Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken) 36protected override async Task SearchWorkerAsync(ISymbol symbol, Project project, ICallHierarchySearchCallback callback, IImmutableSet<Document> documents, CancellationToken cancellationToken) 40foreach (var implementation in implementations)
CallHierarchy\Finders\InterfaceImplementationCallFinder.cs (2)
20public InterfaceImplementationCallFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 30protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\MethodCallFinder.cs (2)
18public MethodCallFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 33protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\OverridingMemberFinder.cs (4)
20public OverridingMemberFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 29protected override Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken) 32protected override async Task SearchWorkerAsync(ISymbol symbol, Project project, ICallHierarchySearchCallback callback, IImmutableSet<Document> documents, CancellationToken cancellationToken) 36foreach (var @override in overrides)
ChangeSignature\ChangeSignatureDialogViewModel.cs (1)
51ISymbol symbol,
ChangeSignature\VisualStudioChangeSignatureOptionsService.cs (1)
31ISymbol symbol,
CommonControls\MemberSelectionViewModel.cs (13)
22private readonly ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>>? _symbolToDependentsMap; 23private readonly ImmutableDictionary<ISymbol, MemberSymbolViewModel> _symbolToMemberViewMap; 28ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>>? dependentsMap, 133public ImmutableArray<(ISymbol member, bool makeAbstract)> GetSelectedMembers() 168private ImmutableHashSet<ISymbol> FindDependentsRecursively(ISymbol member) 170var queue = new Queue<ISymbol>(); 173var visited = new HashSet<ISymbol>(); 174var result = new HashSet<ISymbol>(); 179var currentMember = queue.Dequeue(); 184foreach (var dependent in _symbolToDependentsMap[currentMember].Result)
ExtractClass\ExtractClassViewModel.cs (2)
26ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> memberToDependentsMap,
ExtractClass\VisualStudioExtractClassOptionsService.cs (1)
44ImmutableArray<ISymbol> selectedMembers,
ExtractInterface\VisualStudioExtractInterfaceOptionsService.cs (1)
41ImmutableArray<ISymbol> extractableMembers,
F1Help\AbstractHelpContextService.cs (1)
46public abstract string? FormatSymbol(ISymbol symbol);
F1Help\IHelpContextService.cs (1)
20string? FormatSymbol(ISymbol symbol);
Implementation\ContainedLanguageRefactorNotifyService.cs (3)
35public bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure) 38public bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure) 71private static ContainedLanguageRenameType GetRenameType(ISymbol symbol)
Implementation\VsRefactorNotifyService.cs (5)
36public bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure) 73public bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure) 112ISymbol symbol, 131ISymbol symbol, 159private static bool TryGetRenamingRQNameForSymbol(ISymbol symbol, out string rqname)
Library\ClassView\AbstractSyncClassViewCommandHandler.cs (1)
88private static bool IsValidSymbolToSynchronize(ISymbol symbol)
Library\ObjectBrowser\AbstractDescriptionBuilder.cs (5)
200var symbol = memberListItem.ResolveTypedSymbol(compilation); 240private async Task BuildMemberOfAsync(ISymbol containingSymbol, CancellationToken cancellationToken) 283ISymbol symbol, Compilation compilation, CancellationToken cancellationToken) 441private static bool ShowReturnsDocumentation(ISymbol symbol) 447private static bool ShowValueDocumentation(ISymbol symbol)
Library\ObjectBrowser\AbstractListItemFactory.cs (18)
66protected abstract string GetMemberDisplayString(ISymbol memberSymbol); 67protected abstract string GetMemberAndTypeDisplayString(ISymbol memberSymbol); 69protected MemberListItem CreateFullyQualifiedMemberListItem(ISymbol memberSymbol, ProjectId projectId, bool hidden) 78protected MemberListItem CreateInheritedMemberListItem(ISymbol memberSymbol, ProjectId projectId, bool hidden) 81protected MemberListItem CreateSimpleMemberListItem(ISymbol memberSymbol, ProjectId projectId, bool hidden) 84private MemberListItem CreateMemberListItem(ISymbol memberSymbol, ProjectId projectId, bool hidden, bool isInherited) 131private static bool IncludeSymbol(ISymbol symbol) 137private static bool IncludeMemberSymbol(ISymbol symbol, IAssemblySymbol assemblySymbol) 172where TSymbol : class, ISymbol 187where TSymbol : class, ISymbol 316private static ImmutableArray<ISymbol> GetMemberSymbols(INamedTypeSymbol namedTypeSymbol, Compilation compilation) 319var symbolBuilder = ImmutableArray.CreateBuilder<ISymbol>(members.Length); 321foreach (var member in members) 332private static ImmutableArray<ISymbol> GetInheritedMemberSymbols(INamedTypeSymbol namedTypeSymbol, Compilation compilation) 334var symbolBuilder = ImmutableArray.CreateBuilder<ISymbol>(); 336HashSet<ISymbol> overriddenMembers = null; 374private static void AddOverriddenMembers(INamedTypeSymbol namedTypeSymbol, ref HashSet<ISymbol> overriddenMembers) 376foreach (var member in namedTypeSymbol.GetMembers())
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager.cs (2)
426var symbol = symbolListItem.ResolveSymbol(compilation); 543var symbol = symbolListItem.ResolveSymbol(compilation);
Library\ObjectBrowser\Extensions.cs (1)
29public static string GetMemberNavInfoNameOrEmpty(this ISymbol memberSymbol)
Library\ObjectBrowser\Lists\MemberListItem.cs (2)
10internal sealed class MemberListItem : SymbolListItem<ISymbol> 12internal MemberListItem(ProjectId projectId, ISymbol symbol, string displayText, string fullNameText, string searchText, bool isHidden, bool isInherited)
Library\ObjectBrowser\Lists\SymbolListItem.cs (2)
23protected SymbolListItem(ProjectId projectId, ISymbol symbol, string displayText, string fullNameText, string searchText, bool isHidden) 63public ISymbol ResolveSymbol(Compilation compilation)
Library\ObjectBrowser\Lists\SymbolListItem`1.cs (1)
10where TSymbol : ISymbol
Library\ObjectBrowser\ObjectList.cs (2)
686var symbol = symbolListItem.ResolveSymbol(compilation); 753var symbol = symbolItem.ResolveSymbol(compilation);
Library\VsNavInfo\NavInfoFactory.cs (3)
34public IVsNavInfo CreateForSymbol(ISymbol symbol, Project project, Compilation compilation, bool useExpandedHierarchy = false) 114public IVsNavInfo CreateForMember(ISymbol memberSymbol, Project project, Compilation compilation, bool useExpandedHierarchy = false) 239private string GetMemberName(ISymbol memberSymbol)
MoveStaticMembers\StaticMemberSelectionViewModel.cs (18)
18private readonly ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> _symbolToDependentsMap; 19private readonly ImmutableDictionary<ISymbol, SymbolViewModel<ISymbol>> _symbolToMemberViewMap; 23ImmutableArray<SymbolViewModel<ISymbol>> members, 24ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> dependentsMap) 32public ImmutableArray<SymbolViewModel<ISymbol>> CheckedMembers => Members.WhereAsArray(m => m.IsChecked); 34private ImmutableArray<SymbolViewModel<ISymbol>> _members; 35public ImmutableArray<SymbolViewModel<ISymbol>> Members 75private static void SelectMembers(ImmutableArray<SymbolViewModel<ISymbol>> members, bool isChecked = true) 83private ImmutableHashSet<ISymbol> FindDependents(ISymbol member) 85var queue = new Queue<ISymbol>(); 88var visited = new HashSet<ISymbol>(); 89var result = new HashSet<ISymbol>(); 94var currentMember = queue.Dequeue(); 97foreach (var dependent in _symbolToDependentsMap[currentMember].Result)
MoveStaticMembers\VisualStudioMoveStaticMembersOptionsService.cs (3)
41public MoveStaticMembersOptions GetMoveMembersToTypeOptions(Document document, INamedTypeSymbol selectedType, ImmutableArray<ISymbol> selectedNodeSymbols) 90ImmutableArray<ISymbol> selectedNodeSymbols, 100new SymbolViewModel<ISymbol>(member, glyphService)
PickMembers\PickMembersDialogViewModel.cs (1)
32ImmutableArray<ISymbol> members,
PickMembers\VisualStudioPickMembersService.cs (1)
28ImmutableArray<ISymbol> members,
Progression\GraphBuilder.cs (12)
38private readonly Dictionary<GraphNode, ISymbol> _nodeToSymbolMap = []; 133var symbol = symbolId.Value.Resolve(compilation, cancellationToken: cancellationToken).Symbol; 160public ProjectId GetContextProjectId(Project project, ISymbol symbol) 175public ISymbol GetSymbol(GraphNode node, CancellationToken cancellationToken) 179_nodeToSymbolMap.TryGetValue(node, out var symbol); 184public Task<GraphNode> AddNodeAsync(ISymbol symbol, GraphNode relatedNode, CancellationToken cancellationToken) 196ISymbol symbol, Project contextProject, Document contextDocument, CancellationToken cancellationToken) 213var newSymbol = SymbolFinder.FindSourceDefinition(symbol, contextProject.Solution, cancellationToken); 256internal static async Task<GraphNode> GetOrCreateNodeAsync(Graph graph, ISymbol symbol, Solution solution, CancellationToken cancellationToken) 323private static async Task<GraphNode> GetOrCreateNodeForLocalVariableAsync(Graph graph, ISymbol localSymbol, Solution solution, CancellationToken cancellationToken) 341private static void UpdateLabelsForNode(ISymbol symbol, Solution solution, GraphNode node) 432private static void UpdatePropertiesForNode(ISymbol symbol, GraphNode node)
Progression\GraphNodeCreation.cs (2)
19public static async Task<GraphNodeId> CreateNodeIdAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken) 60public static async Task<GraphNode> CreateNodeAsync(this Graph graph, ISymbol symbol, Solution solution, CancellationToken cancellationToken)
Progression\GraphNodeIdCreation.cs (7)
288public static async Task<GraphNodeId> GetIdForMemberAsync(ISymbol member, Solution solution, CancellationToken cancellationToken) 370private static IAssemblySymbol GetContainingAssembly(ISymbol symbol) 392private static async Task<Uri> GetAssemblyFullPathAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken) 468var containingSymbol = symbol.ContainingSymbol; 487internal static async Task<GraphNodeId> GetIdForLocalVariableAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken) 517private static async Task<int> GetLocalVariableIndexAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken) 543var current = semanticModel.GetDeclaredSymbol(node, cancellationToken);
Progression\GraphQueries\CallsGraphQuery.cs (6)
25var symbol = graphBuilder.GetSymbol(node, cancellationToken); 28foreach (var newSymbol in await GetCalledMethodSymbolsAsync(symbol, solution, cancellationToken).ConfigureAwait(false)) 41private static async Task<ImmutableArray<ISymbol>> GetCalledMethodSymbolsAsync( 42ISymbol symbol, Solution solution, CancellationToken cancellationToken) 44using var _ = ArrayBuilder<ISymbol>.GetInstance(out var symbols); 53var newSymbol = semanticModel.GetSymbolInfo(syntaxNode, cancellationToken).Symbol;
Progression\GraphQueries\ContainsChildrenGraphQuery.cs (1)
25var symbol = graphBuilder.GetSymbol(node, cancellationToken);
Progression\GraphQueries\ContainsGraphQuery.cs (3)
30var symbol = graphBuilder.GetSymbol(node, cancellationToken); 33foreach (var newSymbol in SymbolContainment.GetContainedSymbols(symbol)) 47foreach (var newSymbol in await SymbolContainment.GetContainedSymbolsAsync(document, cancellationToken).ConfigureAwait(false))
Progression\GraphQueries\ImplementedByGraphQuery.cs (2)
25var symbol = graphBuilder.GetSymbol(node, cancellationToken); 33foreach (var implementation in implementations)
Progression\GraphQueries\ImplementsGraphQuery.cs (4)
26var symbol = graphBuilder.GetSymbol(node, cancellationToken); 29var implementedSymbols = ImmutableArray<ISymbol>.CastUp(namedType.AllInterfaces); 47GraphBuilder graphBuilder, GraphNode node, ImmutableArray<ISymbol> implementedSymbols, CancellationToken cancellationToken) 49foreach (var interfaceType in implementedSymbols)
Progression\GraphQueries\InheritedByGraphQuery.cs (1)
23var symbol = graphBuilder.GetSymbol(node, cancellationToken);
Progression\GraphQueries\InheritsGraphQuery.cs (1)
29var symbol = graphBuilder.GetSymbol(node, cancellationToken);
Progression\GraphQueries\IsCalledByGraphQuery.cs (1)
26var symbol = graphBuilder.GetSymbol(node, cancellationToken);
Progression\GraphQueries\IsUsedByGraphQuery.cs (2)
26var symbol = graphBuilder.GetSymbol(node, cancellationToken); 31var referencedSymbol = reference.Definition;
Progression\GraphQueries\OverriddenByGraphQuery.cs (1)
21var symbol = graphBuilder.GetSymbol(node, cancellationToken);
Progression\GraphQueries\OverridesGraphQuery.cs (2)
24var symbol = graphBuilder.GetSymbol(node, cancellationToken); 30foreach (var o in overrides)
Progression\IProgressionLanguageService.cs (2)
15string GetDescriptionForSymbol(ISymbol symbol, bool includeContainingSymbol); 16string GetLabelForSymbol(ISymbol symbol, bool includeContainingSymbol);
Progression\SymbolContainment.cs (7)
30public static async Task<ImmutableArray<ISymbol>> GetContainedSymbolsAsync(Document document, CancellationToken cancellationToken) 34using var _ = ArrayBuilder<ISymbol>.GetInstance(out var symbols); 40var symbol = semanticModel.GetDeclaredSymbol(syntaxNode, cancellationToken); 52private static bool IsTopLevelSymbol(ISymbol symbol) 68public static IEnumerable<ISymbol> GetContainedSymbols(ISymbol symbol) 72foreach (var member in namedType.GetMembers())
ProjectSystem\AbstractEntryPointFinder.cs (1)
27foreach (var member in symbol.GetMembers())
ProjectSystem\VisualStudioWorkspace.cs (3)
64public abstract bool TryGoToDefinition(ISymbol symbol, Project project, CancellationToken cancellationToken); 65public abstract Task<bool> TryGoToDefinitionAsync(ISymbol symbol, Project project, CancellationToken cancellationToken); 67public abstract bool TryFindAllReferences(ISymbol symbol, Project project, CancellationToken cancellationToken);
PullMemberUp\MainDialog\PullMemberUpDialogViewModel.cs (4)
30private readonly ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> _symbolToDependentsMap; 37ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> dependentsMap)
PullMemberUp\SymbolDependentsBuilder.cs (9)
20public static ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> FindMemberToDependentsMap( 21ImmutableArray<ISymbol> membersInType, 36private readonly ImmutableHashSet<ISymbol> _membersInType; 39private readonly HashSet<ISymbol> _dependents = []; 40private readonly ISymbol _member; 44ImmutableArray<ISymbol> membersInType, 46ISymbol member, 56public async Task<ImmutableArray<ISymbol>> FindMemberDependentsAsync()
PullMemberUp\VisualStudioPullMemberUpService.cs (1)
40public PullMembersUpOptions GetPullMemberUpOptions(Document document, ImmutableArray<ISymbol> selectedMembers)
RQName\RQName.cs (1)
23public static string? From(ISymbol symbol)
Snippets\SnippetExpansionClient.cs (1)
758private static async Task<ImmutableArray<ISymbol>> GetReferencedSymbolsToLeftOfCaretAsync(
Utilities\MemberSymbolViewModel.cs (2)
14internal sealed class MemberSymbolViewModel : SymbolViewModel<ISymbol> 55public MemberSymbolViewModel(ISymbol symbol, IGlyphService glyphService) : base(symbol, glyphService)
Utilities\SymbolViewModel.cs (1)
12internal class SymbolViewModel<T> : AbstractNotifyPropertyChanged where T : ISymbol
Venus\ContainedLanguageCodeSupport.cs (10)
96var eventMember = GetEventSymbol(document, objectTypeName, nameOfEvent, type, cancellationToken); 170var eventMember = GetEventSymbol(thisDocument, objectTypeName, nameOfEvent, type, cancellationToken); 261var member = LookupMemberId(type, uniqueMemberID); 319var symbol = FindSymbol(document, clrt, oldFullyQualifiedName, cancellationToken); 360private static bool IncludeMember(ISymbol member, CODEMEMBERTYPE memberType, Compilation compilation) 410private static ISymbol FindSymbol( 445internal static string ConstructMemberId(ISymbol member) 461internal static ISymbol LookupMemberId(INamedTypeSymbol type, string uniqueMemberID) 466foreach (var m in members) 477private static ISymbol GetEventSymbol(
Workspace\VisualStudioSymbolNavigationService.cs (3)
51ISymbol symbol, Project project, CancellationToken cancellationToken) 128Project project, ISymbol symbol, CancellationToken cancellationToken) 184public async Task<bool> TrySymbolNavigationNotifyAsync(ISymbol symbol, Project project, CancellationToken cancellationToken)
Workspace\VisualStudioSymbolRenamedCodeActionOperationFactoryWorkspaceService.cs (3)
33public CodeActionOperation CreateSymbolRenamedOperation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution) 46private readonly ISymbol _symbol; 53ISymbol symbol,
Microsoft.VisualStudio.LanguageServices.CSharp (22)
CodeModel\CSharpCodeModelService.cs (9)
961var symbol = node is AttributeSyntax 992public override bool IsValidExternalSymbol(ISymbol symbol) 1011public override string GetExternalSymbolName(ISymbol symbol) 1021public override string GetExternalSymbolFullName(ISymbol symbol) 1031public override EnvDTE.vsCMAccess GetAccess(ISymbol symbol) 2513public override bool GetIsAbstract(SyntaxNode memberNode, ISymbol symbol) 2640public override bool GetIsShared(SyntaxNode memberNode, ISymbol symbol) 3601public override object GetFunctionExtender(string name, SyntaxNode node, ISymbol symbol) 3641public override object GetPropertyExtender(string name, SyntaxNode node, ISymbol symbol)
CodeModel\CSharpCodeModelService_Prototype.cs (3)
22public override string GetPrototype(SyntaxNode node, ISymbol symbol, PrototypeFlags flags) 556private static void AppendTypeNamePrototype(StringBuilder builder, bool includeNamespaces, bool includeGenerics, ISymbol symbol) 558using var _ = ArrayBuilder<ISymbol>.GetInstance(out var symbols);
LanguageService\CSharpHelpContextService.cs (2)
156ISymbol? symbol = null; 558public override string? FormatSymbol(ISymbol? symbol)
ObjectBrowser\DescriptionBuilder.cs (2)
127private void BuildAccessibility(ISymbol symbol) 236private void BuildMemberModifiers(ISymbol memberSymbol)
ObjectBrowser\ListItemFactory.cs (2)
30protected override string GetMemberDisplayString(ISymbol memberSymbol) 33protected override string GetMemberAndTypeDisplayString(ISymbol memberSymbol)
Progression\CSharpProgressionLanguageService.cs (4)
88public string GetDescriptionForSymbol(ISymbol symbol, bool includeContainingSymbol) 91public string GetLabelForSymbol(ISymbol symbol, bool includeContainingSymbol) 94private static string GetSymbolText(ISymbol symbol, bool includeContainingSymbol, SymbolDisplayFormat displayFormat) 113private static ITypeSymbol GetType(ISymbol symbol)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (3)
GlyphExtensionsTests.cs (3)
189var symbol = CreateSymbolMock(kind, declaredAccessibility, isExtensionMethod, methodKind, containingType, isConst, elementType, target, pointedAtType, isWithEvents, typeKind); 193private static ISymbol CreateSymbolMock( 206var symbolMock = new Mock<ISymbol>(MockBehavior.Strict);
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (6)
CodeModel\Mocks\MockVisualStudioWorkspace.vb (3)
68Public Overrides Function TryGoToDefinition(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Boolean 72Public Overrides Function TryGoToDefinitionAsync(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Task(Of Boolean) 76Public Overrides Function TryFindAllReferences(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Boolean
ProjectSystemShim\Framework\TestEnvironment.vb (3)
110Public Overrides Function TryGoToDefinition(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Boolean 114Public Overrides Function TryGoToDefinitionAsync(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Task(Of Boolean) 118Public Overrides Function TryFindAllReferences(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Boolean
Microsoft.VisualStudio.LanguageServices.UnitTests (8)
ExtractInterface\ExtractInterfaceViewModelTests.vb (1)
304Function(member As ISymbol) New MemberSymbolViewModel(member, Nothing))
MoveStaticMembers\MoveStaticMembersViewModelTest.vb (2)
54Private Shared Function FindMemberByName(name As String, memberArray As ImmutableArray(Of SymbolViewModel(Of ISymbol))) As SymbolViewModel(Of ISymbol)
Progression\GraphNodeIdTests.vb (2)
14Private Shared Async Function AssertMarkedNodeIdIsAsync(code As String, expectedId As String, Optional language As String = "C#", Optional symbolTransform As Func(Of ISymbol, ISymbol) = Nothing) As Task
Progression\ProgressionTestState.vb (3)
35Public Async Function GetGraphWithMarkedSymbolNodeAsync(Optional symbolTransform As Func(Of ISymbol, ISymbol) = Nothing) As Task(Of Graph) 77Public Function GetMarkedSymbolAsync() As Task(Of ISymbol)
Microsoft.VisualStudio.LanguageServices.VisualBasic (29)
CodeModel\MethodXML\MethodXmlBuilder.vb (7)
161Private Function TryGenerateExpression(expression As ExpressionSyntax, Optional symbolOpt As ISymbol = Nothing, Optional generateAttributes As Boolean = False) As Boolean 167Private Function TryGenerateExpressionSansTag(expression As ExpressionSyntax, Optional symbolOpt As ISymbol = Nothing, Optional generateAttributes As Boolean = False) As Boolean 320Protected Overrides Function GetVariableKind(symbol As ISymbol) As VariableKind 334Private Shared Function GetFullNameText(symbol As ISymbol) As String 348Optional symbolOpt As ISymbol = Nothing, 400Optional symbolOpt As ISymbol = Nothing, 426Private Sub GenerateLastNameRef(symbol As ISymbol)
CodeModel\VisualBasicCodeModelService.vb (8)
1384Public Overrides Function IsValidExternalSymbol(symbol As ISymbol) As Boolean 1412Public Overrides Function GetExternalSymbolName(symbol As ISymbol) As String 1420Public Overrides Function GetExternalSymbolFullName(symbol As ISymbol) As String 1428Public Overrides Function GetAccess(symbol As ISymbol) As EnvDTE.vsCMAccess 2804Public Overrides Function GetIsAbstract(memberNode As SyntaxNode, symbol As ISymbol) As Boolean 2905Public Overrides Function GetIsShared(memberNode As SyntaxNode, symbol As ISymbol) As Boolean 4165Public Overrides Function GetFunctionExtender(name As String, node As SyntaxNode, symbol As ISymbol) As Object 4190Public Overrides Function GetPropertyExtender(name As String, node As SyntaxNode, symbol As ISymbol) As Object
CodeModel\VisualBasicCodeModelService_Prototype.vb (3)
31Public Overrides Function GetPrototype(node As SyntaxNode, symbol As ISymbol, flags As PrototypeFlags) As String 80Private Shared Function GetFunctionPrototype(symbol As ISymbol, parameters As ImmutableArray(Of IParameterSymbol), flags As PrototypeFlags) As String 159Private Shared Sub AppendName(builder As StringBuilder, symbol As ISymbol, flags As PrototypeFlags)
Help\VisualBasicHelpContextService.vb (2)
86Public Overloads Overrides Function FormatSymbol(symbol As ISymbol) As String 90Private Overloads Shared Function FormatSymbol(symbol As ISymbol, isContainingType As Boolean) As String
ObjectBrowser\DescriptionBuilder.vb (2)
313Private Sub BuildAccessibility(symbol As ISymbol) 352Private Sub BuildMemberModifiers(memberSymbol As ISymbol)
ObjectBrowser\ListItemFactory.vb (2)
28Protected Overrides Function GetMemberAndTypeDisplayString(memberSymbol As ISymbol) As String 32Protected Overrides Function GetMemberDisplayString(memberSymbol As ISymbol) As String
Progression\VisualBasicProgressionLanguageService.vb (3)
67Public Function GetDescriptionForSymbol(symbol As ISymbol, includeContainingSymbol As Boolean) As String Implements IProgressionLanguageService.GetDescriptionForSymbol 77Public Function GetLabelForSymbol(symbol As ISymbol, includeContainingSymbol As Boolean) As String Implements IProgressionLanguageService.GetLabelForSymbol 81Private Shared Function GetSymbolText(symbol As ISymbol, includeContainingSymbol As Boolean, displayFormat As SymbolDisplayFormat) As String
Venus\ContainedLanguageStaticEventBinding.vb (2)
132Private Function GetMemberBlockOrBegin(member As ISymbol) As SyntaxNode 136Private Function GetMethodStatement(member As ISymbol) As MethodStatementSyntax
Microsoft.VisualStudio.LanguageServices.Xaml (9)
Features\Completion\IXamlCompletionService.cs (1)
17Task<ISymbol> GetSymbolAsync(XamlCompletionContext completionContext, string label, CancellationToken cancellationToken);
Features\Completion\XamlCompletionItem.cs (1)
27public ISymbol Symbol { get; set; }
Features\Definitions\XamlSymbolDefinition.cs (2)
14public ISymbol Symbol { get; } 16public XamlSymbolDefinition(ISymbol symbol)
Features\QuickInfo\XamlQuickInfo.cs (3)
19public ISymbol Symbol { get; } 24ISymbol symbol) 34ISymbol symbol = null)
Implementation\LanguageServer\Extensions\SymbolExtensions.cs (1)
21public static async Task<IEnumerable<TaggedText>> GetDescriptionAsync(this ISymbol symbol, TextDocument document, SymbolDescriptionOptions options, CancellationToken cancellationToken)
Implementation\LanguageServer\Handler\Definitions\GoToDefinitionHandler.cs (1)
159var symbol = symbolDefinition.Symbol;
Mvc.Api.Analyzers.Test (3)
SymbolApiConventionMatcherTest.cs (3)
451var method = testConvention.GetMembers(nameof(TestConvention.MethodWithoutMatchBehavior)).First(); 469var method = testConvention.GetMembers(nameof(TestConvention.MethodWithRandomAttributes)).First(); 487var method = testConvention.GetMembers(nameof(TestConvention.Get)).First();
Roslyn.Diagnostics.Analyzers (151)
AbstractDoNotCopyValue.cs (3)
236public sealed override void Visit(ISymbol? symbol) 241public override void DefaultVisit(ISymbol symbol) 1498private void CheckSymbolInUnsupportedContext(IOperation operation, ISymbol? symbol)
AbstractExposeMemberForTesting`1.cs (3)
57foreach (var member in containingType.GetMembers()) 94private static string GetTestAccessorName(ISymbol symbol) 110var member = containingType.GetMembers(memberName).First(m => m.GetDocumentationCommentId() == memberDocumentationCommentId);
DefaultableTypeShouldHaveDefaultableFieldsAnalyzer.cs (2)
64foreach (var member in namedType.GetMembers()) 106var sourceSymbol = (field.IsImplicitlyDeclared ? field.AssociatedSymbol : null) ?? field;
DoNotMixAttributesFromDifferentVersionsOfMEF.cs (1)
91foreach (var member in namedType.GetMembers())
RelaxTestNamingSuppressor.cs (1)
53var declaredSymbol = semanticModel.GetDeclaredSymbol(node, context.CancellationToken);
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (8)
28ISymbol symbol, 65public ISymbol Symbol { get; } 228public static Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, Compilation compilation, CancellationToken cancellationToken) 246public static Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, CodeMetricsAnalysisContext context) 265static async Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, CodeMetricsAnalysisContext context) 291public static CodeAnalysisMetricData ComputeSynchronously(ISymbol symbol, CodeMetricsAnalysisContext context) 325internal static async Task<ImmutableArray<CodeAnalysisMetricData>> ComputeAsync(IEnumerable<ISymbol> children, CodeMetricsAnalysisContext context) 333internal static ImmutableArray<CodeAnalysisMetricData> ComputeSynchronously(IEnumerable<ISymbol> children, CodeMetricsAnalysisContext context)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
51private static IEnumerable<ISymbol> GetMembers(INamedTypeSymbol namedType, CodeMetricsAnalysisContext context)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\ComputationalComplexityMetrics.cs (8)
28ImmutableHashSet<BinaryOperatorKind>.Empty, ImmutableHashSet<UnaryOperatorKind>.Empty, ImmutableHashSet<CaseKind>.Empty, ImmutableHashSet<ISymbol>.Empty, ImmutableHashSet<object>.Empty); 36private readonly ImmutableHashSet<ISymbol> _distinctReferencedSymbols; 49ImmutableHashSet<ISymbol> distinctReferencedSymbols, 75ImmutableHashSet<ISymbol> distinctReferencedSymbols, 101ImmutableHashSet<ISymbol>.Builder? distinctReferencedSymbolsBuilder = null; 296distinctReferencedSymbolsBuilder != null ? distinctReferencedSymbolsBuilder.ToImmutable() : ImmutableHashSet<ISymbol>.Empty, 341void countOperand(ISymbol? symbol) 347distinctReferencedSymbolsBuilder ??= ImmutableHashSet.CreateBuilder<ISymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (6)
65internal static long GetLinesOfCode(ImmutableArray<SyntaxReference> declarations, ISymbol symbol, CodeMetricsAnalysisContext context) 179internal static SyntaxNode GetTopmostSyntaxNodeForDeclaration(SyntaxReference declaration, ISymbol declaredSymbol, CodeMetricsAnalysisContext context) 196ISymbol symbol, 249var declaredSymbol = model.GetDeclaredSymbol(node, context.CancellationToken); 402internal static void RemoveContainingTypes(ISymbol symbol, ImmutableHashSet<INamedTypeSymbol>.Builder coupledTypesBuilder) 412internal static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol member)
src\RoslynAnalyzers\Utilities\Compiler\DiagnosticHelpers.cs (1)
65public static string GetMemberName(ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (2)
79this ISymbol symbol, 87this ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (5)
135/// "qualifying member" (<see cref="IsQualifyingMember(ISymbol)"/>) and no 136/// "disqualifying members" (<see cref="IsDisqualifyingMember(ISymbol)"/>). 165foreach (var member in symbol.GetMembers()) 195private static bool IsQualifyingMember(ISymbol member) 243private static bool IsDisqualifyingMember(ISymbol member)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (6)
503public static PooledHashSet<ISymbol> GetCaptures(this IOperation operation, IMethodSymbol lambdaOrLocalFunction) 510var builder = PooledHashSet<ISymbol>.GetInstance(); 543void ProcessLocalOrParameter(ISymbol symbol) 656public static ISymbol? GetReferencedMemberOrLocalOrParameter(this IOperation? operation) 912public static ValueUsageInfo GetValueUsageInfo(this IOperation operation, ISymbol containingSymbol) 1117public static RefKind GetRefKind(this IReturnOperation operation, ISymbol containingSymbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (59)
20public static bool IsType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 25public static bool IsAccessorMethod([NotNullWhen(returnValue: true)] this ISymbol? symbol) 31public static IEnumerable<IMethodSymbol> GetAccessors(this ISymbol symbol) 70public static bool IsDefaultConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 75public static bool IsPublic(this ISymbol symbol) 80public static bool IsProtected(this ISymbol symbol) 85public static bool IsPrivate(this ISymbol symbol) 90public static bool IsErrorType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 97public static bool IsConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 102public static bool IsDestructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 107public static bool IsIndexer([NotNullWhen(returnValue: true)] this ISymbol? symbol) 112public static bool IsPropertyWithBackingField([NotNullWhen(returnValue: true)] this ISymbol? symbol, [NotNullWhen(true)] out IFieldSymbol? backingField) 116foreach (ISymbol member in propertySymbol.ContainingType.GetMembers()) 139[NotNullWhen(returnValue: true)] this ISymbol? symbol, 156public static bool IsUserDefinedOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 161public static bool IsConversionOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 166public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol? symbol) 179public static bool IsExternallyVisible(this ISymbol symbol) => 182public static SymbolVisibility GetResultantVisibility(this ISymbol symbol) 229public static bool MatchMemberDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 239public static bool MatchMethodByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 244public static bool MatchPropertyDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 249public static bool MatchMemberByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 254public static bool MatchPropertyByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 259public static bool MatchFieldByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 283public static string FormatMemberName(this ISymbol member) 419public static bool IsFromMscorlib(this ISymbol symbol, Compilation compilation) 460public static bool IsImplementationOfAnyInterfaceMember(this ISymbol symbol) 465public static bool IsImplementationOfAnyImplicitInterfaceMember(this ISymbol symbol) 467return IsImplementationOfAnyImplicitInterfaceMember<ISymbol>(symbol); 473public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol) 474where TSymbol : ISymbol 496public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol, out TSymbol interfaceMember) 497where TSymbol : ISymbol 518public static bool IsImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 527public static bool IsOverrideOrImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 546/// <remarks>Requires that <see cref="ISymbol.IsOverride"/> is true for the given <paramref name="symbol"/>.</remarks> 547public static ISymbol GetOverriddenMember(this ISymbol symbol) 566public static bool IsImplementationOfAnyExplicitInterfaceMember([NotNullWhen(returnValue: true)] this ISymbol? symbol) 586public static ITypeSymbol? GetMemberOrLocalOrParameterType(this ISymbol symbol) 598public static ITypeSymbol? GetMemberType(this ISymbol? symbol) 614public static bool IsReadOnlyFieldOrProperty([NotNullWhen(returnValue: true)] this ISymbol? symbol) 626public static AttributeData? GetAttribute(this ISymbol symbol, [NotNullWhen(true)] INamedTypeSymbol? attributeType) 631public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, IEnumerable<INamedTypeSymbol?> attributesToMatch) 649public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 655public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1) 666public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1, INamedTypeSymbol? attributeTypeToMatch2) 679public static bool HasAnyAttribute(this ISymbol symbol, IEnumerable<INamedTypeSymbol> attributesToMatch) 684public static bool HasAnyAttribute(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 707public static bool HasAnyAttribute(this ISymbol symbol, [NotNullWhen(returnValue: true)] INamedTypeSymbol? attribute) 806public static bool[] HasAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributes) 826public static bool IsInSource(this ISymbol symbol) 831public static bool IsLambdaOrLocalFunction([NotNullWhen(returnValue: true)] this ISymbol? symbol) 839public static bool IsSymbolWithSpecialDiscardName([NotNullWhen(returnValue: true)] this ISymbol? symbol) 843public static bool IsConst([NotNullWhen(returnValue: true)] this ISymbol? symbol) 855public static bool IsReadOnly([NotNullWhen(returnValue: true)] this ISymbol? symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\UriExtensions.cs (2)
32public static bool SymbolNameContainsUriWordSubstring(this ISymbol symbol, CancellationToken cancellationToken) 58public static bool SymbolNameContainsUriWords(this ISymbol symbol, CancellationToken cancellationToken)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
55where TSymbol : ISymbol 99where TSymbol : ISymbol
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (18)
29private static bool TryGetSyntaxTreeForOption(ISymbol symbol, [NotNullWhen(returnValue: true)] out SyntaxTree? tree) 48ISymbol symbol, 66ISymbol symbol, 84ISymbol symbol, 117ISymbol symbol, 189ISymbol symbol, 254ISymbol symbol, 261ISymbol symbol, 262ISymbol containingContextSymbol, 298ISymbol symbol, 307ISymbol symbol, 317ISymbol symbol, 331ISymbol symbol, 380ISymbol symbol, 578ISymbol symbol, 593ISymbol symbol, 594ISymbol containingContextSymbol, 612ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolModifiers.cs (1)
38public static SymbolModifiers GetSymbolModifiers(this ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (15)
31private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 58private readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> _wildcardMatchResult = new(); 60private readonly ConcurrentDictionary<ISymbol, string> _symbolToDeclarationId = new(); 62private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 75_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 90var symbolsBuilder = PooledDictionary<ISymbol, TValue>.GetInstance(); 189static void ProcessSymbolName(NameParts parts, Compilation compilation, string? optionalPrefix, PooledDictionary<ISymbol, TValue> symbolsBuilder) 201foreach (var symbol in DocumentationCommentId.GetSymbolsForDeclarationId(nameWithPrefix, compilation)) 230public bool Contains(ISymbol symbol) 236public bool TryGetValue(ISymbol symbol, [MaybeNullWhen(false)] out TValue value) 266private bool TryGetFirstWildcardMatch(ISymbol symbol, [NotNullWhen(true)] out string? firstMatchName, [MaybeNullWhen(false)] out TValue firstMatchValue) 344static string GetDeclarationId(ISymbol symbol) 374internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 378internal ref readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> WildcardMatchResult => ref _symbolNamesWithValueOption._wildcardMatchResult; 380internal ref readonly ConcurrentDictionary<ISymbol, string> SymbolToDeclarationId => ref _symbolNamesWithValueOption._symbolToDeclarationId;
src\RoslynAnalyzers\Utilities\Compiler\SymbolDisplayStringCache.cs (2)
29private readonly ConcurrentDictionary<ISymbol, string> SymbolToDisplayNames = new(); 65public string GetDisplayString(ISymbol symbol)
SymbolDeclaredEventMustBeGeneratedForSourceSymbols.cs (4)
28private static readonly string s_fullNameOfSymbol = typeof(ISymbol).FullName; 83ISymbol symbolDeclaredEvent = compilationType.GetMembers(SymbolDeclaredEventName).FirstOrDefault(); 103ISymbol invocationSymbol = context.SemanticModel.GetSymbolInfo(context.Node, context.CancellationToken).Symbol; 132private bool AnalyzeSymbolDeclaredEventInvocation(ISymbol type)
TestExportsShouldNotBeDiscoverableCodeFixProvider.cs (1)
64var exportedType = semanticModel.GetDeclaredSymbol(declaration, cancellationToken);
Roslyn.Diagnostics.CSharp.Analyzers (4)
CSharpAvoidOptSuffixForNullableEnableCode.cs (2)
75var symbol = semanticModel.GetDeclaredSymbol(identifier.Parent, cancellationToken); 83private static bool ShouldReport(ISymbol symbol)
CSharpAvoidOptSuffixForNullableEnableCodeCodeFixProvider.cs (2)
45var variableSymbol = semanticModel.GetDeclaredSymbol(variable, context.CancellationToken); 66private static async Task<Solution> RemoveOptSuffixOnVariableAsync(Document document, ISymbol variableSymbol, string newName, CancellationToken cancellationToken)
Roslyn.Diagnostics.VisualBasic.Analyzers (1)
BasicInvokeTheCorrectPropertyToEnsureCorrectUseSiteDiagnostics.vb (1)
68Dim sym As ISymbol = context.SemanticModel.GetSymbolInfo(identifier, context.CancellationToken).Symbol
Roslyn.Test.PdbUtilities (6)
EditAndContinue\EditAndContinueTest.cs (2)
34protected abstract Func<SyntaxNode, SyntaxNode> GetEquivalentNodesMap(ISymbol left, ISymbol right);
EditAndContinue\SemanticEditDescription.cs (4)
12Func<Compilation, ISymbol> symbolProvider, 13Func<Compilation, ISymbol>? newSymbolProvider = null, 18public readonly Func<Compilation, ISymbol> SymbolProvider = symbolProvider; 19public readonly Func<Compilation, ISymbol> NewSymbolProvider = newSymbolProvider ?? symbolProvider;
SemanticSearch.BuildTask (8)
GenerateFilteredReferenceAssembliesTask.cs (8)
151apis.AddRange(((IEnumerable<ISymbol>)types).Concat(methods).Concat(fields).Select(GetDocumentationCommentSymbolName)); 282Func<ISymbol, bool> filter) 286void Recurse(IEnumerable<ISymbol> members) 288foreach (var member in members) 322private static string GetDocumentationCommentSymbolName(ISymbol symbol) 329private static bool IsIncluded(ISymbol symbol, ImmutableArray<ApiPattern> patterns) 349private static SymbolKindFlags GetKindFlags(ISymbol symbol) 432private static unsafe TSymbol? GetSymbolWithToken<TSymbol>(ImmutableArray<TSymbol> symbols, ref int symbolIndex, EntityHandle handle) where TSymbol : class, ISymbol
System.Private.CoreLib.Generators (11)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (11)
152foreach (var member in typeSymbol.GetMembers()) 190private static ISymbol? GetOperationSymbol(IOperation operation) 379private static IEnumerable<INamedTypeSymbol> GetCompExactlyDependsOnUseList(ISymbol symbol, IntrinsicsAnalyzerOnLoadData onLoadData) 397private static bool ConditionAllowsSymbol(ISymbol symbolOfInvokeTarget, INamedTypeSymbol namedTypeThatIsSafeToUse, IntrinsicsAnalyzerOnLoadData onLoadData) 447private static INamespaceSymbol? SymbolToNamespaceSymbol(ISymbol symbol) 453var symbol = GetOperationSymbol(operation); 489ISymbol? symbolThatMightHaveCompExactlyDependsOnAttribute = methodSymbol; 513ISymbol? attributeExplicitlyAllowsRelatedSymbol = null; 514ISymbol? attributeExplicitlyAllowsExactSymbol = null; 606HashSet<ISymbol> foundSymbols = new HashSet<ISymbol>(SymbolEqualityComparer.Default);
System.Text.Json.SourceGeneration (26)
Helpers\RoslynExtensions.cs (10)
28public static Location? GetLocation(this ISymbol typeSymbol) 119public static bool ContainsAttribute(this ISymbol memberInfo, INamedTypeSymbol? attributeType) 122public static bool IsVirtual(this ISymbol symbol) 213public static ITypeSymbol GetMemberType(this ISymbol member) 219public static bool IsOverriddenOrShadowedBy(this ISymbol member, ISymbol otherMember) 226public static bool MemberNameNeedsAtSign(this ISymbol symbol) 335private static bool IsOutputTypeNonNullable(this ISymbol symbol, ITypeSymbol returnType) 355private static bool IsInputTypeNonNullable(this ISymbol symbol, ITypeSymbol inputType) 377private static bool HasCodeAnalysisAttribute(this ISymbol symbol, string attributeName)
JsonSourceGenerator.Parser.cs (15)
926ImmutableArray<ISymbol> members = currentType.GetMembers(); 984ISymbol memberInfo, 1017bool PropertyIsOverriddenAndIgnored(IPropertySymbol property, Dictionary<string, ISymbol>? ignoredMembers) 1020ignoredMembers?.TryGetValue(property.Name, out ISymbol? ignoredMember) == true && 1029public Dictionary<string, (PropertyGenerationSpec, ISymbol, int index)> AddedProperties = new(options?.PropertyNameCaseInsensitive == true ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal); 1030public Dictionary<string, ISymbol>? IgnoredMembers; 1043ISymbol memberInfo, 1058(PropertyGenerationSpec other, ISymbol otherSymbol, int index) = state.AddedProperties[propertySpec.EffectiveJsonPropertyName]; 1077(state.IgnoredMembers?.TryGetValue(memberName, out ISymbol? ignored) == true && memberInfo.IsOverriddenOrShadowedBy(ignored)); 1117ISymbol memberInfo, 1231ISymbol memberInfo, 1333ISymbol memberInfo, 1562private TypeRef? GetConverterTypeFromJsonConverterAttribute(INamedTypeSymbol contextType, ISymbol declaringSymbol, AttributeData attributeData) 1577private TypeRef? GetConverterTypeFromAttribute(INamedTypeSymbol contextType, ITypeSymbol? converterType, ISymbol declaringSymbol, AttributeData attributeData) 1781private bool IsSymbolAccessibleWithin(ISymbol symbol, INamedTypeSymbol within)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
94private static SymbolVisibility GetResultantVisibility(this ISymbol symbol)
System.Text.RegularExpressions.Generator (7)
RegexGenerator.Parser.cs (1)
56ISymbol? regexMemberSymbol = context.TargetSymbol is IMethodSymbol or IPropertySymbol ? context.TargetSymbol : null;
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
94private static SymbolVisibility GetResultantVisibility(this ISymbol symbol)
UpgradeToGeneratedRegexAnalyzer.cs (2)
69ImmutableArray<ISymbol> allMembers = regexTypeSymbol.GetMembers(); 71foreach (ISymbol member in allMembers)
UpgradeToGeneratedRegexCodeFixer.cs (3)
115IEnumerable<ISymbol> members = GetAllMembers(typeSymbol); 242static IEnumerable<ISymbol> GetAllMembers(ITypeSymbol? symbol) 246foreach (ISymbol member in symbol.GetMembers())
System.Windows.Forms.PrivateSourceGenerators (1)
System\Windows\Forms\SourceGenerators\EnumValidationInfo.cs (1)
18foreach (ISymbol member in enumType.GetMembers())
Test.Utilities (113)
src\RoslynAnalyzers\Utilities\Compiler\DiagnosticHelpers.cs (1)
65public static string GetMemberName(ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (2)
79this ISymbol symbol, 87this ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (5)
135/// "qualifying member" (<see cref="IsQualifyingMember(ISymbol)"/>) and no 136/// "disqualifying members" (<see cref="IsDisqualifyingMember(ISymbol)"/>). 165foreach (var member in symbol.GetMembers()) 195private static bool IsQualifyingMember(ISymbol member) 243private static bool IsDisqualifyingMember(ISymbol member)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (6)
503public static PooledHashSet<ISymbol> GetCaptures(this IOperation operation, IMethodSymbol lambdaOrLocalFunction) 510var builder = PooledHashSet<ISymbol>.GetInstance(); 543void ProcessLocalOrParameter(ISymbol symbol) 656public static ISymbol? GetReferencedMemberOrLocalOrParameter(this IOperation? operation) 912public static ValueUsageInfo GetValueUsageInfo(this IOperation operation, ISymbol containingSymbol) 1117public static RefKind GetRefKind(this IReturnOperation operation, ISymbol containingSymbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (59)
20public static bool IsType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 25public static bool IsAccessorMethod([NotNullWhen(returnValue: true)] this ISymbol? symbol) 31public static IEnumerable<IMethodSymbol> GetAccessors(this ISymbol symbol) 70public static bool IsDefaultConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 75public static bool IsPublic(this ISymbol symbol) 80public static bool IsProtected(this ISymbol symbol) 85public static bool IsPrivate(this ISymbol symbol) 90public static bool IsErrorType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 97public static bool IsConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 102public static bool IsDestructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 107public static bool IsIndexer([NotNullWhen(returnValue: true)] this ISymbol? symbol) 112public static bool IsPropertyWithBackingField([NotNullWhen(returnValue: true)] this ISymbol? symbol, [NotNullWhen(true)] out IFieldSymbol? backingField) 116foreach (ISymbol member in propertySymbol.ContainingType.GetMembers()) 139[NotNullWhen(returnValue: true)] this ISymbol? symbol, 156public static bool IsUserDefinedOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 161public static bool IsConversionOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 166public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol? symbol) 179public static bool IsExternallyVisible(this ISymbol symbol) => 182public static SymbolVisibility GetResultantVisibility(this ISymbol symbol) 229public static bool MatchMemberDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 239public static bool MatchMethodByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 244public static bool MatchPropertyDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 249public static bool MatchMemberByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 254public static bool MatchPropertyByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 259public static bool MatchFieldByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 283public static string FormatMemberName(this ISymbol member) 419public static bool IsFromMscorlib(this ISymbol symbol, Compilation compilation) 460public static bool IsImplementationOfAnyInterfaceMember(this ISymbol symbol) 465public static bool IsImplementationOfAnyImplicitInterfaceMember(this ISymbol symbol) 467return IsImplementationOfAnyImplicitInterfaceMember<ISymbol>(symbol); 473public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol) 474where TSymbol : ISymbol 496public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol, out TSymbol interfaceMember) 497where TSymbol : ISymbol 518public static bool IsImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 527public static bool IsOverrideOrImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 546/// <remarks>Requires that <see cref="ISymbol.IsOverride"/> is true for the given <paramref name="symbol"/>.</remarks> 547public static ISymbol GetOverriddenMember(this ISymbol symbol) 566public static bool IsImplementationOfAnyExplicitInterfaceMember([NotNullWhen(returnValue: true)] this ISymbol? symbol) 586public static ITypeSymbol? GetMemberOrLocalOrParameterType(this ISymbol symbol) 598public static ITypeSymbol? GetMemberType(this ISymbol? symbol) 614public static bool IsReadOnlyFieldOrProperty([NotNullWhen(returnValue: true)] this ISymbol? symbol) 626public static AttributeData? GetAttribute(this ISymbol symbol, [NotNullWhen(true)] INamedTypeSymbol? attributeType) 631public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, IEnumerable<INamedTypeSymbol?> attributesToMatch) 649public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 655public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1) 666public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1, INamedTypeSymbol? attributeTypeToMatch2) 679public static bool HasAnyAttribute(this ISymbol symbol, IEnumerable<INamedTypeSymbol> attributesToMatch) 684public static bool HasAnyAttribute(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 707public static bool HasAnyAttribute(this ISymbol symbol, [NotNullWhen(returnValue: true)] INamedTypeSymbol? attribute) 806public static bool[] HasAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributes) 826public static bool IsInSource(this ISymbol symbol) 831public static bool IsLambdaOrLocalFunction([NotNullWhen(returnValue: true)] this ISymbol? symbol) 839public static bool IsSymbolWithSpecialDiscardName([NotNullWhen(returnValue: true)] this ISymbol? symbol) 843public static bool IsConst([NotNullWhen(returnValue: true)] this ISymbol? symbol) 855public static bool IsReadOnly([NotNullWhen(returnValue: true)] this ISymbol? symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\UriExtensions.cs (2)
32public static bool SymbolNameContainsUriWordSubstring(this ISymbol symbol, CancellationToken cancellationToken) 58public static bool SymbolNameContainsUriWords(this ISymbol symbol, CancellationToken cancellationToken)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
55where TSymbol : ISymbol 99where TSymbol : ISymbol
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (18)
29private static bool TryGetSyntaxTreeForOption(ISymbol symbol, [NotNullWhen(returnValue: true)] out SyntaxTree? tree) 48ISymbol symbol, 66ISymbol symbol, 84ISymbol symbol, 117ISymbol symbol, 189ISymbol symbol, 254ISymbol symbol, 261ISymbol symbol, 262ISymbol containingContextSymbol, 298ISymbol symbol, 307ISymbol symbol, 317ISymbol symbol, 331ISymbol symbol, 380ISymbol symbol, 578ISymbol symbol, 593ISymbol symbol, 594ISymbol containingContextSymbol, 612ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolModifiers.cs (1)
38public static SymbolModifiers GetSymbolModifiers(this ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (15)
31private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 58private readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> _wildcardMatchResult = new(); 60private readonly ConcurrentDictionary<ISymbol, string> _symbolToDeclarationId = new(); 62private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 75_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 90var symbolsBuilder = PooledDictionary<ISymbol, TValue>.GetInstance(); 189static void ProcessSymbolName(NameParts parts, Compilation compilation, string? optionalPrefix, PooledDictionary<ISymbol, TValue> symbolsBuilder) 201foreach (var symbol in DocumentationCommentId.GetSymbolsForDeclarationId(nameWithPrefix, compilation)) 230public bool Contains(ISymbol symbol) 236public bool TryGetValue(ISymbol symbol, [MaybeNullWhen(false)] out TValue value) 266private bool TryGetFirstWildcardMatch(ISymbol symbol, [NotNullWhen(true)] out string? firstMatchName, [MaybeNullWhen(false)] out TValue firstMatchValue) 344static string GetDeclarationId(ISymbol symbol) 374internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 378internal ref readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> WildcardMatchResult => ref _symbolNamesWithValueOption._wildcardMatchResult; 380internal ref readonly ConcurrentDictionary<ISymbol, string> SymbolToDeclarationId => ref _symbolNamesWithValueOption._symbolToDeclarationId;
src\RoslynAnalyzers\Utilities\Compiler\SymbolDisplayStringCache.cs (2)
29private readonly ConcurrentDictionary<ISymbol, string> SymbolToDisplayNames = new(); 65public string GetDisplayString(ISymbol symbol)
Text.Analyzers (140)
IdentifiersShouldBeSpelledCorrectly.cs (4)
307ISymbol symbol = symbolContext.Symbol; 369void ReportDiagnosticsForSymbol(ISymbol symbol, string symbolName, Action<Diagnostic> reportDiagnostic, bool checkForUnmeaningful = true) 485private static Diagnostic GetMisspelledWordDiagnostic(ISymbol symbol, string misspelledWord) 505private static Diagnostic GetUnmeaningfulIdentifierDiagnostic(ISymbol symbol, string symbolName)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (8)
28ISymbol symbol, 65public ISymbol Symbol { get; } 228public static Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, Compilation compilation, CancellationToken cancellationToken) 246public static Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, CodeMetricsAnalysisContext context) 265static async Task<CodeAnalysisMetricData> ComputeAsync(ISymbol symbol, CodeMetricsAnalysisContext context) 291public static CodeAnalysisMetricData ComputeSynchronously(ISymbol symbol, CodeMetricsAnalysisContext context) 325internal static async Task<ImmutableArray<CodeAnalysisMetricData>> ComputeAsync(IEnumerable<ISymbol> children, CodeMetricsAnalysisContext context) 333internal static ImmutableArray<CodeAnalysisMetricData> ComputeSynchronously(IEnumerable<ISymbol> children, CodeMetricsAnalysisContext context)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
51private static IEnumerable<ISymbol> GetMembers(INamedTypeSymbol namedType, CodeMetricsAnalysisContext context)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\ComputationalComplexityMetrics.cs (8)
28ImmutableHashSet<BinaryOperatorKind>.Empty, ImmutableHashSet<UnaryOperatorKind>.Empty, ImmutableHashSet<CaseKind>.Empty, ImmutableHashSet<ISymbol>.Empty, ImmutableHashSet<object>.Empty); 36private readonly ImmutableHashSet<ISymbol> _distinctReferencedSymbols; 49ImmutableHashSet<ISymbol> distinctReferencedSymbols, 75ImmutableHashSet<ISymbol> distinctReferencedSymbols, 101ImmutableHashSet<ISymbol>.Builder? distinctReferencedSymbolsBuilder = null; 296distinctReferencedSymbolsBuilder != null ? distinctReferencedSymbolsBuilder.ToImmutable() : ImmutableHashSet<ISymbol>.Empty, 341void countOperand(ISymbol? symbol) 347distinctReferencedSymbolsBuilder ??= ImmutableHashSet.CreateBuilder<ISymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (6)
65internal static long GetLinesOfCode(ImmutableArray<SyntaxReference> declarations, ISymbol symbol, CodeMetricsAnalysisContext context) 179internal static SyntaxNode GetTopmostSyntaxNodeForDeclaration(SyntaxReference declaration, ISymbol declaredSymbol, CodeMetricsAnalysisContext context) 196ISymbol symbol, 249var declaredSymbol = model.GetDeclaredSymbol(node, context.CancellationToken); 402internal static void RemoveContainingTypes(ISymbol symbol, ImmutableHashSet<INamedTypeSymbol>.Builder coupledTypesBuilder) 412internal static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol member)
src\RoslynAnalyzers\Utilities\Compiler\DiagnosticHelpers.cs (1)
65public static string GetMemberName(ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (2)
79this ISymbol symbol, 87this ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (5)
135/// "qualifying member" (<see cref="IsQualifyingMember(ISymbol)"/>) and no 136/// "disqualifying members" (<see cref="IsDisqualifyingMember(ISymbol)"/>). 165foreach (var member in symbol.GetMembers()) 195private static bool IsQualifyingMember(ISymbol member) 243private static bool IsDisqualifyingMember(ISymbol member)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (6)
503public static PooledHashSet<ISymbol> GetCaptures(this IOperation operation, IMethodSymbol lambdaOrLocalFunction) 510var builder = PooledHashSet<ISymbol>.GetInstance(); 543void ProcessLocalOrParameter(ISymbol symbol) 656public static ISymbol? GetReferencedMemberOrLocalOrParameter(this IOperation? operation) 912public static ValueUsageInfo GetValueUsageInfo(this IOperation operation, ISymbol containingSymbol) 1117public static RefKind GetRefKind(this IReturnOperation operation, ISymbol containingSymbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (59)
20public static bool IsType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 25public static bool IsAccessorMethod([NotNullWhen(returnValue: true)] this ISymbol? symbol) 31public static IEnumerable<IMethodSymbol> GetAccessors(this ISymbol symbol) 70public static bool IsDefaultConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 75public static bool IsPublic(this ISymbol symbol) 80public static bool IsProtected(this ISymbol symbol) 85public static bool IsPrivate(this ISymbol symbol) 90public static bool IsErrorType([NotNullWhen(returnValue: true)] this ISymbol? symbol) 97public static bool IsConstructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 102public static bool IsDestructor([NotNullWhen(returnValue: true)] this ISymbol? symbol) 107public static bool IsIndexer([NotNullWhen(returnValue: true)] this ISymbol? symbol) 112public static bool IsPropertyWithBackingField([NotNullWhen(returnValue: true)] this ISymbol? symbol, [NotNullWhen(true)] out IFieldSymbol? backingField) 116foreach (ISymbol member in propertySymbol.ContainingType.GetMembers()) 139[NotNullWhen(returnValue: true)] this ISymbol? symbol, 156public static bool IsUserDefinedOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 161public static bool IsConversionOperator([NotNullWhen(returnValue: true)] this ISymbol? symbol) 166public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol? symbol) 179public static bool IsExternallyVisible(this ISymbol symbol) => 182public static SymbolVisibility GetResultantVisibility(this ISymbol symbol) 229public static bool MatchMemberDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 239public static bool MatchMethodByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 244public static bool MatchPropertyDerivedByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 249public static bool MatchMemberByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 254public static bool MatchPropertyByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 259public static bool MatchFieldByName([NotNullWhen(returnValue: true)] this ISymbol? member, INamedTypeSymbol type, string name) 283public static string FormatMemberName(this ISymbol member) 419public static bool IsFromMscorlib(this ISymbol symbol, Compilation compilation) 460public static bool IsImplementationOfAnyInterfaceMember(this ISymbol symbol) 465public static bool IsImplementationOfAnyImplicitInterfaceMember(this ISymbol symbol) 467return IsImplementationOfAnyImplicitInterfaceMember<ISymbol>(symbol); 473public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol) 474where TSymbol : ISymbol 496public static bool IsImplementationOfAnyImplicitInterfaceMember<TSymbol>(this ISymbol symbol, out TSymbol interfaceMember) 497where TSymbol : ISymbol 518public static bool IsImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 527public static bool IsOverrideOrImplementationOfInterfaceMember(this ISymbol symbol, [NotNullWhen(returnValue: true)] ISymbol? interfaceMember) 546/// <remarks>Requires that <see cref="ISymbol.IsOverride"/> is true for the given <paramref name="symbol"/>.</remarks> 547public static ISymbol GetOverriddenMember(this ISymbol symbol) 566public static bool IsImplementationOfAnyExplicitInterfaceMember([NotNullWhen(returnValue: true)] this ISymbol? symbol) 586public static ITypeSymbol? GetMemberOrLocalOrParameterType(this ISymbol symbol) 598public static ITypeSymbol? GetMemberType(this ISymbol? symbol) 614public static bool IsReadOnlyFieldOrProperty([NotNullWhen(returnValue: true)] this ISymbol? symbol) 626public static AttributeData? GetAttribute(this ISymbol symbol, [NotNullWhen(true)] INamedTypeSymbol? attributeType) 631public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, IEnumerable<INamedTypeSymbol?> attributesToMatch) 649public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 655public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1) 666public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, INamedTypeSymbol? attributeTypeToMatch1, INamedTypeSymbol? attributeTypeToMatch2) 679public static bool HasAnyAttribute(this ISymbol symbol, IEnumerable<INamedTypeSymbol> attributesToMatch) 684public static bool HasAnyAttribute(this ISymbol symbol, params INamedTypeSymbol?[] attributeTypesToMatch) 707public static bool HasAnyAttribute(this ISymbol symbol, [NotNullWhen(returnValue: true)] INamedTypeSymbol? attribute) 806public static bool[] HasAttributes(this ISymbol symbol, params INamedTypeSymbol?[] attributes) 826public static bool IsInSource(this ISymbol symbol) 831public static bool IsLambdaOrLocalFunction([NotNullWhen(returnValue: true)] this ISymbol? symbol) 839public static bool IsSymbolWithSpecialDiscardName([NotNullWhen(returnValue: true)] this ISymbol? symbol) 843public static bool IsConst([NotNullWhen(returnValue: true)] this ISymbol? symbol) 855public static bool IsReadOnly([NotNullWhen(returnValue: true)] this ISymbol? symbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\UriExtensions.cs (2)
32public static bool SymbolNameContainsUriWordSubstring(this ISymbol symbol, CancellationToken cancellationToken) 58public static bool SymbolNameContainsUriWords(this ISymbol symbol, CancellationToken cancellationToken)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (2)
55where TSymbol : ISymbol 99where TSymbol : ISymbol
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (18)
29private static bool TryGetSyntaxTreeForOption(ISymbol symbol, [NotNullWhen(returnValue: true)] out SyntaxTree? tree) 48ISymbol symbol, 66ISymbol symbol, 84ISymbol symbol, 117ISymbol symbol, 189ISymbol symbol, 254ISymbol symbol, 261ISymbol symbol, 262ISymbol containingContextSymbol, 298ISymbol symbol, 307ISymbol symbol, 317ISymbol symbol, 331ISymbol symbol, 380ISymbol symbol, 578ISymbol symbol, 593ISymbol symbol, 594ISymbol containingContextSymbol, 612ISymbol symbol,
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolModifiers.cs (1)
38public static SymbolModifiers GetSymbolModifiers(this ISymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (15)
31private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 58private readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> _wildcardMatchResult = new(); 60private readonly ConcurrentDictionary<ISymbol, string> _symbolToDeclarationId = new(); 62private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 75_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 90var symbolsBuilder = PooledDictionary<ISymbol, TValue>.GetInstance(); 189static void ProcessSymbolName(NameParts parts, Compilation compilation, string? optionalPrefix, PooledDictionary<ISymbol, TValue> symbolsBuilder) 201foreach (var symbol in DocumentationCommentId.GetSymbolsForDeclarationId(nameWithPrefix, compilation)) 230public bool Contains(ISymbol symbol) 236public bool TryGetValue(ISymbol symbol, [MaybeNullWhen(false)] out TValue value) 266private bool TryGetFirstWildcardMatch(ISymbol symbol, [NotNullWhen(true)] out string? firstMatchName, [MaybeNullWhen(false)] out TValue firstMatchValue) 344static string GetDeclarationId(ISymbol symbol) 374internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 378internal ref readonly ConcurrentDictionary<ISymbol, KeyValuePair<string?, TValue?>> WildcardMatchResult => ref _symbolNamesWithValueOption._wildcardMatchResult; 380internal ref readonly ConcurrentDictionary<ISymbol, string> SymbolToDeclarationId => ref _symbolNamesWithValueOption._symbolToDeclarationId;
src\RoslynAnalyzers\Utilities\Compiler\SymbolDisplayStringCache.cs (2)
29private readonly ConcurrentDictionary<ISymbol, string> SymbolToDisplayNames = new(); 65public string GetDisplayString(ISymbol symbol)