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
6 implementations of 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
6856 references to ISymbol
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, 319 ISymbol owningSymbol,
TrimAnalysis\TrimDataFlowAnalysis.cs (1)
61 ISymbol owningSymbol,
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)
67private void ProcessEndpointParameterSource(Endpoint endpoint, ISymbol symbol, ImmutableArray<AttributeData> attributes, WellKnownTypes wellKnownTypes) 422private static bool TryGetExplicitFromJsonBody(ISymbol typeSymbol,
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.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 (452)
CodeGen\PermissionSetAttribute.cs (1)
84ISymbol iSymbol = _sourceAttribute.GetType(context).GetInternalSymbol()!.GetISymbol();
Compilation\Compilation.cs (14)
890public ISymbol? GetAssemblyOrModuleSymbol(MetadataReference reference) 895protected abstract ISymbol? CommonGetAssemblyOrModuleSymbol(MetadataReference reference); 898internal abstract TSymbol? GetSymbolInternal<TSymbol>(ISymbol? symbol) where TSymbol : class, ISymbolInternal; 1626ISymbol symbol, 1627ISymbol within, 1654void checkInCompilationReferences(ISymbol s, string parameterName) 1704bool isContainingAssemblyInReferences(ISymbol s) 1755ISymbol symbol, 1756ISymbol within, 3063Func<ISymbol, bool> isAddedSymbol, 3090Func<ISymbol, bool> isAddedSymbol, 3136Func<ISymbol, bool> isAddedSymbol, 3671public abstract IEnumerable<ISymbol> GetSymbolsWithName(Func<string, bool> predicate, SymbolFilter filter = SymbolFilter.TypeAndMember, CancellationToken cancellationToken = default(CancellationToken)); 3688public 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; 2841ISymbol declaredSymbol, 2874var declaredSymbolOfDeclInNode = declInNode.DeclaredSymbol ?? semanticModel.GetDeclaredSymbol(declInNode.DeclaredNode, cancellationToken); 2899private static bool IsEquivalentSymbol(ISymbol declaredSymbol, ISymbol? otherSymbol)
DiagnosticAnalyzer\AnalyzerExecutor.cs (24)
246ISymbol symbol, 357Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 372var symbol = symbolDeclaredEvent.Symbol; 410ISymbol processedMemberSymbol, 412Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 449Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 466Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 477var symbol = symbolDeclaredEvent.Symbol; 638ISymbol containingSymbol, 664ISymbol containingSymbol, 694ISymbol declaredSymbol, 731ISymbol declaredSymbol, 751ISymbol declaredSymbol, 874ISymbol declaredSymbol, 960ISymbol declaredSymbol, 984ISymbol containingSymbol, 1062ISymbol declaredSymbol, 1085ISymbol containingSymbol, 1125internal static bool CanHaveExecutableCodeBlock(ISymbol symbol) 1369private Action<Diagnostic> GetAddDiagnostic(ISymbol contextSymbol, ImmutableArray<SyntaxReference> cachedDeclaringReferences, DiagnosticAnalyzer analyzer, Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, CancellationToken cancellationToken) 1376ISymbol contextSymbol, 1383Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 1512private 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)
107ISymbol? 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.CodeStyle (545)
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 (3)
115foreach (var member in members) 139foreach (var member in namedType.GetMembers()) 243private 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)
42protected abstract bool ShouldIgnore(ISymbol symbol); 87var symbol = syntaxContext.SemanticModel.GetDeclaredSymbol(syntaxContext.Node, syntaxContext.CancellationToken); 113ISymbol symbol,
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
37protected 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)
45protected abstract bool CanMemberAccessBeQualified(ISymbol containingSymbol, SyntaxNode node); 147static bool IsStaticMemberOrIsLocalFunctionHelper(ISymbol symbol)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
751using var _ = PooledHashSet<ISymbol>.GetInstance(out var processedPartialSymbols);
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\SuppressMessageAttributeState.cs (1)
96out ImmutableArray<ISymbol> resolvedSymbols)
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (17)
89protected virtual void HandleNamedTypeSymbolStart(SymbolStartAnalysisContext context, Action<ISymbol, ValueUsageInfo> onSymbolUsageFound) 100private readonly Dictionary<ISymbol, ValueUsageInfo> _symbolValueUsageStateMap = []; 141private static Location GetDiagnosticLocation(ISymbol symbol) 206Action<ISymbol, ValueUsageInfo> onSymbolUsageFound = OnSymbolUsage; 259foreach (var member in namedType.GetMembers()) 278var symbol = symbolContext.Symbol.OriginalDefinition; 320private void OnSymbolUsage(ISymbol? memberSymbol, ValueUsageInfo usageInfo) 339private bool TryRemove(ISymbol memberSymbol, out ValueUsageInfo valueUsageInfo) 356var memberSymbol = memberReference.Member.OriginalDefinition; 455foreach (var symbol in symbolInfo.GetAllSymbols()) 484using var _1 = PooledHashSet<ISymbol>.GetInstance(out var symbolsReferencedInDocComments); 491foreach (var member in namedType.GetMembers()) 590ISymbol member, 632HashSet<ISymbol> builder, 714foreach (var member in namedTypeSymbol.GetMembers()) 729private void AddDebuggerDisplayAttributeArgumentsCore(ISymbol symbol, ArrayBuilder<string> builder) 755private bool IsCandidateSymbol([NotNullWhen(true)] ISymbol? memberSymbol)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (2)
270public bool IsComputingUnusedParams(ISymbol symbol) 275ISymbol 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)
123foreach (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)
35protected abstract (bool matched, bool canSimplify) TryMatchPattern(IConditionalOperation ifOperation, ISymbol containingSymbol);
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentDiagnosticAnalyzer.cs (1)
28protected override (bool matched, bool canSimplify) TryMatchPattern(IConditionalOperation ifOperation, ISymbol containingSymbol)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnDiagnosticAnalyzer.cs (1)
28protected sealed override (bool matched, bool canSimplify) TryMatchPattern(IConditionalOperation ifOperation, ISymbol containingSymbol)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\UseConditionalExpressionForReturnHelpers.cs (1)
16ISymbol 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)
115var leftSymbol = this.SemanticModel.GetSymbolInfo(leftMemberAccess, cancellationToken).GetAnySymbol(); 126if (IsExplicitlyImplemented(type, leftSymbol, out var typeMember)) 176ISymbol? member, 177[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)
107if (!TryDecomposeIfCondition(ifOperation, out var localOrParameter)) 139private static bool ValueIsAccessed(SemanticModel semanticModel, IConditionalOperation ifOperation, IBlockOperation containingBlock, ISymbol localOrParameter, IExpressionStatementOperation expressionStatement, IAssignmentOperation assignmentExpression) 168IBlockOperation containingBlock, IConditionalOperation ifOperation, ISymbol localOrParameter, 190if (!TryGetLocalOrParameterSymbol(assignmentExpression.Value, out var assignmentValue)) 210[NotNullWhen(true)] out ISymbol? localOrParameter) 242[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)
65public 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 (95)
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) 214public static INamedTypeSymbol? GetContainingTypeOrThis(this ISymbol symbol) 224public static bool IsErrorType([NotNullWhen(true)] this ISymbol? symbol) 227public static bool IsModuleType([NotNullWhen(true)] this ISymbol? symbol) 230public static bool IsInterfaceType([NotNullWhen(true)] this ISymbol? symbol) 233public static bool IsArrayType([NotNullWhen(true)] this ISymbol? symbol) 236public static bool IsTupleType([NotNullWhen(true)] this ISymbol? symbol) 239public static bool IsAnonymousFunction([NotNullWhen(true)] this ISymbol? symbol) 242public static bool IsKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind) 245public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind) 248public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind1, SymbolKind kind2) 254public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind1, SymbolKind kind2, SymbolKind kind3) 260public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, params SymbolKind[] kinds) 266public static bool IsReducedExtension([NotNullWhen(true)] this ISymbol? symbol) 269public static bool IsEnumMember([NotNullWhen(true)] this ISymbol? symbol) 272public static bool IsExtensionMethod(this ISymbol symbol) 275public static bool IsLocalFunction([NotNullWhen(true)] this ISymbol? symbol) 278public static bool IsAnonymousOrLocalFunction([NotNullWhen(true)] this ISymbol? symbol) 281public static bool IsModuleMember([NotNullWhen(true)] this ISymbol? symbol) 284public static bool IsConstructor([NotNullWhen(true)] this ISymbol? symbol) 287public static bool IsStaticConstructor([NotNullWhen(true)] this ISymbol? symbol) 290public static bool IsDestructor([NotNullWhen(true)] this ISymbol? symbol) 293public static bool IsUserDefinedOperator([NotNullWhen(true)] this ISymbol? symbol) 296public static bool IsConversion([NotNullWhen(true)] this ISymbol? symbol) 299public static bool IsOrdinaryMethod([NotNullWhen(true)] this ISymbol? symbol) 302public static bool IsOrdinaryMethodOrLocalFunction([NotNullWhen(true)] this ISymbol? symbol) 305public static bool IsDelegateType([NotNullWhen(true)] this ISymbol? symbol) 308public static bool IsAnonymousType([NotNullWhen(true)] this ISymbol? symbol) 311public static bool IsNormalAnonymousType([NotNullWhen(true)] this ISymbol? symbol) 314public static bool IsAnonymousDelegateType([NotNullWhen(true)] this ISymbol? symbol) 317public static bool IsAnonymousTypeProperty([NotNullWhen(true)] this ISymbol? symbol) 320public static bool IsTupleField([NotNullWhen(true)] this ISymbol? symbol) 323public static bool IsIndexer([NotNullWhen(true)] this ISymbol? symbol) 326public static bool IsWriteableFieldOrProperty([NotNullWhen(true)] this ISymbol? symbol) 334public static bool IsRequired([NotNullWhen(true)] this ISymbol? symbol) 337public static ITypeSymbol? GetMemberType(this ISymbol? symbol) 349public static int GetArity(this ISymbol symbol) 358public static ISymbol? GetOriginalUnreducedDefinition(this ISymbol? symbol) 401public static bool IsFunctionValue([NotNullWhen(true)] this ISymbol? symbol) 404public static bool IsThisParameter([NotNullWhen(true)] this ISymbol? symbol) 408public static ISymbol? ConvertThisParameterToType(this ISymbol? symbol) 418public static bool IsParams([NotNullWhen(true)] this ISymbol? symbol) 421public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol? symbol) 429public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 437public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 450public static ImmutableArray<ITypeSymbol> GetTypeArguments(this ISymbol? symbol) 458public static ImmutableArray<ITypeSymbol> GetAllTypeArguments(this ISymbol symbol) 473public static bool IsAttribute([NotNullWhen(true)] this ISymbol? symbol) 482public static bool RequiresUnsafeModifier([NotNullWhen(true)] this ISymbol? member) 489this ISymbol? symbol, 532public static bool IsStaticType([NotNullWhen(true)] this ISymbol? symbol) 535public static bool IsNamespace([NotNullWhen(true)] this ISymbol? symbol) 539[NotNullWhen(true)] this ISymbol? symbol, ISymbol withinType, IAssemblySymbol withinAssembly, CancellationToken cancellationToken) 559public static IEnumerable<IPropertySymbol> GetValidAnonymousTypeProperties(this ISymbol symbol) 565public static Accessibility ComputeResultantAccessibility(this ISymbol? symbol, ITypeSymbol finalDestination) 591public static bool IsInaccessibleLocal(this ISymbol symbol, int position) 609public static bool IsAccessor([NotNullWhen(true)] this ISymbol? symbol) 612public static bool IsPropertyAccessor([NotNullWhen(true)] this ISymbol? symbol) 615public static bool IsEventAccessor([NotNullWhen(true)] this ISymbol? symbol) 618public static bool IsFromSource(this ISymbol symbol) 621public static bool IsNonImplicitAndFromSource(this ISymbol symbol) 624public static ITypeSymbol? GetSymbolType(this ISymbol? symbol) 640public static bool IsAwaitableNonDynamic([NotNullWhen(true)] this ISymbol? symbol, SemanticModel semanticModel, int position) 779public static bool IsKind<TSymbol>(this ISymbol symbol, SymbolKind kind, [NotNullWhen(true)] out TSymbol? result) where TSymbol : class, ISymbol 796public static bool IsSymbolWithSpecialDiscardName(this ISymbol symbol) 805public static bool IsObsolete(this ISymbol symbol) 812public 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)
17this ISymbol symbol, 18ISymbol within, 39this ISymbol symbol, 51this ISymbol symbol, 64ISymbol symbol, 83ISymbol symbol, 84ISymbol within, // must be assembly or named type symbol 174private static bool IsNamedTypeAccessible(INamedTypeSymbol type, ISymbol within) 212ISymbol within) 247ISymbol within, 407ISymbol 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 (2)
18private readonly HashSet<ISymbol> _visited = []; 20public override void DefaultVisit(ISymbol node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (13)
403public static bool CanSupportCollectionInitializer(this ITypeSymbol typeSymbol, ISymbol within) 434public static IEnumerable<T> GetAccessibleMembersInBaseTypes<T>(this ITypeSymbol containingType, ISymbol within) where T : class, ISymbol 443public static ImmutableArray<T> GetAccessibleMembersInThisAndBaseTypes<T>(this ITypeSymbol? containingType, ISymbol within) where T : class, ISymbol 453public static ImmutableArray<T> GetAccessibleMembersInThisAndBaseTypes<T>(this ITypeSymbol? containingType, string memberName, ISymbol within) where T : class, ISymbol 498public static IEnumerable<T> SelectAccessibleMembers<T>(this IEnumerable<ITypeSymbol>? types, ISymbol within) where T : class, ISymbol 508private static IEnumerable<T> SelectAccessibleMembers<T>(this IEnumerable<ITypeSymbol>? types, string memberName, ISymbol within) where T : class, ISymbol 693foreach (var member in type.GetMembers()) 754public 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)
27public static ValueUsageInfo GetValueUsageInfo(this IOperation operation, ISymbol containingSymbol) 230public static RefKind GetRefKind(this IReturnOperation? operation, ISymbol containingSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (1)
136? EqualityComparer<ISymbol?>.Default.Equals(info1.Symbol, info2.Symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (11)
47public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 59public static ISymbol GetRequiredEnclosingSymbol(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 66where TSymbol : class, ISymbol 68for (var symbol = semanticModel.GetEnclosingSymbol(position, cancellationToken); 81public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 84(ISymbol)semanticModel.Compilation.Assembly; 93public static IEnumerable<ISymbol> GetExistingSymbols( 115public static HashSet<ISymbol> GetAllDeclaredSymbols( 118var symbols = new HashSet<ISymbol>(); 129HashSet<ISymbol> symbols, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 131var symbol = semanticModel.GetDeclaredSymbol(node, 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)
30private readonly Dictionary<ISymbol, PooledHashSet<IOperation>> _reachingWrites; 64public void Clear(ISymbol symbol) 76public void ForEachCurrentWrite<TArg>(ISymbol symbol, Action<IOperation, TArg> action, TArg arg) 88public bool ForEachCurrentWrite<TArg>(ISymbol symbol, Func<IOperation, TArg, bool> action, TArg arg) 106public void OnWriteReferenceFound(ISymbol symbol, IOperation operation, bool maybeWritten) 132foreach (var key in _reachingWrites.Keys) 225private 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)
24PooledDictionary<(ISymbol symbol, IOperation operation), bool> symbolsWriteMap, 25PooledHashSet<ISymbol> symbolsRead, 35protected override PooledHashSet<ISymbol> SymbolsReadBuilder { get; } 37protected override PooledDictionary<(ISymbol symbol, IOperation operation), bool> SymbolsWriteBuilder { get; } 42ISymbol owningSymbol, 47symbolsRead: PooledHashSet<ISymbol>.GetInstance(), 66public override void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId) 78public override void SetTargetsFromSymbolForDelegate(IOperation write, ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (13)
27private ISymbol _currentContainingSymbol; 30private PooledDictionary<IAssignmentOperation, PooledHashSet<(ISymbol, IOperation)>> _pendingWritesMap; 36ISymbol containingSymbol, 52private void Visit(ISymbol containingSymbol, IEnumerable<IOperation> operations, AnalysisData analysisData, CancellationToken cancellationToken) 59_pendingWritesMap = PooledDictionary<IAssignmentOperation, PooledHashSet<(ISymbol, IOperation)>>.GetInstance(); 91private void OnReadReferenceFound(ISymbol symbol) 94private void OnWriteReferenceFound(ISymbol symbol, IOperation operation, ValueUsageInfo valueUsageInfo) 102private void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId) 108private void OnReferenceFound(ISymbol symbol, IOperation operation) 160private bool MakePendingWrite(IOperation operation, ISymbol symbolOpt) 167var set = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 176set = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 408private void ProcessPossibleDelegateCreationAssignment(ISymbol symbol, IOperation write)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (6)
15ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 16ImmutableHashSet<ISymbol> symbolsRead) 35public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } = symbolWritesMap; 40public ImmutableHashSet<ISymbol> SymbolsRead { get; } = symbolsRead; 49public IEnumerable<(ISymbol Symbol, IOperation WriteOperation)> GetUnreadSymbolWrites() 73public int GetSymbolWriteCount(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (2)
21public static IdentifierNameParts CreateIdentifierNameParts(ISymbol symbol, ImmutableArray<NamingRule> rules) 37private static string RemovePrefixesAndSuffixes(ISymbol symbol, ImmutableArray<NamingRule> rules, string baseName)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (5)
20internal bool TryGetApplicableRule(ISymbol symbol, out NamingRule applicableRule) 39private bool IsSymbolNameAnalyzable(ISymbol symbol) 60private static bool DoesSymbolImplementAnotherSymbol(ISymbol symbol) 82private static bool IsInterfaceImplementation(ISymbol symbol) 95foreach (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)
67ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 92IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken); 97ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 98ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 100ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken); 107ImmutableArray<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)
20public static ImmutableArray<Location> GetBodyLevelSourceLocations(ISymbol symbol, CancellationToken cancellationToken) 39public static void Create(ISymbol symbol, SymbolKeyWriter visitor) 70var container = symbol.ContainingSymbol; 101private static SyntaxNode? TryGetContainerDeclaration(ISymbol container, SyntaxTree? syntaxTree, CancellationToken cancellationToken) 231var symbol = resolution.GetAnySymbol(); 255private static IEnumerable<(ISymbol symbol, int ordinal)> EnumerateSymbols( 264var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (31)
30/// the "same" <see cref="ISymbol.ContainingType"/> and 31/// equal <see cref="ISymbol.MetadataName"/>.</item> 33/// the "same" <see cref="ISymbol.ContainingType"/>, 34/// equal <see cref="ISymbol.MetadataName"/>, 40/// the "same" <see cref="ISymbol.ContainingAssembly"/>. 41/// <see cref="ISymbol.MetadataName"/> is not used because module identity is not important in practice.</item> 43/// the "same" <see cref="ISymbol.ContainingSymbol"/>, 44/// equal <see cref="ISymbol.MetadataName"/>, 48/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 49/// equal <see cref="ISymbol.MetadataName"/>. 54/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 55/// equal <see cref="ISymbol.MetadataName"/>.</item> 59/// the "same" the "same" <see cref="ISymbol.ContainingType"/>, 60/// the "same" <see cref="ISymbol.MetadataName"/>, and have 64/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 65/// the "same" <see cref="ISymbol.MetadataName"/>.</item> 67/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 68/// the "same" <see cref="ISymbol.MetadataName"/>.</item> 70/// the "same" <see cref="ISymbol.Name"/>.</item> 77/// cref="SyntaxTree"/> is enumerated to list all the symbols with the same <see cref="ISymbol.Name"/> and <see 78/// cref="ISymbol.Kind"/> as the original symbol. The symbol with the same index in the destination tree as the 128public static SymbolKey Create(ISymbol? symbol, CancellationToken cancellationToken = default) 147public 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)
64var containingContextualSymbol = containerKind switch 693 => (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)
58private readonly Action<ISymbol> _writeSymbolKey; 65private readonly Dictionary<ISymbol, int> _symbolToId = []; 129internal void WriteSymbolKey(ISymbol? symbol) 279where TSymbol : ISymbol 496public bool ShouldWriteTypeParameterOrdinal(ISymbol symbol, out int methodIndex)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
41using 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) 881private static bool IsAnonymousDelegateInvoke(ISymbol symbol) 897var symbol = originalSymbolInfo.Symbol; 898var newSymbol = newSymbolInfo.Symbol; 924for (var overriddenMember = newSymbol.GetOverriddenMember(); overriddenMember != null; overriddenMember = overriddenMember.GetOverriddenMember()) 975ISymbol symbol, 976ISymbol newSymbol, 1006var implementationMember = newSymbolContainingType.FindImplementationForInterfaceMember(symbol); 1053var receiverSymbol = semanticModel.GetSymbolInfo(receiver).GetAnySymbol(); 1063private bool SymbolsHaveCompatibleParameterLists(ISymbol originalSymbol, ISymbol newSymbol, TExpressionSyntax originalInvocation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (6)
27public bool HaveSameSignature(ISymbol symbol1, ISymbol symbol2, bool caseSensitive) 139public bool HaveSameSignatureAndConstraintsAndReturnTypeAndAccessors(ISymbol symbol1, ISymbol symbol2, bool caseSensitive) 154public bool HaveSameSignatureAndConstraintsAndReturnType(ISymbol symbol1, ISymbol symbol2, bool caseSensitive)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.cs (13)
39internal sealed partial class SymbolEquivalenceComparer : IEqualityComparer<ISymbol?> 153public bool Equals(ISymbol? x, ISymbol? y) 162public bool Equals(ISymbol? x, ISymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 168private bool EqualsCore(ISymbol? x, ISymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 171public int GetHashCode(ISymbol? x) 174private static ISymbol UnwrapAlias(ISymbol symbol) 177private static SymbolKind GetKindAndUnwrapAlias(ref ISymbol symbol) 195private static bool IsObjectType(ISymbol symbol) 220foreach (var candidate in errorType.CandidateSymbols)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (6)
21public bool AreEquivalent(ISymbol? x, ISymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 111private bool AreEquivalentWorker(ISymbol x, ISymbol y, SymbolKind k, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 271private 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 (224)
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
53var symbol = semanticModel.GetDeclaredSymbol(declarator, cancellationToken);
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AddAccessibilityModifiersHelpers.cs (2)
15SyntaxEditor editor, ISymbol symbol, SyntaxNode declaration) 41private 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)
114for (ISymbol current = symbol; current != null; current = current.ContainingSymbol)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
122protected static bool IsSymbolAccessible(ISymbol? symbol, SemanticDocument document)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (3)
57private ImmutableDictionary<string, ISymbol>? _parameterToExistingMemberMap; 406var definition = SymbolFinderInternal.FindSourceDefinition(original, _document.Project.Solution, cancellationToken); 464private 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) 349ISymbol symbol,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
30protected abstract bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (6)
345var previousAssignedSymbol = TryGetAssignedSymbol(symbolKind, children, statementindex - 1, cancellationToken); 346var nextAssignedSymbol = TryGetAssignedSymbol(symbolKind, children, statementindex + 1, cancellationToken); 361private ISymbol TryGetAssignedSymbol( 378var symbol = _document.SemanticModel.GetSymbolInfo(left, cancellationToken).Symbol; 393var symbol = semanticModel.GetEnclosingSymbol(position, cancellationToken); 407private 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)
98public ImmutableArray<ISymbol> ImplementInterfaceMember( 104ISymbol 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)
29private ImmutableArray<ISymbol> GeneratePropertyMembers( 57using var result = TemporaryArray<ISymbol>.Empty;
src\Analyzers\Core\CodeFixes\MakeTypePartial\AbstractMakeTypePartialCodeFixProvider.cs (1)
38var 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)
40protected abstract ICollection<ISymbol> GetMissingEnumMembers(TSwitchOperation switchOperation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
46protected 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)
60var method = semanticModel.GetDeclaredSymbol(methodDecl, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (12)
66public TDeclarationNode AddMembers<TDeclarationNode>(TDeclarationNode destination, IEnumerable<ISymbol> members, CodeGenerationContextInfo info, CancellationToken cancellationToken) 116public TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 141public abstract TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 272IEnumerable<ISymbol> members, 295IEnumerable<ISymbol> members, 302foreach (var member in members) 326IEnumerable<ISymbol> members, 334foreach (var member in members) 343private SyntaxNode? GetNewMember(TCodeGenerationContextInfo info, CodeGenerationDestination codeGenerationDestination, ISymbol member, CancellationToken cancellationToken) 359ISymbol member, 374private static bool GeneratingEnum(IEnumerable<ISymbol> members) 456public Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
24public bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (1)
51var containingSymbol = type.ContainingSymbol;
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)
86public static Task<Document> AddMemberDeclarationsAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken) 92public static bool CanAdd(Solution solution, ISymbol destination, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (4)
84TDeclarationNode AddMembers<TDeclarationNode>(TDeclarationNode destination, IEnumerable<ISymbol> members, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 124TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 174Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken); 179bool 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)
30public virtual ImmutableArray<ISymbol> GetMembers() 33public 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)
56public ISymbol FindImplementationForInterfaceMember(ISymbol interfaceMember) => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\SyntaxAnnotationExtensions.cs (1)
16where TSymbol : ISymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (2)
144this IMethodSymbol method, ISymbol accessibleWithin, 174static 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)
87private static ITypeSymbol GetType(Compilation compilation, ISymbol symbol) 102this SyntaxGenerator generator, IMethodSymbol method, ISymbol throughMember) 117this SyntaxGenerator generator, ISymbol member, ISymbol throughMember) 181static SyntaxNode GenerateContainerName(SyntaxGenerator factory, ISymbol throughMember) 195ISymbol? throughMember, 234ISymbol? throughMember, 278private static bool TryGetValue(IDictionary<string, ISymbol>? dictionary, string key, [NotNullWhen(true)] out string? value) 281if (dictionary != null && dictionary.TryGetValue(key, out var symbol)) 290public static ImmutableArray<ISymbol> CreateFieldsForParameters( 293using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 312public static ImmutableArray<ISymbol> CreatePropertiesForParameters( 315using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 347IDictionary<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)
12/// 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)
31private static readonly Func<ISymbol, bool> s_LocalNameFilter = s => 74string baseName, Func<ISymbol, bool> filter, 91protected virtual IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode container, CancellationToken cancellationToken) 114var impl = type.FindImplementationForInterfaceMember(disposeMethodToLookFor); 197public ISymbol GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 227public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 236public ISymbol FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 239public ISymbol FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 242public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode node, SyntaxToken token, CancellationToken cancellationToken) 248public 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)
119protected static bool IsEnumHasFlag(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (3)
64public static ISymbol? GetOriginalSymbolInfo(SemanticModel semanticModel, SyntaxNode expression) 94public static bool IsValidSymbolInfo([NotNullWhen(true)] ISymbol? symbol) 115internal 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, 3754Func<ISymbol, bool> isAddedSymbol, 3994protected override ISymbol? CommonGetAssemblyOrModuleSymbol(MetadataReference reference) 4598public override IEnumerable<ISymbol> GetSymbolsWithName(Func<string, bool> predicate, SymbolFilter filter = SymbolFilter.TypeAndMember, CancellationToken cancellationToken = default) 4640public 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); 1687private void AppendSymbolsWithName(ArrayBuilder<ISymbol> results, string name, Binder binder, NamespaceOrTypeSymbol container, LookupOptions options, LookupSymbolsInfo info) 1721ArrayBuilder<ISymbol> results, 2934public abstract ISymbol GetDeclaredSymbol(MemberDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)); 3016public abstract ISymbol GetDeclaredSymbol(BasePropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)); 3134public abstract ISymbol GetDeclaredSymbol(ArgumentSyntax declaratorSyntax, CancellationToken cancellationToken = default(CancellationToken)); 3159public abstract ISymbol GetDeclaredSymbol(VariableDeclaratorSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)); 3167public abstract ISymbol GetDeclaredSymbol(SingleVariableDesignationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)); 3221internal abstract ImmutableArray<ISymbol> GetDeclaredSymbols(BaseFieldDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)); 4093var symbols = ArrayBuilder<ISymbol>.GetInstance(); 4108private static ImmutableArray<IPropertySymbol> FilterOverriddenOrHiddenIndexers(ArrayBuilder<ISymbol> symbols) 4111foreach (ISymbol iSymbol in symbols) 4497var tupleElement = GetDeclaredSymbol(tupleArgument, cancellationToken); 4516var symbols = ArrayBuilder<ISymbol>.GetInstance(); 4518foreach (ISymbol invocationSym in containingInvocationInfo.CandidateSymbols) 4907public ISymbol GetEnclosingSymbol(int position) 4998private ImmutableArray<ISymbol> GetMemberGroupFromNode(SyntaxNode node, CancellationToken cancellationToken) 5012return ImmutableArray<ISymbol>.Empty; 5015protected sealed override ImmutableArray<ISymbol> GetMemberGroupCore(SyntaxNode node, CancellationToken cancellationToken) 5018return StaticCast<ISymbol>.From(methodGroup); 5076protected sealed override ISymbol GetDeclaredSymbolCore(SyntaxNode node, CancellationToken cancellationToken) 5152public ISymbol GetDeclaredSymbol(TupleElementSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 5164protected sealed override ImmutableArray<ISymbol> GetDeclaredSymbolsCore(SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)) 5183? ImmutableArray.Create<ISymbol>(namedType) 5184: ImmutableArray.Create<ISymbol>(namedType, primaryConstructor.GetPublicSymbol()); 5187var symbol = GetDeclaredSymbolCore(declaration, cancellationToken); 5190: ImmutableArray<ISymbol>.Empty; 5253internal override void ComputeDeclarationsInNode(SyntaxNode node, ISymbol associatedSymbol, bool getSymbol, ArrayBuilder<DeclarationInfo> builder, CancellationToken cancellationToken, int? levelsToCompute = null) 5258internal abstract override Func<SyntaxNode, bool> GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol); 5259internal abstract override bool ShouldSkipSyntaxNodeAnalysis(SyntaxNode node, ISymbol containingSymbol); 5261protected internal override SyntaxNode GetTopmostNodeForDiagnosticAnalysis(ISymbol symbol, SyntaxNode declaringSyntax) 5279protected sealed override ImmutableArray<ISymbol> LookupSymbolsCore(int position, INamespaceOrTypeSymbol container, string name, bool includeReducedExtensionMethods) 5284protected sealed override ImmutableArray<ISymbol> LookupBaseMembersCore(int position, string name) 5289protected sealed override ImmutableArray<ISymbol> LookupStaticMembersCore(int position, INamespaceOrTypeSymbol container, string name) 5294protected sealed override ImmutableArray<ISymbol> LookupNamespacesAndTypesCore(int position, INamespaceOrTypeSymbol container, string name) 5299protected sealed override ImmutableArray<ISymbol> LookupLabelsCore(int position, string name) 5400protected sealed override ISymbol GetEnclosingSymbolCore(int position, CancellationToken cancellationToken) 5429protected 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)) 1259var declaredSymbol = GetDeclaredSymbol(variableDecl); 1440public override ISymbol GetDeclaredSymbol(MemberDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1519public override ISymbol GetDeclaredSymbol(BasePropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1833public override ISymbol GetDeclaredSymbol(VariableDeclaratorSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1854public override ISymbol GetDeclaredSymbol(SingleVariableDesignationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1858ISymbol local = memberModel?.GetDeclaredSymbol(declarationSyntax, cancellationToken); 1988internal override ImmutableArray<ISymbol> GetDeclaredSymbols(BaseFieldDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1992var builder = new ArrayBuilder<ISymbol>(); 1996var field = this.GetDeclaredSymbol(declarator, cancellationToken) as ISymbol; 2148ISymbol parameterizedSymbol = null; 2405internal override Func<SyntaxNode, bool> GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol) 2515internal 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)
921private void AddMemberModifiersIfNeeded(ISymbol symbol) 1046private void AddExplicitInterfaceIfNeeded<T>(ImmutableArray<T> implementedMembers) where T : ISymbol
SymbolDisplay\SymbolDisplayVisitor.Types.cs (2)
275var containingSymbol = symbol.ContainingSymbol; 780private 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)
472protected sealed override ISymbol CreateISymbol()
Symbols\AssemblySymbol.cs (1)
1081protected override ISymbol CreateISymbol()
Symbols\DiscardSymbol.cs (1)
41protected override ISymbol CreateISymbol()
Symbols\DynamicTypeSymbol.cs (1)
237protected override ISymbol CreateISymbol()
Symbols\ErrorTypeSymbol.cs (1)
549protected sealed override ISymbol CreateISymbol()
Symbols\EventSymbol.cs (1)
323protected sealed override ISymbol CreateISymbol()
Symbols\FieldSymbol.cs (1)
508protected override ISymbol CreateISymbol()
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (1)
119protected override ISymbol CreateISymbol()
Symbols\FunctionTypeSymbol.cs (1)
144protected 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)
1691protected override ISymbol CreateISymbol()
Symbols\NamespaceSymbol.cs (1)
363protected sealed override ISymbol CreateISymbol()
Symbols\ParameterSymbol.cs (1)
444protected override ISymbol CreateISymbol()
Symbols\PointerTypeSymbol.cs (1)
299protected 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)
41bool ISymbol.IsDefinition 45return (object)this == ((ISymbol)this).OriginalDefinition; 49bool ISymbol.Equals(ISymbol other, CodeAnalysis.SymbolEqualityComparer equalityComparer) 110ISymbol 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)
34private ISymbol _lazyISymbol; 331ISymbol ISymbolInternal.GetISymbol() => this.ISymbol; 1803protected abstract ISymbol CreateISymbol(); 1805internal ISymbol ISymbol
Symbols\SymbolExtensions.cs (18)
384internal static Symbol? EnsureCSharpSymbolOrNull(this ISymbol? symbol, string paramName) 404return (AssemblySymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 410return (NamespaceOrTypeSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 416return (NamespaceSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 422return (TypeSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 428return (NamedTypeSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 434return (TypeParameterSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 440return (EventSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 557where TISymbol : class, ISymbol 563internal static ISymbol? GetPublicSymbol(this Symbol? symbol) 565return symbol.GetPublicSymbol<ISymbol>(); 688internal static IEnumerable<ISymbol?> GetPublicSymbols(this IEnumerable<Symbol?> symbols) 690return symbols.Select(p => p.GetPublicSymbol<ISymbol>()); 694where TISymbol : class, ISymbol 704internal static ImmutableArray<ISymbol> GetPublicSymbols(this ImmutableArray<Symbol> symbols) 706return GetPublicSymbols<ISymbol>(symbols); 765internal static TSymbol? GetSymbol<TSymbol>(this ISymbol? symbol) 772internal static Symbol? GetSymbol(this ISymbol? symbol)
Symbols\TypedConstantExtensions.cs (2)
83foreach (var member in members) 162foreach (var member in members)
Symbols\TypeParameterSymbol.cs (1)
702protected 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)
358ISymbol outSymbol, 393var 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)
82foreach (var member in structType.GetMembers())
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
102foreach (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)
147foreach (var symbol in symbolInfo.CandidateSymbols) 152ISymbol? 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)
55var 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)
185var symbol = semanticModel.GetSymbolInfo(binaryExpression, cancellationToken).Symbol; 202var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
287private static IEnumerable<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)
89foreach (var member in namedType.GetMembers())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (3)
370var symbol = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol; 437private static bool CanReplace(ISymbol symbol) 978var symbol = semanticModel.GetSymbolInfo(current, cancellationToken).Symbol ?? semanticModel.GetDeclaredSymbol(current, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
329var 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)
957foreach (var sym in type.GetMembers(opName)) 1096var symbol = semanticModel.GetDeclaredSymbol(variableDeclarator, cancellationToken); 1198var oldSymbolInfo = originalSemanticModel.GetSymbolInfo(currentOld, cancellationToken).Symbol; 1199var newSymbolInfo = rewrittenSemanticModel.GetSymbolInfo(currentNew, cancellationToken).Symbol; 1251var originalMemberSymbol = originalSemanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol; 1256var rewrittenMemberSymbol = rewrittenSemanticModel.GetSymbolInfo(rewrittenMemberAccessExpression, cancellationToken).Symbol; 1322var implementationMember = rewrittenContainingType.FindImplementationForInterfaceMember(originalMemberSymbol); 1336for (var current = rewrittenMemberSymbol; current != null; current = current.GetOverriddenMember()) 1360var originalMemberSymbol = originalSemanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol; 1365var rewrittenMemberSymbol = rewrittenSemanticModel.GetSymbolInfo(rewrittenMemberAccessExpression, cancellationToken).Symbol; 1372private static bool IsComplementaryDelegateInvoke(ISymbol originalMemberSymbol, ISymbol rewrittenMemberSymbol) 1435ISymbol originalMemberSymbol, ISymbol rewrittenMemberSymbol, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (4)
568var originalSymbol = this.OriginalSemanticModel.GetSymbolInfo(ctorInitializer, CancellationToken).Symbol; 569var newSymbol = this.SpeculativeSemanticModel.GetSymbolInfo(newCtorInitializer, CancellationToken).Symbol; 575var originalSymbol = this.OriginalSemanticModel.GetCollectionInitializerSymbolInfo(originalInitializer, CancellationToken).Symbol; 576var 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)
51protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (1)
37protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateMethodService.cs (1)
44protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
349var previousSymbol = semanticModel.GetSymbolInfo(nodeToReplace, cancellationToken).Symbol;
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
106var symbol = model.GetEnclosingSymbol(node.Span.Start, cancellationToken);
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (4)
31ImmutableArray<ISymbol> captures, 43ImmutableArray<ISymbol> captures, 208private 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)
173var symbol = model.GetSymbolInfo(assignment.Left, cancellationToken).Symbol; 215var 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)
105ImmutableArray<ISymbol> members, 142IList<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)
40protected override IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode container, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSymbolDeclarationService.cs (1)
24public ImmutableArray<SyntaxReference> GetDeclarations(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (4)
1988var memberSymbol = GetDeclaredMemberSymbolFromOriginalSemanticModel(declaration); 2042var symbol = GetDeclaredMemberSymbolFromOriginalSemanticModel(declaration); 2051private ISymbol GetDeclaredMemberSymbolFromOriginalSemanticModel(SyntaxNode declarationInCurrentTree) 2207private 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)
37ISymbol fieldOrProperty, 99ISymbol fieldOrProperty,
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
322var symbol = symbolInfo.Symbol;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (58)
Diagnostics\FixAllProvider\BatchFixerTests.cs (1)
51var symbol = context.SemanticModel.GetSymbolInfo(node).Symbol;
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (9)
41Func<Compilation, ISymbol> symbolMatcher, 81Func<Compilation, ISymbol> symbolMatcher, 103ISymbol symbol, 123ISymbol symbol, 188protected static Task<(Project, ISymbol)> CompileAndFindSymbolAsync( 193Func<Compilation, ISymbol> symbolMatcher, 203protected static async Task<(Project, ISymbol)> CompileAndFindSymbolAsync( 208Func<Compilation, ISymbol> symbolMatcher, 232var symbol = symbolMatcher(mainCompilation);
PdbSourceDocument\NullResultMetadataAsSourceFileProvider.cs (1)
41public 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)
593ISymbol sym1 = comp1.Assembly; 594ISymbol sym2 = comp2.Assembly; 622ISymbol assembly1 = compilation1.Assembly; 623ISymbol assembly2 = compilation2.Assembly; 666ISymbol sym1 = comp1.Assembly; 667ISymbol sym2 = comp2.Assembly; 671var 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 (63)
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)
350var symbol = symbolDeclaredEvent.Symbol; 1011static void analyzeNode(SyntaxNode node, ISymbol containingSymbol, Action<Diagnostic> reportDiagnostic)
FlowAnalysis\FlowTestBase.cs (1)
227protected 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\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)
455var initializer = model.GetSymbolInfo(initializerSyntax.Value).Symbol!; 481var outVar = model.GetDeclaredSymbol(outVarSyntax)!; 2491var symbol = model.GetSymbolInfo(x).Symbol; 21192var symbol = model.GetSymbolInfo(x).Symbol; 21422var symbol = model.GetSymbolInfo(x).Symbol; 21651var symbol = model.GetSymbolInfo(x).Symbol; 21740var symbol = model.GetSymbolInfo(x).Symbol; 22127var symbol = model.GetSymbolInfo(x).Symbol; 24691var symbol = model.GetSymbolInfo(x).Symbol; 24726var symbol = model.GetSymbolInfo(x).Symbol; 24760var symbol = model.GetSymbolInfo(x).Symbol; 24795var symbol = model.GetSymbolInfo(x).Symbol;
Microsoft.CodeAnalysis.CSharp.Features (289)
AddImport\CSharpAddImportFeatureService.cs (2)
283private static bool InfoBoundSuccessfully(ISymbol operation) 524var containingNamespaceSymbol = semanticModel.GetDeclaredSymbol(namespaceToAddTo);
ChangeSignature\CSharpChangeSignatureService.cs (14)
115public override async Task<(ISymbol? symbol, int selectedIndex)> GetInvocationSymbolAsync( 165var typeSymbol = semanticModel.GetSymbolInfo(objectCreation.Type, cancellationToken).Symbol; 291ISymbol declarationSymbol, 516ISymbol declarationSymbol, 553ISymbol declarationSymbol, 694ISymbol declarationSymbol, 715ISymbol declarationSymbol, 731ISymbol declarationSymbol, 771ISymbol declarationSymbol, 790private ImmutableArray<SyntaxNode> VerifyAndPermuteParamNodes(IEnumerable<XmlElementSyntax> paramNodes, ISymbol declarationSymbol, SignatureChange updatedSignature) 850public override async Task<ImmutableArray<ISymbol>> DetermineCascadedSymbolsFromDelegateInvokeAsync( 868var convertedType = (ISymbol?)semanticModel.GetTypeInfo(node, cancellationToken).ConvertedType; 924protected 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)
148ISymbol symbol, SyntaxContext context) 156public 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)
37protected override async Task<ISymbol> GenerateMemberAsync( 41ISymbol member,
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.ItemGetter.cs (3)
133bool FilterInterfaceMember(ISymbol member) 161CompletionItem CreateCompletionItem(ISymbol member) 182private 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)
123CompletionContext context, int position, SemanticModel semanticModel, ImmutableArray<ISymbol> unnamedSymbols, CancellationToken cancellationToken) 133foreach (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)
192public override ImmutableArray<ISymbol> FilterOverrides(ImmutableArray<ISymbol> members, ITypeSymbol? returnType)
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (3)
83foreach (var member in members) 135static ImmutableArray<ISymbol> GetCandidatePropertiesAndFields(Document document, SemanticModel semanticModel, int position, ITypeSymbol? type) 145private 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)
107var 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)
211async Task<ImmutableHashSet<(ISymbol fieldOrProperty, EqualsValueClauseSyntax initializer)>> GetExistingAssignedFieldsOrPropertiesAsync() 229using 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 (23)
180internal override MemberBody? TryGetDeclarationBody(SyntaxNode node, ISymbol? symbol) 183internal override bool IsDeclarationWithSharedBody(SyntaxNode declaration, ISymbol member) 189protected override IEnumerable<SyntaxNode> GetVariableUseSites(IEnumerable<SyntaxNode> roots, ISymbol localOrParameter, SemanticModel model, CancellationToken cancellationToken) 945internal override bool IsConstructorWithMemberInitializers(ISymbol symbol, CancellationToken cancellationToken) 997protected override SyntaxNode? GetSymbolDeclarationSyntax(ISymbol symbol, Func<ImmutableArray<SyntaxReference>, SyntaxReference?> selector, CancellationToken cancellationToken) 1022protected override ISymbol? GetDeclaredSymbol(SemanticModel model, SyntaxNode declaration, CancellationToken cancellationToken) 1035protected override OneOrMany<(ISymbol? oldSymbol, ISymbol? newSymbol)> GetEditedSymbols( 1055OneOrMany<(ISymbol? oldSymbol, ISymbol? newSymbol)> AddFieldSymbolUpdates(SeparatedSyntaxList<VariableDeclaratorSyntax> oldVariables, SeparatedSyntaxList<VariableDeclaratorSyntax> newVariables) 1070var oldSymbol = (oldNode != null) ? GetSymbolForEdit(oldNode, oldModel!, cancellationToken) : null; 1071var newSymbol = (newNode != null) ? GetSymbolForEdit(newNode, newModel, cancellationToken) : null; 1074? OneOrMany<(ISymbol?, ISymbol?)>.Empty 1079ref TemporaryArray<(ISymbol?, ISymbol?, EditKind)> result, 1082ISymbol? oldSymbol, 1084ISymbol? newSymbol, 1095var oldContainingMemberOrType = GetParameterContainingMemberOrType(oldNode, newNode, oldModel, topMatch.ReverseMatches, cancellationToken); 1096var newContainingMemberOrType = GetParameterContainingMemberOrType(newNode, oldNode, newModel, topMatch.Matches, cancellationToken); 1392private ISymbol? GetSymbolForEdit( 1429private ISymbol? GetParameterContainingMemberOrType(SyntaxNode? node, SyntaxNode? otherNode, SemanticModel? model, IReadOnlyDictionary<SyntaxNode, SyntaxNode> fromOtherMap, CancellationToken cancellationToken) 2516internal override void ReportInsertedMemberSymbolRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, ISymbol newSymbol, SyntaxNode newNode, bool insertingIntoExistingContainingType)
EditAndContinue\DeclarationBody\CopyConstructorDeclarationBody.cs (1)
45public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\CSharpLambdaBody.cs (1)
35public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\FieldWithInitializerDeclarationBody.cs (1)
33public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\OrdinaryInstanceConstructorWithExplicitInitializerDeclarationBody.cs (1)
29public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\OrdinaryInstanceConstructorWithImplicitInitializerDeclarationBody.cs (1)
26public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\PrimaryConstructorWithExplicitInitializerDeclarationBody.cs (1)
41public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\PrimaryConstructorWithImplicitInitializerDeclarationBody.cs (1)
41public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\PropertyOrIndexerAccessorDeclarationBody.cs (1)
76public sealed override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\TopLevelCodeDeclarationBody.cs (1)
29public 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)
56protected override bool IsReadOutside(ISymbol symbol, HashSet<ISymbol> readOutsideMap)
Formatting\CSharpAccessibilityModifiersNewDocumentFormattingProvider.cs (1)
68var type = semanticModel.GetDeclaredSymbol(declaration, cancellationToken);
GenerateType\CSharpGenerateTypeService.cs (3)
201var leftSymbol = semanticModel.GetSymbolInfo(((MemberAccessExpressionSyntax)nameOrMemberAccessExpression).Expression, cancellationToken).Symbol; 249var leftSymbol = semanticModel.GetSymbolInfo(parent.Left, cancellationToken).Symbol; 441var 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)
33protected override bool CheckMemberCanBeConverted(ISymbol member) 45protected override Task UpdateReferencesAsync(Project project, SolutionEditor solutionEditor, ISymbol implMember, INamedTypeSymbol containingType, CancellationToken cancellationToken) 48protected 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)
28ImmutableArray<ISymbol> fieldsOrProperties, 77ISymbol fieldOrProperty, 136static (ISymbol? symbol, SyntaxNode? syntax, CodeGenerationContext context) GetAddContext<TSymbol>( 137Compilation 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 (5)
67foreach (var member in type.GetMembers()) 171private static ISymbol? GetType(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 179private static bool IsAccessor(ISymbol member) 192Solution solution, ISymbol member, SyntaxTree tree, CancellationToken cancellationToken) 207Solution solution, ISymbol symbol, SyntaxTree tree, CancellationToken cancellationToken)
QuickInfo\CSharpSemanticQuickInfoProvider.cs (1)
86protected override NullableFlowState GetNullabilityAnalysis(SemanticModel semanticModel, ISymbol symbol, SyntaxNode node, CancellationToken cancellationToken)
Rename\CSharpRenameIssuesService.cs (2)
25SemanticModel semanticModel, ISymbol symbol, SyntaxToken triggerToken, [NotNullWhen(true)] out string? langError) 40var symbolForVar = semanticModel.GetSpeculativeSymbolInfo(
SignatureHelp\AttributeSignatureHelpProvider.cs (3)
130ISymbol within, 161IList<ISymbol> namedParameters, 175var 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)
358ISymbol outSymbol, 393var 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)
82foreach (var member in structType.GetMembers())
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
102foreach (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)
147foreach (var symbol in symbolInfo.CandidateSymbols) 152ISymbol? 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)
55var 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)
185var symbol = semanticModel.GetSymbolInfo(binaryExpression, cancellationToken).Symbol; 202var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
287private static IEnumerable<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)
89foreach (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)
51protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (1)
37protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateMethodService.cs (1)
44protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
349var previousSymbol = semanticModel.GetSymbolInfo(nodeToReplace, cancellationToken).Symbol;
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
106var symbol = model.GetEnclosingSymbol(node.Span.Start, cancellationToken);
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (4)
31ImmutableArray<ISymbol> captures, 43ImmutableArray<ISymbol> captures, 208private 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)
173var symbol = model.GetSymbolInfo(assignment.Left, cancellationToken).Symbol; 215var 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)
25public override ImmutableArray<SyntaxNode> GetDeclarators(ISymbol method)
EditAndContinue\Helpers\EditingTestBase.cs (4)
108internal static SemanticEditDescription SemanticEdit(SemanticEditKind kind, Func<Compilation, ISymbol> symbolProvider, SyntaxMapDescription.Mapping? syntaxMap, IEnumerable<RuntimeRudeEditDescription>? rudeEdits = null, string? partialType = null) 111internal static SemanticEditDescription SemanticEdit(SemanticEditKind kind, Func<Compilation, ISymbol> symbolProvider, IEnumerable<(TextSpan, TextSpan)>? syntaxMap, IEnumerable<RuntimeRudeEditDescription>? rudeEdits = null, string? partialType = null) 114internal static SemanticEditDescription SemanticEdit(SemanticEditKind kind, Func<Compilation, ISymbol> symbolProvider, string? partialType = null, bool preserveLocalVariables = false, Func<Compilation, ISymbol>? deletedSymbolContainerProvider = null)
ExtractClass\ExtractClassTests.cs (2)
3109ImmutableArray<ISymbol> selectedMembers, 3115IEnumerable<(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)
10397var symbol = model.GetDeclaredSymbol(variable); 14399var 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)
855var sym = model.GetSymbolInfo(expr).Symbol; 3008ISymbol symbol = model.GetSymbolInfo(b).Symbol; 3630static string getAttributesInternal(LambdaExpressionSyntax expr, ISymbol symbol) 3636static string getAttributesPublic(LambdaExpressionSyntax expr, ISymbol symbol) 3951var symbol = model.GetSymbolInfo(attributeSyntax).Symbol; 4094var symbol = model.GetSymbolInfo(expr).Symbol; 8122var constSymbol = model.GetDeclaredSymbol(decls[0].Declaration.Variables.Single()); 8128var defaultValueSymbol = model.GetSymbolInfo(defaultValue).Symbol; 8133var 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)
2597var symbol = model.GetSymbolInfo(x).Symbol; 2632var symbol = model.GetSymbolInfo(x).Symbol; 2666var symbol = model.GetSymbolInfo(x).Symbol; 2701var symbol = model.GetSymbolInfo(x).Symbol; 5856var initializer = model.GetSymbolInfo(initializerSyntax.Value).Symbol!; 5892var outVar = model.GetDeclaredSymbol(outVarSyntax)!;
Semantics\RefFieldTests.cs (4)
16594var method = model.GetSymbolInfo(anonymousMethod).Symbol; 16633var method = model.GetSymbolInfo(anonymousMethod).Symbol; 16777var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 29395var 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; 3131var symbol = model.GetSymbolInfo(syntax).Symbol; 3615var oldSymbol = symbolInfo.Symbol; 3622var newSymbol = speculativeSymbolInfo.Symbol; 3754var firstParamType = ((ISymbol)exprInfo.CandidateSymbols.Single()).GetParameters().First().Type; 3848var symbol = model.LookupSymbols(syntax.SpanStart, name: "Alias").Single(); 3875var symbol = model.LookupSymbols(endPosition, name: "M0").Single(); 4031var discarded = model.GetEnclosingSymbol(match.Index); 4060var discarded = model.GetEnclosingSymbol(match.Index); 4085var discarded1 = model.GetEnclosingSymbol(source.LastIndexOf(" => x")); 4086var 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)
343var symbol = semanticInfo.Symbol; 431var symbol = semanticInfo.Symbol; 4546var symbol = semanticInfo.Symbol; 6253var symbol = semanticInfo.Symbol; 6370var symbol = semanticInfo.Symbol; 13137var symbol = semanticInfo.CandidateSymbols[0]; 13171var symbol = semanticInfo.CandidateSymbols[0]; 13205var symbol = semanticInfo.CandidateSymbols[0]; 15377var infoSymbol = semanticModel.GetQueryClauseInfo(qc).OperationInfo.Symbol; 15381var 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)
2285var goo = a.GetMembers("_Prop").Single(); 4847var goo = a.GetMembers("Goo").Single(); 5039var type = outer.GetMembers("Inner").Single(); 5040var method = outer.GetMembers("M").Single(); 5041var property = outer.GetMembers("P").Single(); 5042var field = outer.GetMembers("F").Single(); 5043var @event = outer.GetMembers("E").Single(); 5044var @delegate = outer.GetMembers("D").Single(); 5045var error = outer.GetMembers("Error").Single(); 5688var method = type.GetMembers("F").Single(); 5689var property = type.GetMembers("P").Single(); 5690var indexer = type.GetMembers().Where(m => m.Kind == SymbolKind.Property && ((IPropertySymbol)m).IsIndexer).Single(); 5892var method = type.GetMembers("F").Single(); 5893var property = type.GetMembers("P").Single(); 5894var indexer = type.GetMembers().Where(m => m.Kind == SymbolKind.Property && ((IPropertySymbol)m).IsIndexer).Single(); 7911var symbol = model.GetSymbolInfo(variable).Symbol; 8005var symbol = model.GetSymbolInfo(constructor).Symbol; 8065var symbol = model.GetSymbolInfo(constructor).Symbol; 8932var 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; 3979var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 4051var o2Symbol = model.GetDeclaredSymbol(o2Decl); 4054var o1RefSymbol = model.GetSymbolInfo(o1Ref).Symbol; 4057var o2RefSymbol = model.GetSymbolInfo(o2Ref).Symbol; 4115var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 4178var 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)
2115(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)
1765ImmutableArray<ISymbol> explicitInterfaceImplementations, 1803private 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() 325private ImmutableArray<ISymbol> GetSymbolsForExpressionOrStatementContext() 351ImmutableArray<ISymbol> symbols; 388ISymbol symbol, 504private static ImmutableArray<ISymbol> FilterOutUncapturableParameters(ImmutableArray<ISymbol> symbols, SyntaxNode contextNode) 753ISymbol? containerSymbol = containerType; 854ISymbol symbol, 889private ImmutableArray<ISymbol> GetUnnamedSymbols(ExpressionSyntax originalExpression) 902using var _ = ArrayBuilder<ISymbol>.GetInstance(out var symbols); 918private 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)
61private readonly ISymbol _renamedSymbol; 357var symbol = symbols[0]; 364var sourceDefinition = SymbolFinder.FindSourceDefinition(symbol, _solution, _cancellationToken); 470IEnumerable<ISymbol> symbols; 541var symbol = _speculativeModel.GetSymbolInfo(token.Parent, _cancellationToken).Symbol; 743IEnumerable<ISymbol> newReferencedSymbols) 783ISymbol renamedSymbol, 784ISymbol renameSymbol, 785IEnumerable<ISymbol> referencedSymbols, 850var properties = new List<ISymbol>(); 851foreach (var referencedSymbol in referencedSymbols) 930private static async Task<ISymbol?> GetVBPropertyFromAccessorOrAnOverrideAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken) 936var property = ((IMethodSymbol)symbol).AssociatedSymbol!; 943var originalSourceSymbol = SymbolFinder.FindSourceDefinition(symbol.GetOverriddenMember(), solution, cancellationToken); 959ArrayBuilder<Location> conflicts, IEnumerable<ISymbol> symbols, 962foreach (var symbol in symbols) 979ISymbol renameSymbol, ISymbol renamedSymbol, IEnumerable<ReferenceLocation> implicitReferenceLocations, CancellationToken cancellationToken) 1024ISymbol renamedSymbol, 1045foreach (var symbol in implicitSymbols) 1092public override void TryAddPossibleNameConflicts(ISymbol symbol, string replacementText, ICollection<string> possibleNameConflicts)
Simplification\CSharpSimplificationService.Expander.cs (16)
548var symbol = _semanticModel.GetSymbolInfo(originalSimpleName.Identifier).Symbol; 741private static ExpressionSyntax TryAddTypeArgumentToIdentifierName(ExpressionSyntax newNode, ISymbol symbol) 767private IList<ISymbol> TypeArgumentSymbolsPresentInName(SimpleNameSyntax simpleName) 769var typeArgumentSymbols = new List<ISymbol>(); 776var symbol = _semanticModel.GetSymbolInfo(typeArgument).Symbol; 813private static bool IsTypeArgumentDefinedRecursive(ISymbol symbol, IList<ISymbol> typeArgumentSymbols, bool enterContainingSymbol) 820var typeArgumentsInSymbol = new List<ISymbol>(); 823var typeArgumentsInOriginalDefinition = new List<ISymbol>(); 834private static void TypeArgumentsInAllContainingSymbol(ISymbol symbol, IList<ISymbol> typeArgumentSymbols, bool enterContainingSymbol, bool isRecursive) 895ISymbol symbol, 931var displaySymbol = replaceNode 933: (symbol.ContainingType ?? (ISymbol)symbol.ContainingNamespace); 1053var targetSymbol = SimplificationHelpers.GetOriginalSymbolInfo(_semanticModel, memberAccess.Name); 1103var 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)
370var symbol = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol; 437private static bool CanReplace(ISymbol symbol) 978var symbol = semanticModel.GetSymbolInfo(current, cancellationToken).Symbol ?? semanticModel.GetDeclaredSymbol(current, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
329var 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) 419public async Task<ISymbol?> GetInterceptorSymbolAsync(Document document, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (14)
957foreach (var sym in type.GetMembers(opName)) 1096var symbol = semanticModel.GetDeclaredSymbol(variableDeclarator, cancellationToken); 1198var oldSymbolInfo = originalSemanticModel.GetSymbolInfo(currentOld, cancellationToken).Symbol; 1199var newSymbolInfo = rewrittenSemanticModel.GetSymbolInfo(currentNew, cancellationToken).Symbol; 1251var originalMemberSymbol = originalSemanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol; 1256var rewrittenMemberSymbol = rewrittenSemanticModel.GetSymbolInfo(rewrittenMemberAccessExpression, cancellationToken).Symbol; 1322var implementationMember = rewrittenContainingType.FindImplementationForInterfaceMember(originalMemberSymbol); 1336for (var current = rewrittenMemberSymbol; current != null; current = current.GetOverriddenMember()) 1360var originalMemberSymbol = originalSemanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol; 1365var rewrittenMemberSymbol = rewrittenSemanticModel.GetSymbolInfo(rewrittenMemberAccessExpression, cancellationToken).Symbol; 1372private static bool IsComplementaryDelegateInvoke(ISymbol originalMemberSymbol, ISymbol rewrittenMemberSymbol) 1435ISymbol originalMemberSymbol, ISymbol rewrittenMemberSymbol, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (4)
568var originalSymbol = this.OriginalSemanticModel.GetSymbolInfo(ctorInitializer, CancellationToken).Symbol; 569var newSymbol = this.SpeculativeSemanticModel.GetSymbolInfo(newCtorInitializer, CancellationToken).Symbol; 575var originalSymbol = this.OriginalSemanticModel.GetCollectionInitializerSymbolInfo(originalInitializer, CancellationToken).Symbol; 576var 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)
105ImmutableArray<ISymbol> members, 142IList<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)
40protected override IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode container, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSymbolDeclarationService.cs (1)
24public ImmutableArray<SyntaxReference> GetDeclarations(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (4)
1988var memberSymbol = GetDeclaredMemberSymbolFromOriginalSemanticModel(declaration); 2042var symbol = GetDeclaredMemberSymbolFromOriginalSemanticModel(declaration); 2051private ISymbol GetDeclaredMemberSymbolFromOriginalSemanticModel(SyntaxNode declarationInCurrentTree) 2207private 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)
37ISymbol fieldOrProperty, 99ISymbol 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)
2227var method = type.GetMembers("M").Single(); 2248var method = type.GetMembers("M").Single(); 2269var method = type.GetMembers("M").Single(); 2290var method = type.GetMembers("M").Single(); 2311var method = type.GetMembers(WellKnownMemberNames.InstanceConstructorName).Single(); 2333var property = type.GetMembers("Prop").Single(); 2351var property = type.GetMembers("Prop").Single(); 2374var property = type.GetMembers("Accept").Single(); 2402var property = type.GetMembers("Accept").Single(); 2430var property = type.GetMembers("Accept").Single(); 2461var property = type.GetMembers("Accept").Single(); 2495var method = type.GetMembers().Single(m => m is IMethodSymbol { MethodKind: MethodKind.ExplicitInterfaceImplementation }); 2496var property = type.GetMembers().Single(m => m is IPropertySymbol { IsIndexer: false }); 2497var indexer = type.GetMembers().Single(m => m is IPropertySymbol { IsIndexer: true }); 2498var ev = type.GetMembers().Single(m => m is IEventSymbol); 2538var field = type.GetMembers("F").Single(); 2561var field = type.GetMembers("F").Single(); 2571var field = _emptyCompilation.GetSpecialType(SpecialType.System_UInt32).GetMembers(nameof(UInt32.MaxValue)).Single(); 2591var method = type.GetMembers(WellKnownMemberNames.DestructorName).Single(); 4691var symbol = comp.GlobalNamespace.GetMembers("C").First().GetMembers("M").First(); 4709var symbol = comp.GlobalNamespace.GetMembers("C").First().GetMembers("X").First(); 4726var symbol = comp.GlobalNamespace.GetMembers("C").First().GetMembers("MyEvent").First(); 4751var symbol = comp.GlobalNamespace.GetMembers("C2").First().GetMembers("MyEvent").First(); 4996var declaration = semanticModel.GetDeclaredSymbol(node);
Microsoft.CodeAnalysis.EditorFeatures (20)
CodeDefinitionWindow\DefinitionContextTracker.cs (1)
168var symbol = await SymbolFinder.FindSymbolAtPositionAsync(
GoToDefinition\GoToDefinitionHelpers.cs (2)
17ISymbol symbol, 31ISymbol symbol,
InlineRename\AbstractEditorInlineRenameService.SymbolRenameInfo.cs (1)
53public ISymbol RenameSymbol => _info.Symbol!;
IRefactorNotifyService.cs (2)
25bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure); 35bool 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)
15ISymbol symbolToRename, 19public 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)
26ISymbol symbol,
ExtractInterface\TestExtractInterfaceOptions.cs (3)
23public IEnumerable<ISymbol> AllExtractableMembers { get; private set; } 32public IEnumerable<ISymbol> ChosenMembers { get; set; } 38List<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 (126)
CodeGeneration\CodeGenerationTests.cs (14)
41IList<ISymbol> imports = null, 511ImmutableArray<Func<SemanticModel, ISymbol>> members = default, 554var attributeTarget = testContext.SemanticModel.GetDeclaredSymbol(taggedNode); 571ImmutableArray<Func<SemanticModel, ISymbol>> getNewMembers = default, 598var allMembers = new List<ISymbol>(); 681internal static ImmutableArray<Func<SemanticModel, ISymbol>> Members(params Func<SemanticModel, ISymbol>[] m) 698private static ImmutableArray<ISymbol> GetSymbols(ImmutableArray<Func<SemanticModel, ISymbol>> members, TestContext context) 705private static Func<SemanticModel, ISymbol> CreateEnumField(string name, object value) 712internal static Func<SemanticModel, ISymbol> CreateField(Accessibility accessibility, Editing.DeclarationModifiers modifiers, Type type, string name) 895public IEnumerable<ISymbol> GetAnnotatedDeclaredSymbols(string key, SemanticModel semanticModel) 900yield return GetSelectedSymbol<ISymbol>(span, semanticModel); 905where T : class, ISymbol
MetadataAsSource\AbstractMetadataAsSourceTests.cs (2)
57var navigationSymbol = await context.GetNavigationSymbolAsync(); 107var 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() 308internal async Task<ISymbol> GetNavigationSymbolAsync() 315var symbol = semanticModel.GetSymbolInfo(syntaxRoot.FindNode(testDocument.SelectedSpans.Single())).Symbol;
MetadataAsSource\MetadataAsSourceTests.cs (22)
2954var navigationSymbol = await context.GetNavigationSymbolAsync(); 3002var navigationSymbol = await context.GetNavigationSymbolAsync(); 3531var navigationSymbol = await context.GetNavigationSymbolAsync(); 3577var navigationSymbol = await context.GetNavigationSymbolAsync(); 3612var navigationSymbol = await context.GetNavigationSymbolAsync(); 5284var navigationSymbol = await context.GetNavigationSymbolAsync(); 5332var navigationSymbol = await context.GetNavigationSymbolAsync(); 5369var navigationSymbol = await context.GetNavigationSymbolAsync(); 5433var navigationSymbol = await context.GetNavigationSymbolAsync(); 5494var navigationSymbol = await context.GetNavigationSymbolAsync(); 5563var navigationSymbol = await context.GetNavigationSymbolAsync(); 5619var navigationSymbol = await context.GetNavigationSymbolAsync(); 5676var navigationSymbol = await context.GetNavigationSymbolAsync(); 5730var navigationSymbol = await context.GetNavigationSymbolAsync(); 5784var navigationSymbol = await context.GetNavigationSymbolAsync(); 5836var navigationSymbol = await context.GetNavigationSymbolAsync(); 5888var navigationSymbol = await context.GetNavigationSymbolAsync(); 5940var navigationSymbol = await context.GetNavigationSymbolAsync(); 5990var navigationSymbol = await context.GetNavigationSymbolAsync(); 6060var navigationSymbol = await context.GetNavigationSymbolAsync(); 6140var navigationSymbol = await context.GetNavigationSymbolAsync(); 6190var navigationSymbol = await context.GetNavigationSymbolAsync();
StackTraceExplorer\StackTraceExplorerTests.cs (1)
52var expectedSymbol = semanticModel.GetDeclaredSymbol(node);
SymbolFinder\DependentTypeFinderTests.cs (1)
758var 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)
199var field1_v1 = type1_v1.GetMembers("field1").Single(); 200var field1_v2 = type1_v2.GetMembers("field1").Single(); 201var field2_v1 = type1_v1.GetMembers("field2").Single(); 202var field2_v2 = type2_v2.GetMembers("field2").Single(); 203var field3_v1 = type2_v1.GetMembers("field3").Single(); 204var field3_v2 = type2_v2.GetMembers("field3").Single(); 205var field4_v1 = type2_v1.GetMembers("field4").Single(); 206var field4_v2 = type1_v2.GetMembers("field4").Single(); 250var field1_v1 = type1_v1.GetMembers("field1").Single(); 251var field1_v2 = type1_v2.GetMembers("field1").Single(); 252var field2_v1 = type1_v1.GetMembers("field2").Single(); 253var field2_v2 = type2_v2.GetMembers("field2").Single(); 254var field3_v1 = type2_v1.GetMembers("field3").Single(); 255var field3_v2 = type2_v2.GetMembers("field3").Single(); 256var field4_v1 = type2_v1.GetMembers("field4").Single(); 257var field4_v2 = type1_v2.GetMembers("field4").Single(); 292var goo = typeC.GetMembers("goo").Single(); 293var goo_intInstantiation1 = intInstantiation1.Type.GetMembers("goo").Single(); 294var goo_stringInstantiation = stringInstantiation.Type.GetMembers("goo").Single(); 295var goo_instanceInstantiation = instanceInstantiation.Type.GetMembers("goo").Single(); 296var goo_intInstantiation2 = intInstantiation2.Type.GetMembers("goo").Single(); 331var method_v1 = type1_v1.GetMembers("Goo").Single(); 332var method_v2 = type1_v2.GetMembers("Goo").Single(); 356var method_v1 = type1_v1.GetMembers("Goo").Single(); 357var method_v2 = type1_v2.GetMembers("Goo1").Single(); 381var method_v1 = type1_v1.GetMembers("Goo").Single(); 382var method_v2 = type1_v2.GetMembers("Goo").Single(); 406var method_v1 = type1_v1.GetMembers("Goo").Single(); 407var method_v2 = type1_v2.GetMembers("Goo").Single(); 431var method_v1 = type1_v1.GetMembers("Goo").Single(); 432var method_v2 = type1_v2.GetMembers("Goo").Single(); 458var method_v1 = type1_v1.GetMembers("Goo").Single(); 459var method_v2 = type1_v2.GetMembers("Goo").Single(); 485var method_v1 = type1_v1.GetMembers("Goo").Single(); 486var method_v2 = type1_v2.GetMembers("Goo").Single(); 512var method_v1 = type1_v1.GetMembers("Goo").Single(); 513var method_v2 = type1_v2.GetMembers("Goo").Single(); 537var method_v1 = type1_v1.GetMembers("Goo").Single(); 538var method_v2 = type1_v2.GetMembers("Goo").Single(); 562var method_v1 = type1_v1.GetMembers("Goo").Single(); 563var method_v2 = type1_v2.GetMembers("Goo").Single(); 589var method_v1 = type1_v1.GetMembers("Goo").Single(); 590var method_v2 = type1_v2.GetMembers("Goo").Single(); 623var csharpGooMethod = csharpType1.GetMembers("Goo").Single(); 624var csharpBarMethod = csharpType1.GetMembers("Bar").Single(); 625var vbGooMethod = vbType1.GetMembers("Goo").Single(); 626var vbQuuxMethod = vbType1.GetMembers("Quux").Single(); 668var csharpGooMethod = csharpType1.GetMembers("Goo").Single(); 669var csharpBarMethod = csharpType1.GetMembers("Bar").Single(); 670var vbGooMethod = vbType1.GetMembers("Goo").Single(); 671var vbBarMethod = vbType1.GetMembers("Bar").Single(); 698var field1_v1 = type1_v1.GetMembers("field1").Single(); 699var field2_v1 = type1_v1.GetMembers("field2").Single(); 725var method_v1 = type1_v1.GetMembers("Goo").Single(); 726var method_v2 = type1_v2.GetMembers("Goo").Single(); 760var method_v1 = type1_v1.GetMembers("Goo").Single(); 761var method_v2 = type1_v2.GetMembers("Goo").Single(); 793var method_v1 = type1_v1.GetMembers("Goo").Single(); 794var method_v2 = type1_v2.GetMembers("Goo").Single(); 828var method_v1 = type1_v1.GetMembers("Goo").Single(); 829var method_v2 = type1_v2.GetMembers("Goo").Single(); 1084var method_v1 = type1_v1.GetMembers("Goo").Single(); 1085var method_v2 = type1_v2.GetMembers("Goo").Single(); 1115var method_v1 = type1_v1.GetMembers("M").Single(); 1116var method_v2 = type1_v2.GetMembers("M").Single(); 1155var method_v1 = type1_v1.GetMembers("M").Single(); 1156var method_v2 = type1_v2.GetMembers("M").Single(); 1185var method_v1 = type1_v1.GetMembers("M").Single(); 1186var method_v2 = type1_v2.GetMembers("M").Single(); 1215var method_v1 = type1_v1.GetMembers("M").Single(); 1216var method_v2 = type1_v2.GetMembers("M").Single(); 1246var method_v1 = type1_v1.GetMembers("M").Single(); 1247var method_v2 = type1_v2.GetMembers("M").Single(); 1277var method_v1 = type1_v1.GetMembers("M").Single(); 1278var method_v2 = type1_v2.GetMembers("M").Single(); 1309var method_v1 = type1_v1.GetMembers("M").Single(); 1310var method_v2 = type1_v2.GetMembers("M").Single(); 1888var 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)
48ISymbol 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)
1597Dim symbols = New HashSet(Of ISymbol) 2498Public AnalyzedMethodSymbols As List(Of ISymbol) = New List(Of ISymbol)() 2500Public AnalyzedOperationBlockSymbols As List(Of ISymbol) = New List(Of ISymbol)() 2502Public AnalyzedOperationBlockStartSymbols As List(Of ISymbol) = New List(Of ISymbol)() 2503Public AnalyzedOperationBlockEndSymbols As List(Of ISymbol) = New List(Of ISymbol)() 2505Public AnalyzedCodeBlockSymbols As List(Of ISymbol) = New List(Of ISymbol)() 2507Public AnalyzedCodeBlockStartSymbols As List(Of ISymbol) = New List(Of ISymbol)() 2508Public 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)
12OmniSharpExtractClassOptions? GetExtractClassOptions(Document document, INamedTypeSymbol originalType, ImmutableArray<ISymbol> selectedMembers); 39public ISymbol Member { get; } 47ISymbol member,
ExtractInterface\IOmniSharpExtractInterfaceOptionsService.cs (3)
15List<ISymbol> extractableMembers, 28public ImmutableArray<ISymbol> IncludedMembers { get; } 33public 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)
28ImmutableArray<ISymbol> selectedMembers,
Internal\ExtractInterface\OmniSharpExtractInterfaceOptionsService.cs (1)
29List<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)
33public 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)
22ISymbol symbol, 25ImmutableHashSet<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 (946)
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)
616private 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)
52ISymbol targetSymbol, 61SyntaxNode targetNode, ISymbol targetSymbol, INamedTypeSymbol suppressMessageAttribute, Diagnostic diagnostic); 256public ISymbol TargetSymbol { get; set; } 292ISymbol targetSymbol = null; 375protected static string GetTargetString(ISymbol targetSymbol)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageCodeAction.cs (2)
19ISymbol targetSymbol, INamedTypeSymbol suppressMessageAttribute, 41internal ISymbol TargetSymbol_TestOnly { get; } = targetSymbol;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (12)
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>>(); 163var targetSymbol = suppressionTargetInfo.TargetSymbol; 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)
27ISymbol queriedDefinition, 34private readonly ISymbol _queriedSymbol = queriedDefinition; 69private static bool FilterDefinition(ISymbol definition) 76private IEnumerable<Location> GetPartialLocations(ISymbol symbol, CancellationToken cancellationToken) 87public void OnDefinitionFound(ISymbol symbol) 116private bool FilterReference(ISymbol definition, ReferenceLocation reference) 130public 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\MoveType\AbstractMoveTypeService.RenameTypeEditor.cs (1)
27var symbol = State.SemanticDocument.SemanticModel.GetDeclaredSymbol(State.TypeNode, 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)
13CodeActionOperation 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)
47protected 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)
38protected abstract Task<ISymbol> GenerateMemberAsync( 39Document document, CompletionItem item, Compilation compilation, ISymbol member, INamedTypeSymbol containingType, CancellationToken cancellationToken); 151var 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)
19public abstract ImmutableArray<ISymbol> FilterOverrides(ImmutableArray<ISymbol> members, ITypeSymbol? returnType); 34protected override Task<ISymbol> GenerateMemberAsync( 35Document document, CompletionItem completionItem, Compilation compilation, ISymbol overriddenMember, INamedTypeSymbol containingType, CancellationToken cancellationToken) 72protected 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)
28protected abstract bool IsInstrinsic(ISymbol symbol); 31protected abstract string GetFilterText(ISymbol symbol, string displayText, TSyntaxContext context); 79private static bool IsValidForTaskLikeTypeOnlyContext(ISymbol symbol, TSyntaxContext context) 105private static bool IsValidForGenericConstraintContext(ISymbol symbol) 130private static ITypeSymbol? GetSymbolType(ISymbol symbol) 183private 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, 101Dictionary<ISymbol, ArrayBuilder<ProjectId>>? invalidProjectMap, 200Dictionary<ISymbol, ArrayBuilder<ProjectId>>? invalidProjectMap, 242protected static string GetFilterTextDefault(ISymbol symbol, string displayText, TSyntaxContext context) 403private static Dictionary<ISymbol, ArrayBuilder<ProjectId>> FindSymbolsMissingInLinkedContexts( 407var 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)
420static 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) 271ImmutableArray<ISymbol> symbols, 303ImmutableArray<ISymbol> symbols, 327ImmutableArray<ISymbol> symbols, 358CompletionItem 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)
824document, namedTypeWithoutMembers, ImmutableArray<ISymbol>.CastUp(fields), 828ImmutableArray<ISymbol>.CastUp(fields), cancellationToken).ConfigureAwait(false); 830using var _ = ArrayBuilder<ISymbol>.GetInstance(out var members); 880SyntaxGenerator generator, ArrayBuilder<ISymbol> members, 911ImmutableArray<ITypeParameterSymbol> typeParameters, ImmutableArray<ISymbol> members) 928using var _ = PooledDictionary<string, ISymbol>.GetInstance(out var parameterToPropMap);
Copilot\ICopilotCodeAnalysisService.cs (3)
68/// <paramref name="symbolSignature"/> is a formatted string representation of an <see cref="ISymbol"/>.<br/> 69/// <paramref name="declarationCode"/> is a list of a code definitions from an <see cref="ISymbol"/>. 70/// <paramref name="language"/> is the language of the originating <see cref="ISymbol"/>.
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 240private bool IsApplicable(ISymbol methodOrProperty, int? parameterCount, CancellationToken cancellationToken) 284private 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.cs (27)
110internal abstract MemberBody? TryGetDeclarationBody(SyntaxNode node, ISymbol? symbol); 115internal abstract bool IsDeclarationWithSharedBody(SyntaxNode declaration, ISymbol member); 186/// Returns all symbols with declaring syntax (<see cref="GetSymbolDeclarationSyntax(ISymbol, CancellationToken)"/> must return a syntax node) 191ref TemporaryArray<(ISymbol?, ISymbol?, EditKind)> result, 194ISymbol? oldSymbol, 196ISymbol? newSymbol, 207protected abstract OneOrMany<(ISymbol? oldSymbol, ISymbol? newSymbol)> GetEditedSymbols( 215private OneOrMany<(ISymbol? oldSymbol, ISymbol? newSymbol, EditKind editKind)> GetSymbolEdits( 226var result = new TemporaryArray<(ISymbol?, ISymbol?, EditKind)>(); 2550 => OneOrMany<(ISymbol?, ISymbol?, EditKind)>.Empty, 264protected abstract IEnumerable<SyntaxNode> GetVariableUseSites(IEnumerable<SyntaxNode> roots, ISymbol localOrParameter, SemanticModel model, CancellationToken cancellationToken); 298internal string GetDisplayKindAndName(ISymbol symbol, string? displayKind = null, bool fullyQualify = false) 319internal string GetDisplayKind(ISymbol symbol) 436internal abstract void ReportInsertedMemberSymbolRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, ISymbol newSymbol, SyntaxNode newNode, bool insertingIntoExistingContainingType); 494/// <see cref="ISymbol.DeclaringSyntaxReferences"/> of a primary constructor returns the type declaration syntax. 503internal abstract bool IsConstructorWithMemberInitializers(ISymbol symbol, CancellationToken cancellationToken); 935ISymbol oldMember, 936ISymbol newMember, 2364protected static bool SymbolsEquivalent(ISymbol oldSymbol, ISymbol newSymbol) 2425protected static bool MemberOrDelegateSignaturesEquivalent(ISymbol? oldMember, ISymbol? newMember, bool exact = false)
EditAndContinue\AbstractSimpleMemberBody.cs (1)
32public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody.cs (1)
63public abstract ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model);
EditAndContinue\EditSession.cs (6)
675out ImmutableHashSet<ISymbol> addedSymbols, 679using var _1 = PooledHashSet<ISymbol>.GetInstance(out var addedSymbolsBuilder); 680using var _2 = ArrayBuilder<(ISymbol? oldSymbol, ISymbol? newSymbol)>.GetInstance(edits.Count, out var resolvedSymbols); 778using var _3 = PooledHashSet<ISymbol>.GetInstance(out var visitedSymbols); 997static _ => false : (Func<ISymbol, bool>)projectChanges.AddedSymbols.Contains;
EditAndContinue\ProjectChanges.cs (2)
27public readonly ImmutableHashSet<ISymbol> AddedSymbols; 42ImmutableHashSet<ISymbol> addedSymbols,
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 (7)
188var formatMethod = iformattable 195var impl = type.FindImplementationForInterfaceMember(formatMethod); 266var symbol = semanticModel.GetDeclaredSymbol(property, cancellationToken); 332ISymbol? symbol, 430var symbol = semanticModel.GetSymbolInfo(left, cancellationToken).Symbol; 435ISymbol? symbol, [NotNullWhen(true)] out string? identifier) 443[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)
37IReadOnlyList<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; 144using var _1 = ArrayBuilder<(ISymbol member, bool makeAbstract)>.GetInstance(out var pullMembersBuilder); 185var currentSymbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
ExtractClass\IExtractClassOptionsService.cs (1)
17ImmutableArray<ISymbol> selectedMembers,
ExtractInterface\AbstractExtractInterfaceService.cs (10)
42IEnumerable<ISymbol> includedMembers, 43ImmutableDictionary<ISymbol, SyntaxAnnotation> symbolToDeclarationAnnotationMap, 259IEnumerable<ISymbol> extractableMembers, 320IEnumerable<ISymbol> includedMembers, 321ImmutableDictionary<ISymbol, SyntaxAnnotation> symbolToDeclarationAnnotationMap, 371private static ImmutableArray<ISymbol> CreateInterfaceMembers(IEnumerable<ISymbol> includedMembers) 373using var _ = ArrayBuilder<ISymbol>.GetInstance(out var interfaceMembers); 375foreach (var member in includedMembers) 431internal 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)
18public readonly IEnumerable<ISymbol> ExtractableMembers; 26IEnumerable<ISymbol> extractableMembers,
ExtractInterface\IExtractInterfaceOptionsService.cs (1)
18List<ISymbol> extractableMembers,
ExtractMethod\MethodExtractor.Analyzer.cs (32)
50protected virtual bool IsReadOutside(ISymbol symbol, HashSet<ISymbol> readOutsideMap) 147GetSignatureInformation(Dictionary<ISymbol, VariableInfo> symbolMap, ExtractMethodFlowControlInformation flowControlInformation) 221MultiDictionary<ISymbol, SyntaxToken> symbolMap, 223IList<ISymbol> failedVariables, 283private MultiDictionary<ISymbol, SyntaxToken> GetSymbolMap() 285var symbolMap = new MultiDictionary<ISymbol, SyntaxToken>(); 404MultiDictionary<ISymbol, SyntaxToken> symbolMap, 406out Dictionary<ISymbol, VariableInfo> variableInfoMap, 407out List<ISymbol> failedVariables) 427var candidates = new HashSet<ISymbol>(readInsideMap); 437foreach (var symbol in candidates) 523PooledDisposer<PooledHashSet<ISymbol>> GetPooledSymbolSet(ImmutableArray<ISymbol> symbols, out PooledHashSet<ISymbol> symbolSet) 525var disposer = PooledHashSet<ISymbol>.GetInstance(out symbolSet); 530ITypeSymbol? GetSymbolType(ISymbol symbol) 564ISymbol symbol, 581private static void AddVariableToMap(IDictionary<ISymbol, VariableInfo> variableInfoMap, ISymbol localOrParameter, VariableInfo variableInfo) 586MultiDictionary<ISymbol, SyntaxToken> symbolMap, 587ISymbol symbol, 641MultiDictionary<ISymbol, SyntaxToken> symbolMap, ISymbol symbol, bool writtenInside) 694private static bool IsThisParameter(ISymbol localOrParameter) 704private static bool IsInteractiveSynthesizedParameter(ISymbol localOrParameter) 739IDictionary<ISymbol, VariableInfo> variableInfoMap, 742foreach (var symbol in variableInfoMap.Keys) 792private static void AppendMethodTypeParameterUsedDirectly(MultiDictionary<ISymbol, SyntaxToken> symbolMap, IDictionary<int, ITypeParameterSymbol> sortedMap) 805IDictionary<ISymbol, VariableInfo> variableInfoMap, 806MultiDictionary<ISymbol, SyntaxToken> symbolMap, 890private OperationStatus CheckReadOnlyFields(MultiDictionary<ISymbol, SyntaxToken> symbolMap)
ExtractMethod\MethodExtractor.TypeParameterCollector.cs (1)
32public 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)
54ISymbol symbol, 117ImmutableArray<(SymbolGroup group, ISymbol symbol, ReferenceLocation location)> references, CancellationToken cancellationToken)
FindUsages\AbstractFindUsagesService_FindImplementations.cs (15)
42IFindUsagesContext context, ISymbol symbol, Project project, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken) 69ISymbol symbol, Project project, IFindUsagesContext context, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken) 85foreach (var implementation in implementations) 94private static async Task<ImmutableArray<ISymbol>> FindSourceImplementationsAsync( 95Solution solution, ISymbol symbol, CancellationToken cancellationToken) 97var builder = new HashSet<ISymbol>(SymbolEquivalenceComparer.Instance); 129static bool AddedAllLocations(ISymbol implementation, HashSet<(string filePath, TextSpan span)> seenLocations) 141private static async Task<ImmutableArray<ISymbol>> FindImplementationsWorkerAsync( 142Solution solution, ISymbol symbol, CancellationToken cancellationToken) 146using var _ = PooledHashSet<ISymbol>.GetInstance(out var result); 169private static async Task<ImmutableArray<ISymbol>> FindSourceAndMetadataImplementationsAsync( 170Solution solution, ISymbol symbol, CancellationToken cancellationToken) 180using var _ = PooledHashSet<ISymbol>.GetInstance(out var implementationsAndOverrides); 182foreach (var implementation in implementations) 200return 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)
61private async ValueTask<(Project? project, ISymbol? symbol)> TryResolveSymbolAsync(Solution solution, string symbolKey, CancellationToken cancellationToken) 74var 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 (5)
18public static string GetDisplayName(ISymbol symbol) 31public static async Task<(ISymbol symbol, Project project)?> GetRelevantSymbolAndProjectAtPositionAsync( 36var symbol = await SymbolFinder.FindSymbolAtPositionAsync(document, position, cancellationToken: cancellationToken).ConfigureAwait(false); 52private static SymbolDisplayFormat GetFormat(ISymbol definition) 82public static ImmutableArray<TaggedText> GetDisplayParts(ISymbol definition)
FullyQualify\AbstractFullyQualifyService.cs (5)
113async Task<ImmutableArray<ISymbol>> FindAsync(string name, bool ignoreCase, SymbolFilter filter) 124ImmutableArray<ISymbol> matchingTypes) 156ImmutableArray<ISymbol> symbols) 205var member = container.GetMembers(name).FirstOrDefault(); 266private static bool HasValidContainer(ISymbol symbol)
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (2)
124foreach (var member in comparableType.GetMembers(nameof(IComparable<int>.CompareTo))) 243foreach (var member in containingType.GetMembers(GetOperatorName(kind)))
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.FieldDelegatingCodeAction.cs (1)
40var parameterToExistingFieldMap = ImmutableDictionary.CreateBuilder<string, ISymbol>();
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.GenerateConstructorWithDialogCodeAction.cs (2)
30ImmutableArray<ISymbol> viableMembers, 39internal 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)
26ImmutableArray<ISymbol> viableMembers, 38private 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)
13ImmutableArray<ISymbol> selectedMembers) 17public 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)
585ImmutableDictionary<string, ISymbol>.Builder parameterToFieldMap, 617ISymbol symbol) 640private 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)
295var symbol = SymbolFinder.FindSourceDefinition(TypeToGenerateInOpt, document.Project.Solution, cancellationToken); 383var symbol = leftSideInfo.Symbol;
GoToBase\AbstractGoToBaseService.cs (2)
62foreach (var baseSymbol in bases) 64var sourceDefinition = SymbolFinder.FindSourceDefinition(
GoToBase\FindBaseHelpers.cs (3)
15public static ImmutableArray<ISymbol> FindBases( 16ISymbol symbol, Solution solution, CancellationToken cancellationToken) 23var 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) 43var definition = SymbolFinder.FindSourceDefinition(symbol, solution, cancellationToken); 56ISymbol? 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)
210var callerSymbol = GetCallerSymbol(calleeInvocationNode, semanticModel, cancellationToken); 250ISymbol callerSymbol, 293ISymbol callerSymbol, 367ISymbol callerSymbol, 569private ISymbol? GetCallerSymbol( 576var 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)
28var local = semanticModel.GetDeclaredSymbol(variableDeclarator, cancellationToken);
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (3)
74var containingSymbol = semanticModel.GetDeclaredSymbol(containingMethod, cancellationToken); 78var expressionSymbol = semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol; 204var 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)
17Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ISymbol symbol, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, CancellationToken cancellationToken = default); 18Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, CancellationToken cancellationToken = default); 19Task<ImmutableArray<SymbolDisplayPart>> ToDescriptionPartsAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, CancellationToken cancellationToken = default); 20Task<IDictionary<SymbolDescriptionGroups, ImmutableArray<TaggedText>>> ToDescriptionGroupsAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, CancellationToken cancellationToken = default);
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedNamespaceOrTypeSymbol.cs (2)
24public abstract ImmutableArray<ISymbol> GetMembers(); 25public 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)
26ISymbol symbol, 88protected abstract Task<Document> AddAssemblyInfoRegionAsync(Document document, Compilation symbolCompilation, ISymbol symbol, CancellationToken cancellationToken); 94private 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)
21private readonly ImmutableArray<ISymbol> _members; 44private static ISymbol WrapMember(ISymbol m, bool canImplementImplicitly, IDocumentationCommentFormattingService docCommentFormattingService) 70public ISymbol AssociatedSymbol => _symbol.AssociatedSymbol; 100public ISymbol FindImplementationForInterfaceMember(ISymbol interfaceMember) 103public override ImmutableArray<ISymbol> GetMembers() 108public 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)
24ISymbol symbol,
MetadataAsSource\IMetadataAsSourceFileService.cs (2)
30ISymbol symbol, 47bool 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)
51public static INamedTypeSymbol GetTopLevelContainingNamedType(ISymbol symbol) 54public static INamedTypeSymbol? TryGetTopLevelContainingNamedType(ISymbol symbol) 57var 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)
177private static async Task<ImmutableArray<ISymbol>> GetMemberSymbolsAsync(Document document, SyntaxNode container, CancellationToken cancellationToken) 272private 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)
19Solution solution, ISymbol symbol, Location location, 28ISymbol symbol, 38Solution solution, ISymbol symbol, CancellationToken cancellationToken) 55private 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)
83ISymbol symbol, 121var symbolToFind = symbol is IParameterSymbol parameterSymbol ? parameterSymbol.ContainingSymbol : symbol; 162var newSymbol = resolution.Symbol;
PickMembers\IPickMembersService.cs (1)
15string 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)
15PullMembersUpOptions GetPullMemberUpOptions(Document document, ImmutableArray<ISymbol> selectedNodeSymbols);
PullMemberUp\Dialog\PullMemberUpWithDialogCodeAction.cs (2)
21ImmutableArray<ISymbol> selectedMembers, 27private readonly ImmutableArray<ISymbol> _selectedMembers = selectedMembers;
PullMemberUp\MemberAnalysisResult.cs (2)
10ISymbol member, 19public 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)
16ImmutableArray<(ISymbol member, bool makeAbstract)> members)
QuickInfo\CommonSemanticQuickInfoProvider.cs (8)
134private static bool HasNoErrors(ImmutableArray<ISymbol> symbols) 189protected virtual NullableFlowState GetNullabilityAnalysis(SemanticModel semanticModel, ISymbol symbol, SyntaxNode node, CancellationToken cancellationToken) => NullableFlowState.None; 212var firstSymbol = symbols.First(); 237private ImmutableArray<ISymbol> GetSymbolsFromToken(SyntaxToken token, SolutionServices services, SemanticModel semanticModel, CancellationToken cancellationToken) 241var symbol = semanticModel.GetSymbolInfo(lambdaSyntax, cancellationToken).Symbol; 247var symbol = semanticModel.GetSymbolInfo(elementAccessExpression, cancellationToken).Symbol; 264private static bool IsOk([NotNullWhen(returnValue: true)] ISymbol? symbol) 278private 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 readonly ImmutableArray<ISymbol> Symbols = symbols;
QuickInfo\QuickInfoUtilities.cs (3)
21public static Task<QuickInfoItem> CreateQuickInfoItemAsync(SolutionServices services, SemanticModel semanticModel, TextSpan span, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, CancellationToken cancellationToken) 28ImmutableArray<ISymbol> symbols, 41var 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)
SemanticSearch\AbstractSemanticSearchService.cs (2)
159var symbols = (IEnumerable<ISymbol?>?)findMethod.Invoke(null, [compilation]) ?? []; 416typeof(IEnumerable<ISymbol>).IsAssignableFrom(candidate.ReturnType) &&
Shared\Extensions\DocumentExtensions.cs (1)
96public 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) 183public static ImmutableArray<TaggedText> GetDocumentationParts(this ISymbol symbol, SemanticModel semanticModel, int position, IDocumentationCommentFormattingService formatter, CancellationToken cancellationToken) 190public static DocumentationComment GetAppropriateDocumentationComment(this ISymbol symbol, Compilation compilation, CancellationToken cancellationToken) 206var containingSymbol = parameter.ContainingSymbol; 233this 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)
115public static string GetTypeParameterSuffix(Document document, SyntaxFormattingOptions formattingOptions, INamedTypeSymbol type, IEnumerable<ISymbol> extractableMembers, CancellationToken cancellationToken) 130public static ImmutableArray<ITypeParameterSymbol> GetRequiredTypeParametersForMembers(INamedTypeSymbol type, IEnumerable<ISymbol> includedMembers) 184private static ImmutableArray<ITypeParameterSymbol> GetDirectlyReferencedTypeParameters(IEnumerable<ITypeParameterSymbol> potentialTypeParameters, IEnumerable<ISymbol> includedMembers) 198private 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 (3)
115foreach (var member in members) 139foreach (var member in namedType.GetMembers()) 243private 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)
42protected abstract bool ShouldIgnore(ISymbol symbol); 87var symbol = syntaxContext.SemanticModel.GetDeclaredSymbol(syntaxContext.Node, syntaxContext.CancellationToken); 113ISymbol symbol,
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
37protected 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)
45protected abstract bool CanMemberAccessBeQualified(ISymbol containingSymbol, SyntaxNode node); 147static bool IsStaticMemberOrIsLocalFunctionHelper(ISymbol symbol)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
751using var _ = PooledHashSet<ISymbol>.GetInstance(out var processedPartialSymbols);
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\SuppressMessageAttributeState.cs (1)
96out ImmutableArray<ISymbol> resolvedSymbols)
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (16)
89protected virtual void HandleNamedTypeSymbolStart(SymbolStartAnalysisContext context, Action<ISymbol, ValueUsageInfo> onSymbolUsageFound) 100private readonly Dictionary<ISymbol, ValueUsageInfo> _symbolValueUsageStateMap = []; 141private static Location GetDiagnosticLocation(ISymbol symbol) 206Action<ISymbol, ValueUsageInfo> onSymbolUsageFound = OnSymbolUsage; 259foreach (var member in namedType.GetMembers()) 278var symbol = symbolContext.Symbol.OriginalDefinition; 320private void OnSymbolUsage(ISymbol? memberSymbol, ValueUsageInfo usageInfo) 339private bool TryRemove(ISymbol memberSymbol, out ValueUsageInfo valueUsageInfo) 356var memberSymbol = memberReference.Member.OriginalDefinition; 484using var _1 = PooledHashSet<ISymbol>.GetInstance(out var symbolsReferencedInDocComments); 491foreach (var member in namedType.GetMembers()) 590ISymbol member, 632HashSet<ISymbol> builder, 714foreach (var member in namedTypeSymbol.GetMembers()) 729private void AddDebuggerDisplayAttributeArgumentsCore(ISymbol symbol, ArrayBuilder<string> builder) 755private bool IsCandidateSymbol([NotNullWhen(true)] ISymbol? memberSymbol)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (2)
270public bool IsComputingUnusedParams(ISymbol symbol) 275ISymbol 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)
123foreach (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)
35protected abstract (bool matched, bool canSimplify) TryMatchPattern(IConditionalOperation ifOperation, ISymbol containingSymbol);
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentDiagnosticAnalyzer.cs (1)
28protected override (bool matched, bool canSimplify) TryMatchPattern(IConditionalOperation ifOperation, ISymbol containingSymbol)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnDiagnosticAnalyzer.cs (1)
28protected sealed override (bool matched, bool canSimplify) TryMatchPattern(IConditionalOperation ifOperation, ISymbol containingSymbol)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\UseConditionalExpressionForReturnHelpers.cs (1)
16ISymbol 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)
126if (IsExplicitlyImplemented(type, leftSymbol, out var typeMember)) 176ISymbol? member, 177[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)
107if (!TryDecomposeIfCondition(ifOperation, out var localOrParameter)) 139private static bool ValueIsAccessed(SemanticModel semanticModel, IConditionalOperation ifOperation, IBlockOperation containingBlock, ISymbol localOrParameter, IExpressionStatementOperation expressionStatement, IAssignmentOperation assignmentExpression) 168IBlockOperation containingBlock, IConditionalOperation ifOperation, ISymbol localOrParameter, 190if (!TryGetLocalOrParameterSymbol(assignmentExpression.Value, out var assignmentValue)) 210[NotNullWhen(true)] out ISymbol? localOrParameter) 242[NotNullWhen(true)] out ISymbol? localOrParameter)
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
53var symbol = semanticModel.GetDeclaredSymbol(declarator, cancellationToken);
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AddAccessibilityModifiersHelpers.cs (2)
15SyntaxEditor editor, ISymbol symbol, SyntaxNode declaration) 41private 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)
114for (ISymbol current = symbol; current != null; current = current.ContainingSymbol)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
122protected static bool IsSymbolAccessible(ISymbol? symbol, SemanticDocument document)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (3)
57private ImmutableDictionary<string, ISymbol>? _parameterToExistingMemberMap; 406var definition = SymbolFinderInternal.FindSourceDefinition(original, _document.Project.Solution, cancellationToken); 464private 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) 349ISymbol symbol,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
30protected abstract bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (6)
345var previousAssignedSymbol = TryGetAssignedSymbol(symbolKind, children, statementindex - 1, cancellationToken); 346var nextAssignedSymbol = TryGetAssignedSymbol(symbolKind, children, statementindex + 1, cancellationToken); 361private ISymbol TryGetAssignedSymbol( 378var symbol = _document.SemanticModel.GetSymbolInfo(left, cancellationToken).Symbol; 393var symbol = semanticModel.GetEnclosingSymbol(position, cancellationToken); 407private 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)
98public ImmutableArray<ISymbol> ImplementInterfaceMember( 104ISymbol 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)
29private ImmutableArray<ISymbol> GeneratePropertyMembers( 57using var result = TemporaryArray<ISymbol>.Empty;
src\Analyzers\Core\CodeFixes\MakeTypePartial\AbstractMakeTypePartialCodeFixProvider.cs (1)
38var 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)
40protected abstract ICollection<ISymbol> GetMissingEnumMembers(TSwitchOperation switchOperation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
46protected 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)
60var 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)
12public ISymbol Symbol { get; } 14internal 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)
45public 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)
49public abstract ImmutableArray<SyntaxNode> GetDeclarators(ISymbol method); 308ISymbol? expectedOldSymbol = null, expectedNewSymbol = null; 326symbolKey.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.Protocol (1)
Handler\References\FindUsagesLSPContext.cs (1)
254var symbol = await SymbolFinder.FindSymbolAtPositionAsync(_document, _position, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.Remote.ServiceHub (3)
Services\SymbolFinder\RemoteSymbolFinderService.cs (3)
84private static ImmutableArray<SerializableSymbolAndProjectId> Convert(ImmutableArray<ISymbol> items, Solution solution, CancellationToken cancellationToken) 88foreach (var item in items) 230ImmutableArray<(SymbolGroup group, ISymbol symbol, ReferenceLocation location)> references,
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)
696var 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 2592isAddedSymbol As Func(Of ISymbol, Boolean), 2803Protected Overrides Function CommonGetAssemblyOrModuleSymbol(reference As MetadataReference) As ISymbol 3113Public Overrides Function GetSymbolsWithName(predicate As Func(Of String, Boolean), Optional filter As SymbolFilter = SymbolFilter.TypeAndMember, Optional cancellationToken As CancellationToken = Nothing) As IEnumerable(Of ISymbol) 3144Public Overrides Function GetSymbolsWithName(name As String, Optional filter As SymbolFilter = SymbolFilter.TypeAndMember, Optional cancellationToken As CancellationToken = Nothing) As IEnumerable(Of ISymbol) 3196Public Function GetSymbolsWithName() As IEnumerable(Of ISymbol) 3197Dim result = New HashSet(Of ISymbol)() 3209spine As ArrayBuilder(Of MergedNamespaceOrTypeDeclaration), current As MergedNamespaceOrTypeDeclaration, [set] As HashSet(Of ISymbol)) 3250spine 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)
64Public Function GetDeclaredSymbol(semanticModel As SemanticModel, token As SyntaxToken, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.GetDeclaredSymbol 223Public Function GetDeclaredSymbols(semanticModel As SemanticModel, memberDeclaration As SyntaxNode, cancellationToken As CancellationToken) As IEnumerable(Of ISymbol) Implements ISemanticFacts.GetDeclaredSymbols 241Public Function FindFieldOrPropertyForArgument(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.FindFieldOrPropertyForArgument 256Public Function FindFieldOrPropertyForAttributeArgument(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.FindFieldOrPropertyForAttributeArgument 260Public Function GetBestOrAllSymbols(semanticModel As SemanticModel, node As SyntaxNode, token As SyntaxToken, cancellationToken As CancellationToken) As ImmutableArray(Of ISymbol) Implements ISemanticFacts.GetBestOrAllSymbols 262Return ImmutableArray(Of ISymbol).Empty 267ImmutableArray.Create(Of ISymbol)(preprocessingSymbol), 275Public Function GetLocalFunctionSymbols(compilation As Compilation, symbol As ISymbol, cancellationToken As CancellationToken) As ImmutableArray(Of IMethodSymbol) Implements ISemanticFacts.GetLocalFunctionSymbols 333Public Function GetInterceptorSymbolAsync(document As Document, position As Integer, cancellationToken As CancellationToken) As Task(Of ISymbol) Implements ISemanticFacts.GetInterceptorSymbolAsync 335Return 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)
35Public Overrides Function GetCapturedVariables(model As SemanticModel) As ImmutableArray(Of ISymbol)
EditAndContinue\DeclarationBody\FieldWithSingleArrayBoundsDeclarationBody.vb (1)
40Public 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)
101Friend Overrides Function TryGetDeclarationBody(node As SyntaxNode, symbol As ISymbol) As MemberBody 105Friend Overrides Function IsDeclarationWithSharedBody(declaration As SyntaxNode, member As ISymbol) As Boolean 114Protected Overrides Function GetVariableUseSites(roots As IEnumerable(Of SyntaxNode), localOrParameter As ISymbol, model As SemanticModel, cancellationToken As CancellationToken) As IEnumerable(Of SyntaxNode) 532Protected Overrides Function GetSymbolDeclarationSyntax(symbol As ISymbol, selector As Func(Of ImmutableArray(Of SyntaxReference), SyntaxReference), cancellationToken As CancellationToken) As SyntaxNode 637Protected Overrides Function GetDeclaredSymbol(model As SemanticModel, declaration As SyntaxNode, cancellationToken As CancellationToken) As ISymbol 641Friend Overrides Function IsConstructorWithMemberInitializers(symbol As ISymbol, cancellationToken As CancellationToken) As Boolean 711cancellationToken As CancellationToken) As OneOrMany(Of (oldSymbol As ISymbol, newSymbol As ISymbol)) 713Dim oldSymbols = OneOrMany(Of ISymbol).Empty 714Dim newSymbols = OneOrMany(Of ISymbol).Empty 718Return OneOrMany(Of (ISymbol, ISymbol)).Empty 734oldSymbols As OneOrMany(Of ISymbol), 735newSymbols As OneOrMany(Of ISymbol)) As IEnumerable(Of (ISymbol, ISymbol)) 746ByRef result As TemporaryArray(Of (ISymbol, ISymbol, EditKind)), 749oldSymbol As ISymbol, 751newSymbol As ISymbol, 897<Out> ByRef symbols As OneOrMany(Of ISymbol), 943Private Function GetParameterContainingMemberOrType(node As SyntaxNode, otherNode As SyntaxNode, model As SemanticModel, fromOtherMap As IReadOnlyDictionary(Of SyntaxNode, SyntaxNode), cancellationToken As CancellationToken) As ISymbol 1981Friend Overrides Sub ReportInsertedMemberSymbolRudeEdits(diagnostics As ArrayBuilder(Of RudeEditDiagnostic), newSymbol As ISymbol, newNode As SyntaxNode, insertingIntoExistingContainingType As Boolean) 1993Private 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)
149symbolProvider As Func(Of Compilation, ISymbol), 153Optional deletedSymbolContainerProvider As Func(Of Compilation, ISymbol) = Nothing) As SemanticEditDescription 158symbolProvider As Func(Of Compilation, ISymbol), 162Optional deletedSymbolContainerProvider As Func(Of Compilation, ISymbol) = Nothing) As SemanticEditDescription 174symbolProvider As Func(Of Compilation, ISymbol), 177Optional deletedSymbolContainerProvider As Func(Of Compilation, ISymbol) = Nothing) As SemanticEditDescription
EditAndContinue\Helpers\VisualBasicEditAndContinueTestVerifier.vb (1)
48Public 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)
64Public Function GetDeclaredSymbol(semanticModel As SemanticModel, token As SyntaxToken, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.GetDeclaredSymbol 223Public Function GetDeclaredSymbols(semanticModel As SemanticModel, memberDeclaration As SyntaxNode, cancellationToken As CancellationToken) As IEnumerable(Of ISymbol) Implements ISemanticFacts.GetDeclaredSymbols 241Public Function FindFieldOrPropertyForArgument(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.FindFieldOrPropertyForArgument 256Public Function FindFieldOrPropertyForAttributeArgument(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.FindFieldOrPropertyForAttributeArgument 260Public Function GetBestOrAllSymbols(semanticModel As SemanticModel, node As SyntaxNode, token As SyntaxToken, cancellationToken As CancellationToken) As ImmutableArray(Of ISymbol) Implements ISemanticFacts.GetBestOrAllSymbols 262Return ImmutableArray(Of ISymbol).Empty 267ImmutableArray.Create(Of ISymbol)(preprocessingSymbol), 275Public Function GetLocalFunctionSymbols(compilation As Compilation, symbol As ISymbol, cancellationToken As CancellationToken) As ImmutableArray(Of IMethodSymbol) Implements ISemanticFacts.GetLocalFunctionSymbols 333Public Function GetInterceptorSymbolAsync(document As Document, position As Integer, cancellationToken As CancellationToken) As Task(Of ISymbol) Implements ISemanticFacts.GetInterceptorSymbolAsync 335Return 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 (1202)
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)
65public 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)
63var boundSymbol = state.SemanticModel.GetSymbolInfo(token.Parent, cancellationToken).Symbol;
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (2)
249var constructor = state.SemanticModel.GetSymbolInfo(node, cancellationToken).Symbol; 290var constructor = state.SemanticModel.GetSymbolInfo(node, cancellationToken).Symbol;
FindSymbols\FindReferences\Finders\EventSymbolReferenceFinder.cs (3)
20protected sealed override ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 29.ToImmutableArray<ISymbol>(); 33.CastArray<ISymbol>();
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)
20protected 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)
36private static readonly ObjectPool<Dictionary<ISymbol, SymbolGroup>> s_symbolToGroupPool = new(() => new(MetadataUnifyingEquivalenceComparer.Instance)); 60public Task FindReferencesAsync(ISymbol symbol, CancellationToken cancellationToken) 64ImmutableArray<ISymbol> symbols, CancellationToken cancellationToken) 83ImmutableArray<ISymbol> symbols, Action<Reference> onReferenceFound, CancellationToken cancellationToken) 126private async IAsyncEnumerable<(Project project, ImmutableArray<(ISymbol symbol, SymbolGroup group)> allSymbols)> GetProjectsAndSymbolsToSearchSeriallyAsync( 129Dictionary<ISymbol, SymbolGroup> symbolToGroup, 164private async Task<ImmutableArray<(ISymbol symbol, SymbolGroup group)>> ReportGroupsSeriallyAsync( 165ImmutableArray<ISymbol> symbols, Dictionary<ISymbol, SymbolGroup> symbolToGroup, CancellationToken cancellationToken) 167var result = new FixedSizeArrayBuilder<(ISymbol symbol, SymbolGroup group)>(symbols.Length); 170foreach (var symbol in symbols) 177ISymbol symbol, Dictionary<ISymbol, SymbolGroup> symbolToGroup, CancellationToken cancellationToken) 193foreach (var groupSymbol in group.Symbols) 207ImmutableArray<ISymbol> symbols, CancellationToken cancellationToken) 217Project project, ImmutableArray<(ISymbol symbol, SymbolGroup group)> allSymbols, Action<Reference> onReferenceFound, CancellationToken cancellationToken) 219using var _1 = PooledDictionary<ISymbol, PooledHashSet<string>>.GetInstance(out var symbolToGlobalAliases); 220using var _2 = PooledDictionary<Document, Dictionary<ISymbol, SymbolGroup>>.GetInstance(out var documentToSymbolsWithin); 275Dictionary<ISymbol, SymbolGroup> symbolsToSearchFor, 276Dictionary<ISymbol, PooledHashSet<string>> symbolToGlobalAliases, 320ISymbol symbolToSearchFor, SymbolGroup symbolGroup, FindReferencesDocumentState state, Action<Reference> onReferenceFound) 344ImmutableArray<(ISymbol symbol, SymbolGroup group)> allSymbols, 345PooledDictionary<ISymbol, PooledHashSet<string>> symbolToGlobalAliases, 363private static void FreeGlobalAliases(PooledDictionary<ISymbol, PooledHashSet<string>> symbolToGlobalAliases) 369private 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)
44public abstract ImmutableArray<ISymbol> GetAllSymbols(); 97foreach (var symbol in symbols) 103private static ISymbol? TryMapToAppropriateSymbol( 104Solution solution, ISymbol symbol, CancellationToken cancellationToken) 109var searchSymbol = symbol; 136var sourceSymbol = SymbolFinder.FindSourceDefinition(searchSymbol, solution, cancellationToken); 151using var _ = ArrayBuilder<ISymbol>.GetInstance(out var workQueue); 154foreach (var symbol in symbols) 158while (workQueue.TryPop(out var currentSymbol)) 171using var _ = ArrayBuilder<ISymbol>.GetInstance(out var workQueue); 176while (workQueue.TryPop(out var currentSymbol)) 186FindReferencesSearchEngine engine, ImmutableArray<ISymbol> symbols, MetadataUnifyingSymbolHashSet seenSymbols, ArrayBuilder<ISymbol> workQueue, CancellationToken cancellationToken) 188foreach (var symbol in symbols) 193FindReferencesSearchEngine engine, ISymbol symbol, MetadataUnifyingSymbolHashSet seenSymbols, ArrayBuilder<ISymbol> workQueue, CancellationToken cancellationToken) 196var mapped = await TryMapAndAddLinkedSymbolsAsync(symbol).ConfigureAwait(false); 211async Task<ISymbol?> TryMapAndAddLinkedSymbolsAsync(ISymbol symbol) 213var mapped = TryMapToAppropriateSymbol(solution, symbol, cancellationToken); 238FindReferencesSearchEngine engine, ISymbol symbol, 239MetadataUnifyingSymbolHashSet seenSymbols, ArrayBuilder<ISymbol> workQueue, 272ISymbol symbol, 274ArrayBuilder<ISymbol> workQueue, 295if (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)
10internal sealed class MetadataUnifyingSymbolHashSet : HashSet<ISymbol>
FindSymbols\FindReferences\NoOpStreamingFindReferencesProgress.cs (1)
31public ValueTask OnReferencesFoundAsync(ImmutableArray<(SymbolGroup group, ISymbol symbol, ReferenceLocation location)> references, CancellationToken cancellationToken) => default;
FindSymbols\FindReferences\StreamingFindReferencesProgress.cs (2)
46foreach (var symbol in group.Symbols) 57public 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)
19/// Represents a group of <see cref="ISymbol"/>s that should be treated as a single entity for 30public ImmutableHashSet<ISymbol> Symbols { get; } 34public SymbolGroup(ImmutableArray<ISymbol> symbols) 56foreach (var symbol in Symbols) 77ValueTask OnReferencesFoundAsync(ImmutableArray<(SymbolGroup group, ISymbol symbol, ReferenceLocation location)> references, CancellationToken cancellationToken);
FindSymbols\ReferencedSymbol.cs (2)
29public ISymbol Definition { get; } 42ISymbol 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)
19/// Collects all the <see cref="ISymbol"/> definitions and <see cref="ReferenceLocation"/> 29private readonly Dictionary<ISymbol, List<ReferenceLocation>> _symbolToLocations = []; 59foreach (var definition in group.Symbols) 72ImmutableArray<(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)
28private readonly Dictionary<SerializableSymbolAndProjectId, ISymbol> _definitionMap = []; 46using var _ = PooledDictionary<SerializableSymbolAndProjectId, ISymbol>.GetInstance(out var map); 72using var _ = ArrayBuilder<(SymbolGroup group, ISymbol symbol, ReferenceLocation location)>.GetInstance(references.Length, out var rehydrated); 77ISymbol? 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 (2)
46var enclosingSymbol = context.SemanticModel.GetEnclosingSymbol(context.LeftToken.SpanStart, cancellationToken); 72internal bool ShouldIncludeSymbol(ISymbol symbol)
Recommendations\AbstractRecommendationServiceRunner.cs (18)
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); 318var specialTypeSymbol = _context.SemanticModel 331protected static bool IsNonIntersectingNamespace(ISymbol recommendationSymbol, SyntaxNode declarationSyntax) 356protected ImmutableArray<ISymbol> GetMemberSymbols( 357ISymbol container, 387protected ImmutableArray<ISymbol> LookupSymbolsInContainer( 402using var _ = ArrayBuilder<ISymbol>.GetInstance(containerMembers.Length, out var result); 404foreach (var member in containerMembers) 413var originalMember = member.GetOriginalUnreducedDefinition(); 527protected 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)
53ISymbol symbol, 130private static ImmutableArray<ISymbol> SymbolsForEnclosingInvocationExpressionWorker(SyntaxNode invocationExpression, SemanticModel semanticModel, CancellationToken cancellationToken) 145private static bool LocalVariableConflictPerLanguage(SyntaxToken tokenOrNode, Document document, ImmutableArray<ISymbol> newReferencedSymbols) 168private static bool IsRenameValid(MutableConflictResolution conflictResolution, ISymbol renamedSymbol) 176ISymbol renamedSymbol, 177ISymbol originalSymbol, 229ISymbol renamedSymbol, 230ISymbol renameSymbol, 231IEnumerable<ISymbol> referencedSymbols, 246IEnumerable<ISymbol> otherThingsNamedTheSameExcludeMethodAndParameterizedProperty; 325private static void AddConflictingSymbolLocations(IEnumerable<ISymbol> conflictingSymbols, MutableConflictResolution conflictResolution, IDictionary<Location, Location> reverseMappedLocations) 327foreach (var newSymbol in conflictingSymbols) 346IEnumerable<ISymbol> symbols, 352foreach (var symbol in symbols) 359var overriddenSymbol = symbol.GetOverriddenMember(); 384private static string GetString(ISymbol symbol) 401private static Location? GetSymbolLocation(Solution solution, ISymbol symbol, CancellationToken cancellationToken) 405var originalsourcesymbol = SymbolFinder.FindSourceDefinition(symbol, solution, cancellationToken);
Rename\ConflictEngine\ConflictResolver.Session.cs (15)
211var renamedSymbolInNewSolution = await GetRenamedSymbolInCurrentSolutionAsync(conflictResolution).ConfigureAwait(false); 314var renamedSymbolInNewSolution = await GetRenamedSymbolInCurrentSolutionAsync(conflictResolution).ConfigureAwait(false); 371ImmutableArray<ISymbol> newReferencedSymbols = default; 456var renameSymbol = _renameLocationSet.Symbol; 469private async Task<ImmutableHashSet<ISymbol>?> GetNonConflictSymbolsAsync(Project currentProject) 479ImmutableArray<ISymbol> symbols, ImmutableHashSet<ISymbol>? nonConflictSymbols) 483foreach (var symbol in symbols) 512ISymbol renamedSymbolInNewSolution, 514ImmutableArray<ISymbol> newReferencedSymbols) 575foreach (var symbol in newReferencedSymbols) 613var overriddenSymbol = overridingSymbol.GetOverriddenMember(); 652private ImmutableArray<ISymbol> GetSymbolsInNewSolution(Document newDocument, SemanticModel newDocumentSemanticModel, RenameActionAnnotation conflictAnnotation, SyntaxNodeOrToken tokenOrNode) 675private async Task<ISymbol> GetRenamedSymbolInCurrentSolutionAsync(MutableConflictResolution conflictResolution) 706var 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)
50public async Task<SymbolicRenameLocations?> ToSymbolicLocationsAsync(ISymbol symbol, CancellationToken cancellationToken) 74ISymbol symbol, Solution solution, SymbolRenameOptions options, CancellationToken cancellationToken) 118public Task<ConflictResolution> ResolveConflictsAsync(ISymbol symbol, string replacementText, ImmutableArray<SymbolKey> nonConflictSymbolKeys, CancellationToken cancellationToken)
Rename\Renamer.cs (5)
40public static Task<Solution> RenameSymbolAsync(Solution solution, ISymbol symbol, string newName, OptionSet? optionSet, CancellationToken cancellationToken = default) 44Solution solution, ISymbol symbol, SymbolRenameOptions options, string newName, CancellationToken cancellationToken = default) 141internal static Task<LightweightRenameLocations> FindRenameLocationsAsync(Solution solution, ISymbol symbol, SymbolRenameOptions options, CancellationToken cancellationToken) 146ISymbol symbol, 191ISymbol 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; 381var property = await TryGetPropertyFromAccessorOrAnOverrideAsync(bestSymbol, solution, cancellationToken).ConfigureAwait(false);
Rename\SymbolicRenameLocations.cs (9)
27public readonly ISymbol Symbol; 32public readonly ImmutableArray<ISymbol> ReferencedSymbols; 35ISymbol symbol, 40ImmutableArray<ISymbol> referencedSymbols) 59ISymbol symbol, Solution solution, SymbolRenameOptions options, CancellationToken cancellationToken) 83using var _1 = ArrayBuilder<ISymbol>.GetInstance(out var mergedReferencedSymbols); 115ISymbol symbol, Solution solution, CancellationToken cancellationToken) 119foreach (var overloadedSymbol in RenameUtilities.GetOverloadedSymbols(symbol)) 126ISymbol 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)
17public readonly ImmutableArray<ISymbol> ReferencedSymbols; 22ImmutableArray<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 (22)
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 668private static ImmutableArray<T> RemoveOverriddenSymbolsWithinSet<T>(this ImmutableArray<T> symbols) where T : ISymbol 674var overriddenMember = symbol.GetOverriddenMember(); 683this 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 (95)
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) 214public static INamedTypeSymbol? GetContainingTypeOrThis(this ISymbol symbol) 224public static bool IsErrorType([NotNullWhen(true)] this ISymbol? symbol) 227public static bool IsModuleType([NotNullWhen(true)] this ISymbol? symbol) 230public static bool IsInterfaceType([NotNullWhen(true)] this ISymbol? symbol) 233public static bool IsArrayType([NotNullWhen(true)] this ISymbol? symbol) 236public static bool IsTupleType([NotNullWhen(true)] this ISymbol? symbol) 239public static bool IsAnonymousFunction([NotNullWhen(true)] this ISymbol? symbol) 242public static bool IsKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind) 245public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind) 248public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind1, SymbolKind kind2) 254public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind1, SymbolKind kind2, SymbolKind kind3) 260public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, params SymbolKind[] kinds) 266public static bool IsReducedExtension([NotNullWhen(true)] this ISymbol? symbol) 269public static bool IsEnumMember([NotNullWhen(true)] this ISymbol? symbol) 272public static bool IsExtensionMethod(this ISymbol symbol) 275public static bool IsLocalFunction([NotNullWhen(true)] this ISymbol? symbol) 278public static bool IsAnonymousOrLocalFunction([NotNullWhen(true)] this ISymbol? symbol) 281public static bool IsModuleMember([NotNullWhen(true)] this ISymbol? symbol) 284public static bool IsConstructor([NotNullWhen(true)] this ISymbol? symbol) 287public static bool IsStaticConstructor([NotNullWhen(true)] this ISymbol? symbol) 290public static bool IsDestructor([NotNullWhen(true)] this ISymbol? symbol) 293public static bool IsUserDefinedOperator([NotNullWhen(true)] this ISymbol? symbol) 296public static bool IsConversion([NotNullWhen(true)] this ISymbol? symbol) 299public static bool IsOrdinaryMethod([NotNullWhen(true)] this ISymbol? symbol) 302public static bool IsOrdinaryMethodOrLocalFunction([NotNullWhen(true)] this ISymbol? symbol) 305public static bool IsDelegateType([NotNullWhen(true)] this ISymbol? symbol) 308public static bool IsAnonymousType([NotNullWhen(true)] this ISymbol? symbol) 311public static bool IsNormalAnonymousType([NotNullWhen(true)] this ISymbol? symbol) 314public static bool IsAnonymousDelegateType([NotNullWhen(true)] this ISymbol? symbol) 317public static bool IsAnonymousTypeProperty([NotNullWhen(true)] this ISymbol? symbol) 320public static bool IsTupleField([NotNullWhen(true)] this ISymbol? symbol) 323public static bool IsIndexer([NotNullWhen(true)] this ISymbol? symbol) 326public static bool IsWriteableFieldOrProperty([NotNullWhen(true)] this ISymbol? symbol) 334public static bool IsRequired([NotNullWhen(true)] this ISymbol? symbol) 337public static ITypeSymbol? GetMemberType(this ISymbol? symbol) 349public static int GetArity(this ISymbol symbol) 358public static ISymbol? GetOriginalUnreducedDefinition(this ISymbol? symbol) 401public static bool IsFunctionValue([NotNullWhen(true)] this ISymbol? symbol) 404public static bool IsThisParameter([NotNullWhen(true)] this ISymbol? symbol) 408public static ISymbol? ConvertThisParameterToType(this ISymbol? symbol) 418public static bool IsParams([NotNullWhen(true)] this ISymbol? symbol) 421public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol? symbol) 429public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 437public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 450public static ImmutableArray<ITypeSymbol> GetTypeArguments(this ISymbol? symbol) 458public static ImmutableArray<ITypeSymbol> GetAllTypeArguments(this ISymbol symbol) 473public static bool IsAttribute([NotNullWhen(true)] this ISymbol? symbol) 482public static bool RequiresUnsafeModifier([NotNullWhen(true)] this ISymbol? member) 489this ISymbol? symbol, 532public static bool IsStaticType([NotNullWhen(true)] this ISymbol? symbol) 535public static bool IsNamespace([NotNullWhen(true)] this ISymbol? symbol) 539[NotNullWhen(true)] this ISymbol? symbol, ISymbol withinType, IAssemblySymbol withinAssembly, CancellationToken cancellationToken) 559public static IEnumerable<IPropertySymbol> GetValidAnonymousTypeProperties(this ISymbol symbol) 565public static Accessibility ComputeResultantAccessibility(this ISymbol? symbol, ITypeSymbol finalDestination) 591public static bool IsInaccessibleLocal(this ISymbol symbol, int position) 609public static bool IsAccessor([NotNullWhen(true)] this ISymbol? symbol) 612public static bool IsPropertyAccessor([NotNullWhen(true)] this ISymbol? symbol) 615public static bool IsEventAccessor([NotNullWhen(true)] this ISymbol? symbol) 618public static bool IsFromSource(this ISymbol symbol) 621public static bool IsNonImplicitAndFromSource(this ISymbol symbol) 624public static ITypeSymbol? GetSymbolType(this ISymbol? symbol) 640public static bool IsAwaitableNonDynamic([NotNullWhen(true)] this ISymbol? symbol, SemanticModel semanticModel, int position) 779public static bool IsKind<TSymbol>(this ISymbol symbol, SymbolKind kind, [NotNullWhen(true)] out TSymbol? result) where TSymbol : class, ISymbol 796public static bool IsSymbolWithSpecialDiscardName(this ISymbol symbol) 805public static bool IsObsolete(this ISymbol symbol) 812public 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)
17this ISymbol symbol, 18ISymbol within, 39this ISymbol symbol, 51this ISymbol symbol, 64ISymbol symbol, 83ISymbol symbol, 84ISymbol within, // must be assembly or named type symbol 174private static bool IsNamedTypeAccessible(INamedTypeSymbol type, ISymbol within) 212ISymbol within) 247ISymbol within, 407ISymbol 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 (2)
18private readonly HashSet<ISymbol> _visited = []; 20public override void DefaultVisit(ISymbol node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (13)
403public static bool CanSupportCollectionInitializer(this ITypeSymbol typeSymbol, ISymbol within) 434public static IEnumerable<T> GetAccessibleMembersInBaseTypes<T>(this ITypeSymbol containingType, ISymbol within) where T : class, ISymbol 443public static ImmutableArray<T> GetAccessibleMembersInThisAndBaseTypes<T>(this ITypeSymbol? containingType, ISymbol within) where T : class, ISymbol 453public static ImmutableArray<T> GetAccessibleMembersInThisAndBaseTypes<T>(this ITypeSymbol? containingType, string memberName, ISymbol within) where T : class, ISymbol 498public static IEnumerable<T> SelectAccessibleMembers<T>(this IEnumerable<ITypeSymbol>? types, ISymbol within) where T : class, ISymbol 508private static IEnumerable<T> SelectAccessibleMembers<T>(this IEnumerable<ITypeSymbol>? types, string memberName, ISymbol within) where T : class, ISymbol 693foreach (var member in type.GetMembers()) 754public 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)
27public static ValueUsageInfo GetValueUsageInfo(this IOperation operation, ISymbol containingSymbol) 230public static RefKind GetRefKind(this IReturnOperation? operation, ISymbol containingSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (1)
136? EqualityComparer<ISymbol?>.Default.Equals(info1.Symbol, info2.Symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (11)
47public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 59public static ISymbol GetRequiredEnclosingSymbol(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 66where TSymbol : class, ISymbol 68for (var symbol = semanticModel.GetEnclosingSymbol(position, cancellationToken); 81public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 84(ISymbol)semanticModel.Compilation.Assembly; 93public static IEnumerable<ISymbol> GetExistingSymbols( 115public static HashSet<ISymbol> GetAllDeclaredSymbols( 118var symbols = new HashSet<ISymbol>(); 129HashSet<ISymbol> symbols, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 131var symbol = semanticModel.GetDeclaredSymbol(node, 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)
30private readonly Dictionary<ISymbol, PooledHashSet<IOperation>> _reachingWrites; 64public void Clear(ISymbol symbol) 76public void ForEachCurrentWrite<TArg>(ISymbol symbol, Action<IOperation, TArg> action, TArg arg) 88public bool ForEachCurrentWrite<TArg>(ISymbol symbol, Func<IOperation, TArg, bool> action, TArg arg) 106public void OnWriteReferenceFound(ISymbol symbol, IOperation operation, bool maybeWritten) 132foreach (var key in _reachingWrites.Keys) 225private 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)
24PooledDictionary<(ISymbol symbol, IOperation operation), bool> symbolsWriteMap, 25PooledHashSet<ISymbol> symbolsRead, 35protected override PooledHashSet<ISymbol> SymbolsReadBuilder { get; } 37protected override PooledDictionary<(ISymbol symbol, IOperation operation), bool> SymbolsWriteBuilder { get; } 42ISymbol owningSymbol, 47symbolsRead: PooledHashSet<ISymbol>.GetInstance(), 66public override void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId) 78public override void SetTargetsFromSymbolForDelegate(IOperation write, ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (13)
27private ISymbol _currentContainingSymbol; 30private PooledDictionary<IAssignmentOperation, PooledHashSet<(ISymbol, IOperation)>> _pendingWritesMap; 36ISymbol containingSymbol, 52private void Visit(ISymbol containingSymbol, IEnumerable<IOperation> operations, AnalysisData analysisData, CancellationToken cancellationToken) 59_pendingWritesMap = PooledDictionary<IAssignmentOperation, PooledHashSet<(ISymbol, IOperation)>>.GetInstance(); 91private void OnReadReferenceFound(ISymbol symbol) 94private void OnWriteReferenceFound(ISymbol symbol, IOperation operation, ValueUsageInfo valueUsageInfo) 102private void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId) 108private void OnReferenceFound(ISymbol symbol, IOperation operation) 160private bool MakePendingWrite(IOperation operation, ISymbol symbolOpt) 167var set = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 176set = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 408private void ProcessPossibleDelegateCreationAssignment(ISymbol symbol, IOperation write)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (6)
15ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 16ImmutableHashSet<ISymbol> symbolsRead) 35public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } = symbolWritesMap; 40public ImmutableHashSet<ISymbol> SymbolsRead { get; } = symbolsRead; 49public IEnumerable<(ISymbol Symbol, IOperation WriteOperation)> GetUnreadSymbolWrites() 73public int GetSymbolWriteCount(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (2)
21public static IdentifierNameParts CreateIdentifierNameParts(ISymbol symbol, ImmutableArray<NamingRule> rules) 37private static string RemovePrefixesAndSuffixes(ISymbol symbol, ImmutableArray<NamingRule> rules, string baseName)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (5)
20internal bool TryGetApplicableRule(ISymbol symbol, out NamingRule applicableRule) 39private bool IsSymbolNameAnalyzable(ISymbol symbol) 60private static bool DoesSymbolImplementAnotherSymbol(ISymbol symbol) 82private static bool IsInterfaceImplementation(ISymbol symbol) 95foreach (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)
67ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 92IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken); 97ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 98ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 100ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken); 107ImmutableArray<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)
20public static ImmutableArray<Location> GetBodyLevelSourceLocations(ISymbol symbol, CancellationToken cancellationToken) 39public static void Create(ISymbol symbol, SymbolKeyWriter visitor) 70var container = symbol.ContainingSymbol; 101private static SyntaxNode? TryGetContainerDeclaration(ISymbol container, SyntaxTree? syntaxTree, CancellationToken cancellationToken) 231var symbol = resolution.GetAnySymbol(); 255private static IEnumerable<(ISymbol symbol, int ordinal)> EnumerateSymbols( 264var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (31)
30/// the "same" <see cref="ISymbol.ContainingType"/> and 31/// equal <see cref="ISymbol.MetadataName"/>.</item> 33/// the "same" <see cref="ISymbol.ContainingType"/>, 34/// equal <see cref="ISymbol.MetadataName"/>, 40/// the "same" <see cref="ISymbol.ContainingAssembly"/>. 41/// <see cref="ISymbol.MetadataName"/> is not used because module identity is not important in practice.</item> 43/// the "same" <see cref="ISymbol.ContainingSymbol"/>, 44/// equal <see cref="ISymbol.MetadataName"/>, 48/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 49/// equal <see cref="ISymbol.MetadataName"/>. 54/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 55/// equal <see cref="ISymbol.MetadataName"/>.</item> 59/// the "same" the "same" <see cref="ISymbol.ContainingType"/>, 60/// the "same" <see cref="ISymbol.MetadataName"/>, and have 64/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 65/// the "same" <see cref="ISymbol.MetadataName"/>.</item> 67/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 68/// the "same" <see cref="ISymbol.MetadataName"/>.</item> 70/// the "same" <see cref="ISymbol.Name"/>.</item> 77/// cref="SyntaxTree"/> is enumerated to list all the symbols with the same <see cref="ISymbol.Name"/> and <see 78/// cref="ISymbol.Kind"/> as the original symbol. The symbol with the same index in the destination tree as the 128public static SymbolKey Create(ISymbol? symbol, CancellationToken cancellationToken = default) 147public 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)
64var containingContextualSymbol = containerKind switch 693 => (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)
58private readonly Action<ISymbol> _writeSymbolKey; 65private readonly Dictionary<ISymbol, int> _symbolToId = []; 129internal void WriteSymbolKey(ISymbol? symbol) 279where TSymbol : ISymbol 496public bool ShouldWriteTypeParameterOrdinal(ISymbol symbol, out int methodIndex)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
41using 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) 881private static bool IsAnonymousDelegateInvoke(ISymbol symbol) 897var symbol = originalSymbolInfo.Symbol; 898var newSymbol = newSymbolInfo.Symbol; 924for (var overriddenMember = newSymbol.GetOverriddenMember(); overriddenMember != null; overriddenMember = overriddenMember.GetOverriddenMember()) 975ISymbol symbol, 976ISymbol newSymbol, 1006var implementationMember = newSymbolContainingType.FindImplementationForInterfaceMember(symbol); 1053var receiverSymbol = semanticModel.GetSymbolInfo(receiver).GetAnySymbol(); 1063private bool SymbolsHaveCompatibleParameterLists(ISymbol originalSymbol, ISymbol newSymbol, TExpressionSyntax originalInvocation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (6)
27public bool HaveSameSignature(ISymbol symbol1, ISymbol symbol2, bool caseSensitive) 139public bool HaveSameSignatureAndConstraintsAndReturnTypeAndAccessors(ISymbol symbol1, ISymbol symbol2, bool caseSensitive) 154public bool HaveSameSignatureAndConstraintsAndReturnType(ISymbol symbol1, ISymbol symbol2, bool caseSensitive)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.cs (13)
39internal sealed partial class SymbolEquivalenceComparer : IEqualityComparer<ISymbol?> 153public bool Equals(ISymbol? x, ISymbol? y) 162public bool Equals(ISymbol? x, ISymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 168private bool EqualsCore(ISymbol? x, ISymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 171public int GetHashCode(ISymbol? x) 174private static ISymbol UnwrapAlias(ISymbol symbol) 177private static SymbolKind GetKindAndUnwrapAlias(ref ISymbol symbol) 195private static bool IsObjectType(ISymbol symbol) 220foreach (var candidate in errorType.CandidateSymbols)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (6)
21public bool AreEquivalent(ISymbol? x, ISymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 111private bool AreEquivalentWorker(ISymbol x, ISymbol y, SymbolKind k, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 271private 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)
66public TDeclarationNode AddMembers<TDeclarationNode>(TDeclarationNode destination, IEnumerable<ISymbol> members, CodeGenerationContextInfo info, CancellationToken cancellationToken) 116public TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 141public abstract TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 272IEnumerable<ISymbol> members, 295IEnumerable<ISymbol> members, 302foreach (var member in members) 326IEnumerable<ISymbol> members, 334foreach (var member in members) 343private SyntaxNode? GetNewMember(TCodeGenerationContextInfo info, CodeGenerationDestination codeGenerationDestination, ISymbol member, CancellationToken cancellationToken) 359ISymbol member, 374private static bool GeneratingEnum(IEnumerable<ISymbol> members) 456public Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
24public bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (1)
51var containingSymbol = type.ContainingSymbol;
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)
86public static Task<Document> AddMemberDeclarationsAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken) 92public static bool CanAdd(Solution solution, ISymbol destination, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (4)
84TDeclarationNode AddMembers<TDeclarationNode>(TDeclarationNode destination, IEnumerable<ISymbol> members, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 124TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 174Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken); 179bool 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)
30public virtual ImmutableArray<ISymbol> GetMembers() 33public 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)
56public ISymbol FindImplementationForInterfaceMember(ISymbol interfaceMember) => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\SyntaxAnnotationExtensions.cs (1)
16where TSymbol : ISymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (2)
144this IMethodSymbol method, ISymbol accessibleWithin, 174static 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)
87private static ITypeSymbol GetType(Compilation compilation, ISymbol symbol) 102this SyntaxGenerator generator, IMethodSymbol method, ISymbol throughMember) 117this SyntaxGenerator generator, ISymbol member, ISymbol throughMember) 181static SyntaxNode GenerateContainerName(SyntaxGenerator factory, ISymbol throughMember) 195ISymbol? throughMember, 234ISymbol? throughMember, 278private static bool TryGetValue(IDictionary<string, ISymbol>? dictionary, string key, [NotNullWhen(true)] out string? value) 281if (dictionary != null && dictionary.TryGetValue(key, out var symbol)) 290public static ImmutableArray<ISymbol> CreateFieldsForParameters( 293using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 312public static ImmutableArray<ISymbol> CreatePropertiesForParameters( 315using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 347IDictionary<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)
12/// 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)
31private static readonly Func<ISymbol, bool> s_LocalNameFilter = s => 74string baseName, Func<ISymbol, bool> filter, 91protected virtual IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode container, CancellationToken cancellationToken) 114var impl = type.FindImplementationForInterfaceMember(disposeMethodToLookFor); 197public ISymbol GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 227public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 236public ISymbol FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 239public ISymbol FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 242public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode node, SyntaxToken token, CancellationToken cancellationToken) 248public ImmutableArray<IMethodSymbol> GetLocalFunctionSymbols(Compilation compilation, ISymbol symbol, CancellationToken cancellationToken) 262public 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)
119protected static bool IsEnumHasFlag(ISymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (4)
64public static ISymbol? GetOriginalSymbolInfo(SemanticModel semanticModel, SyntaxNode expression) 70var typeSymbol = SymbolAnnotation.GetSymbol(annotation1, semanticModel.Compilation); 94public static bool IsValidSymbolInfo([NotNullWhen(true)] ISymbol? symbol) 115internal 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)
193internal ProjectId? GetOriginatingProjectId(ISymbol symbol) 197internal Project? GetOriginatingProject(ISymbol symbol) 205internal 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)
32private static readonly ConditionalWeakTable<ISymbol, ProjectId> s_assemblyOrModuleSymbolToProjectMap = new(); 54private ConditionalWeakTable<ISymbol, OriginatingProjectInfo?>? _unrootedSymbolToProjectId; 55private 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)
103ISymbol 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)
60ISymbol 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)
30private static void Verify(string searchTerm, bool respectCase, SolutionKind workspaceKind, IEnumerable<ISymbol> declarations, params string[] expectedResults) 47private static void Verify(SolutionKind workspaceKind, IEnumerable<ISymbol> declarations, params string[] expectedResults) 62private 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.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)
32/// 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)
204 var symbol = semanticModel.GetSymbolInfo(identifier).Symbol; 209 var symbol = semanticModel.GetSymbolInfo(elementAccess).Symbol; 214 var symbol = semanticModel.GetSymbolInfo(elementBinding).Symbol; 231 static bool IsWritable(ISymbol? symbol) 239 static bool AcceptsNullValue(ISymbol? symbol, bool enabledNullable)
InvocationParser.cs (2)
35 var symbol = _context.SemanticModel.GetSymbolInfo(invocation.Expression).Symbol; 66 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)
56ISymbol symbol, Project project, ImmutableArray<Location> callsites, CancellationToken cancellationToken) 83private static ISymbol GetTargetSymbol(ISymbol symbol) 103public async Task<IEnumerable<AbstractCallFinder>> CreateFindersAsync(ISymbol symbol, Project project, CancellationToken cancellationToken) 131foreach (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)
21public BaseMemberFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 29protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\CallToOverrideFinder.cs (3)
18public CallToOverrideFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 25protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken) 30foreach (var @override in overrides)
CallHierarchy\Finders\FieldReferenceFinder.cs (2)
19public FieldReferenceFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 32protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\ImplementerFinder.cs (4)
22public ImplementerFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 35protected override Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken) 38protected override async Task SearchWorkerAsync(ISymbol symbol, Project project, ICallHierarchySearchCallback callback, IImmutableSet<Document> documents, CancellationToken cancellationToken) 42foreach (var implementation in implementations)
CallHierarchy\Finders\InterfaceImplementationCallFinder.cs (2)
22public InterfaceImplementationCallFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 32protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\MethodCallFinder.cs (2)
20public MethodCallFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 35protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\OverridingMemberFinder.cs (4)
22public OverridingMemberFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 31protected override Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken) 34protected override async Task SearchWorkerAsync(ISymbol symbol, Project project, ICallHierarchySearchCallback callback, IImmutableSet<Document> documents, CancellationToken cancellationToken) 38foreach (var @override in overrides)
ChangeSignature\ChangeSignatureDialogViewModel.cs (1)
52ISymbol symbol,
ChangeSignature\VisualStudioChangeSignatureOptionsService.cs (1)
31ISymbol symbol,
CommonControls\MemberSelectionViewModel.cs (13)
24private readonly ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> _symbolToDependentsMap; 25private readonly ImmutableDictionary<ISymbol, MemberSymbolViewModel> _symbolToMemberViewMap; 30ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> dependentsMap, 134public ImmutableArray<(ISymbol member, bool makeAbstract)> GetSelectedMembers() 169private ImmutableHashSet<ISymbol> FindDependentsRecursively(ISymbol member) 171var queue = new Queue<ISymbol>(); 174var visited = new HashSet<ISymbol>(); 175var result = new HashSet<ISymbol>(); 180var currentMember = queue.Dequeue(); 183foreach (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)
41List<ISymbol> extractableMembers,
F1Help\AbstractHelpContextService.cs (1)
48public 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)
12internal class MemberListItem : SymbolListItem<ISymbol> 14internal 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)
12where 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)
33ImmutableArray<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)
21public static async Task<GraphNodeId> CreateNodeIdAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken) 62public 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)
27var symbol = graphBuilder.GetSymbol(node, cancellationToken);
Progression\GraphQueries\ContainsGraphQuery.cs (3)
32var symbol = graphBuilder.GetSymbol(node, cancellationToken); 35foreach (var newSymbol in SymbolContainment.GetContainedSymbols(symbol)) 49foreach (var newSymbol in await SymbolContainment.GetContainedSymbolsAsync(document, cancellationToken).ConfigureAwait(false))
Progression\GraphQueries\ImplementedByGraphQuery.cs (2)
27var symbol = graphBuilder.GetSymbol(node, cancellationToken); 35foreach (var implementation in implementations)
Progression\GraphQueries\ImplementsGraphQuery.cs (4)
28var symbol = graphBuilder.GetSymbol(node, cancellationToken); 31var implementedSymbols = ImmutableArray<ISymbol>.CastUp(namedType.AllInterfaces); 49GraphBuilder graphBuilder, GraphNode node, ImmutableArray<ISymbol> implementedSymbols, CancellationToken cancellationToken) 51foreach (var interfaceType in implementedSymbols)
Progression\GraphQueries\InheritedByGraphQuery.cs (1)
25var symbol = graphBuilder.GetSymbol(node, cancellationToken);
Progression\GraphQueries\InheritsGraphQuery.cs (1)
31var symbol = graphBuilder.GetSymbol(node, cancellationToken);
Progression\GraphQueries\IsCalledByGraphQuery.cs (1)
28var 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)
23var symbol = graphBuilder.GetSymbol(node, cancellationToken);
Progression\GraphQueries\OverridesGraphQuery.cs (2)
26var symbol = graphBuilder.GetSymbol(node, cancellationToken); 32foreach (var o in overrides)
Progression\IProgressionLanguageService.cs (2)
17string GetDescriptionForSymbol(ISymbol symbol, bool includeContainingSymbol); 18string 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 class MemberSymbolViewModel : SymbolViewModel<ISymbol> 55public MemberSymbolViewModel(ISymbol symbol, IGlyphService glyphService) : base(symbol, glyphService)
Utilities\SymbolViewModel.cs (1)
14internal class SymbolViewModel<T> : AbstractNotifyPropertyChanged where T : ISymbol
Venus\ContainedLanguageCodeSupport.cs (10)
97var eventMember = GetEventSymbol(document, objectTypeName, nameOfEvent, type, cancellationToken); 171var eventMember = GetEventSymbol(thisDocument, objectTypeName, nameOfEvent, type, cancellationToken); 262var member = LookupMemberId(type, uniqueMemberID); 320var symbol = FindSymbol(document, clrt, oldFullyQualifiedName, cancellationToken); 361private static bool IncludeMember(ISymbol member, CODEMEMBERTYPE memberType, Compilation compilation) 411private static ISymbol FindSymbol( 446internal static string ConstructMemberId(ISymbol member) 462internal static ISymbol LookupMemberId(INamedTypeSymbol type, string uniqueMemberID) 467foreach (var m in members) 478private static ISymbol GetEventSymbol(
Workspace\VisualStudioSymbolNavigationService.cs (3)
51ISymbol symbol, Project project, CancellationToken cancellationToken) 128Project project, ISymbol symbol, CancellationToken cancellationToken) 178public async Task<bool> TrySymbolNavigationNotifyAsync(ISymbol symbol, Project project, CancellationToken cancellationToken)
Workspace\VisualStudioSymbolRenamedCodeActionOperationFactoryWorkspaceService.cs (3)
35public CodeActionOperation CreateSymbolRenamedOperation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution) 48private readonly ISymbol _symbol; 55ISymbol 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)
303Dim memberViewModels = extractableMembers.Select(Function(member As ISymbol)
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.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 (5)
GenerateFilteredReferenceAssembliesTask.cs (5)
204void Recurse(IEnumerable<ISymbol> members) 206foreach (var member in members) 240private static bool IsIncluded(ISymbol symbol, ImmutableArray<ApiPattern> patterns) 263private static SymbolKindFlags GetKindFlags(ISymbol symbol) 346private 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())