src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (12)
36private readonly Func<IMethodSymbol, ControlFlowGraph, AnalysisData, CancellationToken, BasicBlockAnalysisData> _analyzeLocalFunctionOrLambdaInvocation;
55private readonly PooledDictionary<IMethodSymbol, ControlFlowGraph> _localFunctionTargetsToAccessingCfgMap;
79PooledHashSet<IMethodSymbol> lambdaOrLocalFunctionsBeingAnalyzed,
80Func<IMethodSymbol, ControlFlowGraph, AnalysisData, CancellationToken, BasicBlockAnalysisData> analyzeLocalFunctionOrLambdaInvocation,
82PooledDictionary<IMethodSymbol, ControlFlowGraph> localFunctionTargetsToAccessingCfgMap,
112protected override PooledHashSet<IMethodSymbol> LambdaOrLocalFunctionsBeingAnalyzed { get; }
119Func<IMethodSymbol, ControlFlowGraph, AnalysisData, CancellationToken, BasicBlockAnalysisData> analyzeLocalFunctionOrLambdaInvocation)
132lambdaOrLocalFunctionsBeingAnalyzed: PooledHashSet<IMethodSymbol>.GetInstance(),
135localFunctionTargetsToAccessingCfgMap: PooledDictionary<IMethodSymbol, ControlFlowGraph>.GetInstance(),
141IMethodSymbol lambdaOrLocalFunction,
321ControlFlowGraph TryGetLocalFunctionControlFlowGraphInScope(IMethodSymbol localFunction)
486protected override BasicBlockAnalysisData AnalyzeLocalFunctionInvocationCore(IMethodSymbol localFunction, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (19)
12private sealed class ReducedExtensionMethodSymbolKey : AbstractSymbolKey<IMethodSymbol>
16public sealed override void Create(IMethodSymbol symbol, SymbolKeyWriter visitor)
25SymbolKeyReader reader, IMethodSymbol? contextualMethod, out string? failureReason)
42using var result = PooledArrayBuilder<IMethodSymbol>.GetInstance();
43foreach (var reducedFrom in reducedFromResolution.OfType<IMethodSymbol>())
56private sealed class ConstructedMethodSymbolKey : AbstractSymbolKey<IMethodSymbol>
60public sealed override void Create(IMethodSymbol symbol, SymbolKeyWriter visitor)
67SymbolKeyReader reader, IMethodSymbol? contextualMethod, out string? failureReason)
71using var typeArguments = reader.ReadSymbolKeyArray<IMethodSymbol, ITypeSymbol>(
102using var result = PooledArrayBuilder<IMethodSymbol>.GetInstance();
103foreach (var method in constructedFrom.OfType<IMethodSymbol>())
124private sealed class MethodSymbolKey : AbstractSymbolKey<IMethodSymbol>
128public sealed override void Create(IMethodSymbol symbol, SymbolKeyWriter visitor)
161SymbolKeyReader reader, IMethodSymbol? contextualSymbol, out string? failureReason)
180using var methods = GetMembersOfNamedType<IMethodSymbol>(containingType, metadataName: null);
181IMethodSymbol? method = null;
224_ = reader.ReadSymbolKeyArray<IMethodSymbol, ITypeSymbol>(
244private static IMethodSymbol? Resolve(
245SymbolKeyReader reader, bool isPartialImplementationPart, IMethodSymbol method)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
359symbol = ((IMethodSymbol)symbol).GetConstructedReducedFrom()!;
364newSymbol = ((IMethodSymbol)newSymbol).GetConstructedReducedFrom()!;
384if (symbol is IMethodSymbol methodSymbol && newSymbol is IMethodSymbol newMethodSymbol)
458if (symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } methodSymbol &&
459newSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } newMethodSymbol)
780GetForEachSymbols(this.OriginalSemanticModel, forEachStatement, out var originalGetEnumerator, out var originalElementType);
781GetForEachSymbols(this.SpeculativeSemanticModel, newForEachStatement, out var newGetEnumerator, out var newElementType);
797protected abstract void GetForEachSymbols(SemanticModel model, TForEachStatementSyntax forEach, out IMethodSymbol getEnumeratorMethod, out ITypeSymbol elementType);
799private bool ReplacementBreaksForEachGetEnumerator(IMethodSymbol getEnumerator, IMethodSymbol newGetEnumerator, TExpressionSyntax newForEachStatementExpression)
876((IMethodSymbol)symbol).MethodKind == MethodKind.DelegateInvoke;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (8)
123SymbolKind.Method => MethodsAreEquivalent((IMethodSymbol)x, (IMethodSymbol)y, equivalentTypesWithDifferingAssemblies),
169private bool MethodsAreEquivalent(IMethodSymbol x, IMethodSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies, bool considerReturnRefKinds = false)
178var rx = x.ReducedFrom;
179var ry = y.ReducedFrom;
486internal bool ReturnTypesAreEquivalent(IMethodSymbol x, IMethodSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies = null)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.cs (2)
26protected abstract bool TryInitializeImplicitConversionState(SemanticDocument document, SyntaxNode expression, ISet<TypeKind> classInterfaceModuleStructTypes, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IMethodSymbol methodSymbol, out INamedTypeSymbol typeToGenerateIn);
27protected abstract bool TryInitializeExplicitConversionState(SemanticDocument document, SyntaxNode expression, ISet<TypeKind> classInterfaceModuleStructTypes, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IMethodSymbol methodSymbol, out INamedTypeSymbol typeToGenerateIn);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.State.cs (1)
83.OfType<IMethodSymbol>();
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (5)
169IMethodSymbol method => GenerateMethod(compilation, method, throughMember, modifiers, accessibility),
177Compilation compilation, IMethodSymbol method, ISymbol? throughMember,
248private IMethodSymbol? GetEventAddOrRemoveMethod(
249IEventSymbol @event, IMethodSymbol? accessor, ISymbol? throughMember,
267private bool ShouldGenerateAccessor([NotNullWhen(true)] IMethodSymbol? method)
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (9)
29bool keepVoid, IMethodSymbol methodSymbol, SyntaxNode node, KnownTaskTypes knownTypes, CancellationToken cancellationToken);
58var methodSymbol = GetMethodSymbol(semanticModel, node, cancellationToken);
87private static IMethodSymbol? GetMethodSymbol(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
91return symbol as IMethodSymbol;
116var methodSymbol = GetMethodSymbol(semanticModel, node, cancellationToken);
158IMethodSymbol methodSymbol,
177var newMethod = (IMethodSymbol)semanticModel.GetRequiredDeclaredSymbol(newNode, cancellationToken);
187IMethodSymbol methodSymbol,
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (8)
25protected abstract SyntaxNode RemoveAsyncTokenAndFixReturnType(IMethodSymbol methodSymbol, SyntaxNode node, KnownTaskTypes knownTypes);
58var methodSymbol = (IMethodSymbol?)(semanticModel.GetDeclaredSymbol(node, cancellationToken) ?? semanticModel.GetSymbolInfo(node, cancellationToken).GetAnySymbol());
73private async Task<Solution> RenameThenRemoveAsyncTokenAsync(Document document, SyntaxNode node, IMethodSymbol methodSymbol, CancellationToken cancellationToken)
89var newMethod = (IMethodSymbol)semanticModel.GetRequiredDeclaredSymbol(newNode, cancellationToken);
97Document document, IMethodSymbol methodSymbol, SyntaxNode node, CancellationToken cancellationToken)
128if (semanticModel.GetDeclaredSymbol(methodDeclaration, cancellationToken) is IMethodSymbol methodSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (7)
54public TDeclarationNode AddMethod<TDeclarationNode>(TDeclarationNode destination, IMethodSymbol method, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode
83public SyntaxNode? CreateMethodDeclaration(IMethodSymbol method, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken)
126protected abstract TDeclarationNode AddMethod<TDeclarationNode>(TDeclarationNode destination, IMethodSymbol method, TCodeGenerationContextInfo info, IList<bool>? availableIndices, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
148public abstract SyntaxNode? CreateMethodDeclaration(IMethodSymbol method, CodeGenerationDestination destination, TCodeGenerationContextInfo info, CancellationToken cancellationToken);
349IMethodSymbol method => CreateMethodDeclaration(method, codeGenerationDestination, info, cancellationToken),
367IMethodSymbol method => AddMethod(currentDestination, method, info, availableIndices, cancellationToken),
447public Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (28)
38IMethodSymbol? addMethod = null,
39IMethodSymbol? removeMethod = null,
40IMethodSymbol? raiseMethod = null)
57IMethodSymbol? getMethod,
58IMethodSymbol? setMethod,
85ImmutableArray<IParameterSymbol> parameters, IMethodSymbol? getMethod, IMethodSymbol? setMethod,
123public static IMethodSymbol CreateConstructorSymbol(
142public static IMethodSymbol CreateDestructorSymbol(
151internal static IMethodSymbol CreateMethodSymbol(
158ImmutableArray<IMethodSymbol> explicitInterfaceImplementations,
176public static IMethodSymbol CreateMethodSymbol(
180ImmutableArray<IMethodSymbol> explicitInterfaceImplementations,
195public static IMethodSymbol CreateOperatorSymbol(
223public static IMethodSymbol CreateConversionSymbol(
248public static IMethodSymbol CreateConversionSymbol(
360internal static IMethodSymbol CreateAccessorSymbol(
361IMethodSymbol accessor,
364ImmutableArray<IMethodSymbol> explicitInterfaceImplementations = default,
386public static IMethodSymbol CreateAccessorSymbol(
474var invokeMethod = CreateMethodSymbol(
514internal static IMethodSymbol CreateMethodSymbol(
515IMethodSymbol method,
519ImmutableArray<IMethodSymbol> explicitInterfaceImplementations = default,
553IMethodSymbol? getMethod = null,
554IMethodSymbol? setMethod = null)
577IMethodSymbol? addMethod = null,
578IMethodSymbol? removeMethod = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (12)
31IMethodSymbol method,
44IMethodSymbol method,
59IMethodSymbol method,
74IMethodSymbol method, CodeGenerationDestination destination,
92IMethodSymbol method,
111IMethodSymbol method, CodeGenerationDestination destination,
140IMethodSymbol method, CodeGenerationDestination destination,
195IMethodSymbol method, CSharpCodeGenerationContextInfo info, bool isExplicit)
209IMethodSymbol method)
216private static SyntaxList<TypeParameterConstraintClauseSyntax> GenerateDefaultConstraints(IMethodSymbol method)
249IMethodSymbol method, CSharpCodeGenerationContextInfo info)
255IMethodSymbol method, CodeGenerationDestination destination, CSharpCodeGenerationContextInfo info)
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_DelegateAndFunctionPointerInvoke.cs (5)
18private static IMethodSymbol? GetDelegateInvokeMethod(
22var invokeMethod = delegateType.DelegateInvokeMethod;
39private static IList<SignatureHelpItem> GetDelegateOrFunctionPointerInvokeItems(InvocationExpressionSyntax invocationExpression, IMethodSymbol invokeMethod, SemanticModel semanticModel, IStructuralTypeDisplayService structuralTypeDisplayService, IDocumentationCommentFormattingService documentationCommentFormattingService, out int? selectedItem, CancellationToken cancellationToken)
58private static IList<SymbolDisplayPart> GetDelegateOrFunctionPointerInvokePreambleParts(IMethodSymbol invokeMethod, SemanticModel semanticModel, int position)
80IMethodSymbol invokeMethod, SemanticModel semanticModel, int position, IDocumentationCommentFormattingService formattingService, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (12)
31IMethodSymbol method,
44IMethodSymbol method,
59IMethodSymbol method,
74IMethodSymbol method, CodeGenerationDestination destination,
92IMethodSymbol method,
111IMethodSymbol method, CodeGenerationDestination destination,
140IMethodSymbol method, CodeGenerationDestination destination,
195IMethodSymbol method, CSharpCodeGenerationContextInfo info, bool isExplicit)
209IMethodSymbol method)
216private static SyntaxList<TypeParameterConstraintClauseSyntax> GenerateDefaultConstraints(IMethodSymbol method)
249IMethodSymbol method, CSharpCodeGenerationContextInfo info)
255IMethodSymbol method, CodeGenerationDestination destination, CSharpCodeGenerationContextInfo info)
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.cs (5)
143Compilation compilation, ImmutableArray<IMethodSymbol> extentsionMethodSymbols, ImmutableArray<ITypeSymbol> targetTypeSymbols, CancellationToken cancellationToken)
147using var _2 = PooledDictionary<(string containingNamespace, string methodName, bool isGeneric), (IMethodSymbol bestSymbol, int overloadCount, bool includeInTargetTypedCompletion)>
151foreach (var symbol in extentsionMethodSymbols)
155IMethodSymbol bestSymbol;
212Compilation compilation, IMethodSymbol methodSymbol, ImmutableArray<ITypeSymbol> targetTypeSymbols,
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (15)
86public async Task<(ImmutableArray<IMethodSymbol> symbols, bool isPartialResult)> GetExtensionMethodSymbolsAsync(bool forceCacheCreation, bool hideAdvancedMembers, CancellationToken cancellationToken)
91var peReferenceMethodSymbolsTask = ProducerConsumer<IMethodSymbol?>.RunParallelAsync(
98var projectMethodSymbolsTask = ProducerConsumer<IMethodSymbol?>.RunParallelAsync(
109using var _ = ArrayBuilder<IMethodSymbol>.GetInstance(results[0].Length + results[1].Length, out var symbols);
155Action<IMethodSymbol?> callback,
200Action<IMethodSymbol?> callback,
242MultiDictionary<ITypeSymbol, IMethodSymbol> matchingMethodSymbols,
243Action<IMethodSymbol?> callback,
309MultiDictionary<ITypeSymbol, IMethodSymbol> matchingMethodSymbols,
310Action<IMethodSymbol?> callback,
345private MultiDictionary<ITypeSymbol, IMethodSymbol> GetPotentialMatchingSymbolsFromAssembly(
351var builder = new MultiDictionary<ITypeSymbol, IMethodSymbol>();
382var methodSymbols = containerSymbol.GetMembers(methodName).OfType<IMethodSymbol>();
384foreach (var methodSymbol in methodSymbols)
397static bool MatchExtensionMethod(IMethodSymbol method, string filterReceiverTypeName, bool internalsVisible, out ITypeSymbol? receiverType)
GenerateEqualsAndGetHashCodeFromMembers\IGenerateEqualsAndGetHashCodeService.cs (4)
29Task<IMethodSymbol> GenerateEqualsMethodAsync(Document document, INamedTypeSymbol namedType, ImmutableArray<ISymbol> members, string? localNameOpt, CancellationToken cancellationToken);
35Task<IMethodSymbol> GenerateEqualsMethodThroughIEquatableEqualsAsync(Document document, INamedTypeSymbol namedType, 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);
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (10)
54IMethodSymbol methodSymbol,
87IMethodSymbol methodSymbol,
162document = await AddStringCheckAsync(document, parameter, functionDeclaration, (IMethodSymbol)parameter.ContainingSymbol, blockStatementOpt, nameof(string.IsNullOrEmpty), lazySimplifierOptions, cancellationToken).ConfigureAwait(false);
168(IMethodSymbol)parameter.ContainingSymbol, blockStatementOpt, lazySimplifierOptions, cancellationToken).ConfigureAwait(false);
300var targetMethod = invocation.TargetMethod;
315IMethodSymbol method,
338IMethodSymbol method,
354IMethodSymbol method,
414var methodSymbol = (IMethodSymbol)parameter.ContainingSymbol;
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (5)
47protected abstract bool IsDestructor(IMethodSymbol methodSymbol);
75if (containingSymbol is not IMethodSymbol methodSymbol)
141TExpressionSyntax expression, IMethodSymbol methodSymbol, SyntaxNode containingMethod,
238IMethodSymbol methodSymbol, SyntaxNode containingMethod, Dictionary<Document, List<TExpressionSyntax>> methodCallSites, bool allOccurrences, IntroduceParameterCodeActionKind selectedCodeAction,
271Document document, IMethodSymbol methodSymbol, CancellationToken cancellationToken)
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (20)
54if (semanticModel.GetDeclaredSymbol(methodDeclaration) is not IMethodSymbol methodSymbol ||
96private static IMethodSymbol? FindSetMethod(IMethodSymbol getMethod)
101.OfType<IMethodSymbol>()
109private static bool IsValidGetMethod(IMethodSymbol getMethod)
121private static bool OverridesMethodFromSystemObject(IMethodSymbol method)
123for (var current = method; current != null; current = current.OverriddenMethod)
134private static bool IsValidSetMethod(IMethodSymbol setMethod, IMethodSymbol getMethod)
142private static bool IsValidSetMethod(IMethodSymbol setMethod)
155IMethodSymbol getMethod,
156IMethodSymbol? setMethod,
344MultiDictionary<DocumentId, IMethodSymbol>.ValueSet originalGetDefinitions,
345MultiDictionary<DocumentId, IMethodSymbol>.ValueSet originalSetDefinitions,
401MultiDictionary<DocumentId, IMethodSymbol>.ValueSet originalDefinitions,
433private static async Task<SyntaxNode?> GetMethodDeclarationAsync(IMethodSymbol? method, CancellationToken cancellationToken)
445private static async Task<MultiDictionary<DocumentId, IMethodSymbol>> GetDefinitionsByDocumentIdAsync(
450var result = new MultiDictionary<DocumentId, IMethodSymbol>();
455var definition = referencedSymbol.Definition as IMethodSymbol;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.cs (2)
26protected abstract bool TryInitializeImplicitConversionState(SemanticDocument document, SyntaxNode expression, ISet<TypeKind> classInterfaceModuleStructTypes, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IMethodSymbol methodSymbol, out INamedTypeSymbol typeToGenerateIn);
27protected abstract bool TryInitializeExplicitConversionState(SemanticDocument document, SyntaxNode expression, ISet<TypeKind> classInterfaceModuleStructTypes, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IMethodSymbol methodSymbol, out INamedTypeSymbol typeToGenerateIn);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.State.cs (1)
83.OfType<IMethodSymbol>();
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (5)
169IMethodSymbol method => GenerateMethod(compilation, method, throughMember, modifiers, accessibility),
177Compilation compilation, IMethodSymbol method, ISymbol? throughMember,
248private IMethodSymbol? GetEventAddOrRemoveMethod(
249IEventSymbol @event, IMethodSymbol? accessor, ISymbol? throughMember,
267private bool ShouldGenerateAccessor([NotNullWhen(true)] IMethodSymbol? method)
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (9)
29bool keepVoid, IMethodSymbol methodSymbol, SyntaxNode node, KnownTaskTypes knownTypes, CancellationToken cancellationToken);
58var methodSymbol = GetMethodSymbol(semanticModel, node, cancellationToken);
87private static IMethodSymbol? GetMethodSymbol(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
91return symbol as IMethodSymbol;
116var methodSymbol = GetMethodSymbol(semanticModel, node, cancellationToken);
158IMethodSymbol methodSymbol,
177var newMethod = (IMethodSymbol)semanticModel.GetRequiredDeclaredSymbol(newNode, cancellationToken);
187IMethodSymbol methodSymbol,
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (8)
25protected abstract SyntaxNode RemoveAsyncTokenAndFixReturnType(IMethodSymbol methodSymbol, SyntaxNode node, KnownTaskTypes knownTypes);
58var methodSymbol = (IMethodSymbol?)(semanticModel.GetDeclaredSymbol(node, cancellationToken) ?? semanticModel.GetSymbolInfo(node, cancellationToken).GetAnySymbol());
73private async Task<Solution> RenameThenRemoveAsyncTokenAsync(Document document, SyntaxNode node, IMethodSymbol methodSymbol, CancellationToken cancellationToken)
89var newMethod = (IMethodSymbol)semanticModel.GetRequiredDeclaredSymbol(newNode, cancellationToken);
97Document document, IMethodSymbol methodSymbol, SyntaxNode node, CancellationToken cancellationToken)
128if (semanticModel.GetDeclaredSymbol(methodDeclaration, cancellationToken) is IMethodSymbol methodSymbol)
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (6)
55Protected Overrides Function TryInitializeExplicitConversionState(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef identifierToken As SyntaxToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean
69Protected Overrides Function TryInitializeImplicitConversionState(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef identifierToken As SyntaxToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean
83Private Shared Function TryGetConversionMethodAndTypeToGenerateIn(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean
113Private Shared Function TryGetExplicitConversionMethodAndTypeToGenerateIn(document As SemanticDocument, castExpression As CastExpressionSyntax, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean
129Private Shared Function TryGetImplicitConversionMethodAndTypeToGenerateIn(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean
145Private Shared Function GenerateMethodSymbol(typeToGenerateIn As INamedTypeSymbol, parameterSymbol As INamedTypeSymbol) As IMethodSymbol
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (11)
16internal sealed class ConstructorSymbolReferenceFinder : AbstractReferenceFinder<IMethodSymbol>
24protected override bool CanFind(IMethodSymbol symbol)
27protected override Task<ImmutableArray<string>> DetermineGlobalAliasesAsync(IMethodSymbol symbol, Project project, CancellationToken cancellationToken)
34IMethodSymbol symbol,
93IMethodSymbol methodSymbol,
126IMethodSymbol methodSymbol, FindReferencesDocumentState state, Action<FinderLocation, TData> processResult, TData processResultData, string name, string alias, CancellationToken cancellationToken)
143IMethodSymbol symbol,
157IMethodSymbol symbol,
169IMethodSymbol symbol,
189IMethodSymbol symbol,
201IMethodSymbol symbol,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (12)
36private readonly Func<IMethodSymbol, ControlFlowGraph, AnalysisData, CancellationToken, BasicBlockAnalysisData> _analyzeLocalFunctionOrLambdaInvocation;
55private readonly PooledDictionary<IMethodSymbol, ControlFlowGraph> _localFunctionTargetsToAccessingCfgMap;
79PooledHashSet<IMethodSymbol> lambdaOrLocalFunctionsBeingAnalyzed,
80Func<IMethodSymbol, ControlFlowGraph, AnalysisData, CancellationToken, BasicBlockAnalysisData> analyzeLocalFunctionOrLambdaInvocation,
82PooledDictionary<IMethodSymbol, ControlFlowGraph> localFunctionTargetsToAccessingCfgMap,
112protected override PooledHashSet<IMethodSymbol> LambdaOrLocalFunctionsBeingAnalyzed { get; }
119Func<IMethodSymbol, ControlFlowGraph, AnalysisData, CancellationToken, BasicBlockAnalysisData> analyzeLocalFunctionOrLambdaInvocation)
132lambdaOrLocalFunctionsBeingAnalyzed: PooledHashSet<IMethodSymbol>.GetInstance(),
135localFunctionTargetsToAccessingCfgMap: PooledDictionary<IMethodSymbol, ControlFlowGraph>.GetInstance(),
141IMethodSymbol lambdaOrLocalFunction,
321ControlFlowGraph TryGetLocalFunctionControlFlowGraphInScope(IMethodSymbol localFunction)
486protected override BasicBlockAnalysisData AnalyzeLocalFunctionInvocationCore(IMethodSymbol localFunction, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (19)
12private sealed class ReducedExtensionMethodSymbolKey : AbstractSymbolKey<IMethodSymbol>
16public sealed override void Create(IMethodSymbol symbol, SymbolKeyWriter visitor)
25SymbolKeyReader reader, IMethodSymbol? contextualMethod, out string? failureReason)
42using var result = PooledArrayBuilder<IMethodSymbol>.GetInstance();
43foreach (var reducedFrom in reducedFromResolution.OfType<IMethodSymbol>())
56private sealed class ConstructedMethodSymbolKey : AbstractSymbolKey<IMethodSymbol>
60public sealed override void Create(IMethodSymbol symbol, SymbolKeyWriter visitor)
67SymbolKeyReader reader, IMethodSymbol? contextualMethod, out string? failureReason)
71using var typeArguments = reader.ReadSymbolKeyArray<IMethodSymbol, ITypeSymbol>(
102using var result = PooledArrayBuilder<IMethodSymbol>.GetInstance();
103foreach (var method in constructedFrom.OfType<IMethodSymbol>())
124private sealed class MethodSymbolKey : AbstractSymbolKey<IMethodSymbol>
128public sealed override void Create(IMethodSymbol symbol, SymbolKeyWriter visitor)
161SymbolKeyReader reader, IMethodSymbol? contextualSymbol, out string? failureReason)
180using var methods = GetMembersOfNamedType<IMethodSymbol>(containingType, metadataName: null);
181IMethodSymbol? method = null;
224_ = reader.ReadSymbolKeyArray<IMethodSymbol, ITypeSymbol>(
244private static IMethodSymbol? Resolve(
245SymbolKeyReader reader, bool isPartialImplementationPart, IMethodSymbol method)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
359symbol = ((IMethodSymbol)symbol).GetConstructedReducedFrom()!;
364newSymbol = ((IMethodSymbol)newSymbol).GetConstructedReducedFrom()!;
384if (symbol is IMethodSymbol methodSymbol && newSymbol is IMethodSymbol newMethodSymbol)
458if (symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } methodSymbol &&
459newSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } newMethodSymbol)
780GetForEachSymbols(this.OriginalSemanticModel, forEachStatement, out var originalGetEnumerator, out var originalElementType);
781GetForEachSymbols(this.SpeculativeSemanticModel, newForEachStatement, out var newGetEnumerator, out var newElementType);
797protected abstract void GetForEachSymbols(SemanticModel model, TForEachStatementSyntax forEach, out IMethodSymbol getEnumeratorMethod, out ITypeSymbol elementType);
799private bool ReplacementBreaksForEachGetEnumerator(IMethodSymbol getEnumerator, IMethodSymbol newGetEnumerator, TExpressionSyntax newForEachStatementExpression)
876((IMethodSymbol)symbol).MethodKind == MethodKind.DelegateInvoke;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (8)
123SymbolKind.Method => MethodsAreEquivalent((IMethodSymbol)x, (IMethodSymbol)y, equivalentTypesWithDifferingAssemblies),
169private bool MethodsAreEquivalent(IMethodSymbol x, IMethodSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies, bool considerReturnRefKinds = false)
178var rx = x.ReducedFrom;
179var ry = y.ReducedFrom;
486internal bool ReturnTypesAreEquivalent(IMethodSymbol x, IMethodSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (7)
54public TDeclarationNode AddMethod<TDeclarationNode>(TDeclarationNode destination, IMethodSymbol method, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode
83public SyntaxNode? CreateMethodDeclaration(IMethodSymbol method, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken)
126protected abstract TDeclarationNode AddMethod<TDeclarationNode>(TDeclarationNode destination, IMethodSymbol method, TCodeGenerationContextInfo info, IList<bool>? availableIndices, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
148public abstract SyntaxNode? CreateMethodDeclaration(IMethodSymbol method, CodeGenerationDestination destination, TCodeGenerationContextInfo info, CancellationToken cancellationToken);
349IMethodSymbol method => CreateMethodDeclaration(method, codeGenerationDestination, info, cancellationToken),
367IMethodSymbol method => AddMethod(currentDestination, method, info, availableIndices, cancellationToken),
447public Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (28)
38IMethodSymbol? addMethod = null,
39IMethodSymbol? removeMethod = null,
40IMethodSymbol? raiseMethod = null)
57IMethodSymbol? getMethod,
58IMethodSymbol? setMethod,
85ImmutableArray<IParameterSymbol> parameters, IMethodSymbol? getMethod, IMethodSymbol? setMethod,
123public static IMethodSymbol CreateConstructorSymbol(
142public static IMethodSymbol CreateDestructorSymbol(
151internal static IMethodSymbol CreateMethodSymbol(
158ImmutableArray<IMethodSymbol> explicitInterfaceImplementations,
176public static IMethodSymbol CreateMethodSymbol(
180ImmutableArray<IMethodSymbol> explicitInterfaceImplementations,
195public static IMethodSymbol CreateOperatorSymbol(
223public static IMethodSymbol CreateConversionSymbol(
248public static IMethodSymbol CreateConversionSymbol(
360internal static IMethodSymbol CreateAccessorSymbol(
361IMethodSymbol accessor,
364ImmutableArray<IMethodSymbol> explicitInterfaceImplementations = default,
386public static IMethodSymbol CreateAccessorSymbol(
474var invokeMethod = CreateMethodSymbol(
514internal static IMethodSymbol CreateMethodSymbol(
515IMethodSymbol method,
519ImmutableArray<IMethodSymbol> explicitInterfaceImplementations = default,
553IMethodSymbol? getMethod = null,
554IMethodSymbol? setMethod = null)
577IMethodSymbol? addMethod = null,
578IMethodSymbol? removeMethod = null)