8 implementations of AssociatedSymbol
GenerateDocumentationAndConfigFiles (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
96public virtual ISymbol AssociatedSymbol => null;
Microsoft.CodeAnalysis.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
96public virtual ISymbol AssociatedSymbol => null;
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
96public virtual ISymbol AssociatedSymbol => null;
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\MethodSymbol.cs (1)
232ISymbol IMethodSymbol.AssociatedSymbol
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedMethodSymbol.cs (1)
21public ISymbol AssociatedSymbol => _symbol.AssociatedSymbol;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\MethodSymbol.vb (1)
1132Private ReadOnly Property IMethodSymbol_AssociatedSymbol As ISymbol Implements IMethodSymbol.AssociatedSymbol
Microsoft.CodeAnalysis.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
96public virtual ISymbol AssociatedSymbol => null;
Roslyn.Diagnostics.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
96public virtual ISymbol AssociatedSymbol => null;
127 references to AssociatedSymbol
GenerateDocumentationAndConfigFiles (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
379if (method.AssociatedSymbol != null) 381symbol = method.AssociatedSymbol;
ILLink.RoslynAnalyzer (9)
DynamicallyAccessedMembersAnalyzer.cs (1)
327|| methodSymbol.AssociatedSymbol is not IPropertySymbol propertySymbol
ISymbolExtensions.cs (1)
111methodSymbol.AssociatedSymbol is ISymbol associatedSymbol ? GetDynamicallyAccessedMemberTypes(associatedSymbol) : DynamicallyAccessedMemberTypes.None;
RequiresAssemblyFilesAnalyzer.cs (1)
120else if (method.AssociatedSymbol is ISymbol associatedSymbol &&
RequiresISymbolExtensions.cs (2)
21if (member is IMethodSymbol { AssociatedSymbol: { } associated } && associated.TryGetAttribute(requiresAttribute, out requiresAttributeData)) 87if (member is IMethodSymbol { AssociatedSymbol: { } associated } && associated.TryGetAttribute(attributeName, out requiresAttribute))
TrimAnalysis\FlowAnnotations.cs (2)
187var property = (IPropertySymbol)parameterMethod.AssociatedSymbol!; 210var property = (IPropertySymbol)method.AssociatedSymbol!;
TrimAnalysis\HandleCallAction.cs (1)
352var property = (IPropertySymbol)method.Method.AssociatedSymbol!;
TrimAnalysis\TrimAnalysisVisitor.cs (1)
438IPropertySymbol propertySymbol = (IPropertySymbol)method.AssociatedSymbol!;
Microsoft.CodeAnalysis.Analyzers (3)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
59members = members.Where(m => m.Kind != SymbolKind.Method || ((IMethodSymbol)m).AssociatedSymbol == null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
379if (method.AssociatedSymbol != null) 381symbol = method.AssociatedSymbol;
Microsoft.CodeAnalysis.AnalyzerUtilities (3)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
59members = members.Where(m => m.Kind != SymbolKind.Method || ((IMethodSymbol)m).AssociatedSymbol == null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
379if (method.AssociatedSymbol != null) 381symbol = method.AssociatedSymbol;
Microsoft.CodeAnalysis.CodeStyle (5)
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (3)
562OnSymbolUsage(extensionBlockMethod?.AssociatedSymbol, ValueUsageInfo.Read); 814AddIfCandidateSymbol(builder, extensionBlockMethod?.AssociatedSymbol); 983if (methodSymbol.AssociatedSymbol != null)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
379if (method.AssociatedSymbol != null) 381symbol = method.AssociatedSymbol;
Microsoft.CodeAnalysis.CSharp (2)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (2)
442var associatedProperty = (IPropertySymbol?)symbol.AssociatedSymbol; 457var associatedEvent = (IEventSymbol?)symbol.AssociatedSymbol;
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\roslyn\src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (2)
107if (method is { IsInitOnly: true, AssociatedSymbol: IPropertySymbol owningProperty }) 184if (owningMethod is { IsInitOnly: true, AssociatedSymbol: IPropertySymbol { DeclaringSyntaxReferences: [var reference, ..] } } &&
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (4)
127if (method.AssociatedSymbol is IEventSymbol) 133if (method.AssociatedSymbol is IPropertySymbol property) 677if (method.AssociatedSymbol is IEventSymbol) 683if (method.AssociatedSymbol is IPropertySymbol property)
Microsoft.CodeAnalysis.CSharp.Features (5)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (3)
176=> member is IMethodSymbol { AssociatedSymbol: IPropertySymbol property } && property.IsSynthesizedAutoProperty(); 1979MethodKind.PropertyGet => symbol.AssociatedSymbol is IPropertySymbol { IsIndexer: true } ? CSharpFeaturesResources.indexer_getter : CSharpFeaturesResources.property_getter, 1980MethodKind.PropertySet => symbol.AssociatedSymbol is IPropertySymbol { IsIndexer: true } ? CSharpFeaturesResources.indexer_setter : CSharpFeaturesResources.property_setter,
src\roslyn\src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (2)
107if (method is { IsInitOnly: true, AssociatedSymbol: IPropertySymbol owningProperty }) 184if (owningMethod is { IsInitOnly: true, AssociatedSymbol: IPropertySymbol { DeclaringSyntaxReferences: [var reference, ..] } } &&
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\InteropServices\CSharpDynamicInterfaceCastableImplementation.Fixer.cs (1)
68if (method.AssociatedSymbol is not null)
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (4)
127if (method.AssociatedSymbol is IEventSymbol) 133if (method.AssociatedSymbol is IPropertySymbol property) 677if (method.AssociatedSymbol is IEventSymbol) 683if (method.AssociatedSymbol is IPropertySymbol property)
Microsoft.CodeAnalysis.Extensions.Package (2)
Symbols\ISymbolExtensions.cs (2)
379if (method.AssociatedSymbol != null) 381symbol = method.AssociatedSymbol;
Microsoft.CodeAnalysis.Features (20)
CodeLens\CodeLensFindReferenceProgress.cs (1)
70(definition as IMethodSymbol)?.AssociatedSymbol != null;
CodeLens\CodeLensReferencesService.cs (1)
344return method.AssociatedSymbol;
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (13)
4348if (oldMethod.AssociatedSymbol != null && newMethod.AssociatedSymbol != null) 4428if (oldSymbol is not IMethodSymbol { AssociatedSymbol: not null }) 4465if (oldMethod is { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet, AssociatedSymbol: IPropertySymbol oldProperty } && !oldProperty.IsAutoProperty() && 4466newMethod is { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet, AssociatedSymbol: IPropertySymbol newProperty } && newProperty.IsAutoProperty() && 4531oldMethod.AssociatedSymbol == null && 4532newMethod.AssociatedSymbol == null && 4619if (oldSymbol is not IMethodSymbol { AssociatedSymbol: not null }) 4712oldMember is not IMethodSymbol { AssociatedSymbol.Kind: SymbolKind.Property or SymbolKind.Event }) 6406IMethodSymbol method => method.AssociatedSymbol, 6463if (parameter is { IsImplicitlyDeclared: true, ContainingSymbol: IMethodSymbol { AssociatedSymbol: { } associatedSymbol } }) 7150if (newSymbol is IMethodSymbol { AssociatedSymbol: IPropertySymbol { } newProperty }) 7152var oldProperty = ((IMethodSymbol)oldSymbol).AssociatedSymbol;
MetadataAsSource\AbstractMetadataAsSourceService.WrappedMethodSymbol.cs (1)
21public ISymbol AssociatedSymbol => _symbol.AssociatedSymbol;
Shared\Extensions\ISymbolExtensions_2.cs (1)
260return method.AssociatedSymbol?.GetDocumentationComment(compilation, expandIncludes: true, expandInheritdoc: true, cancellationToken: cancellationToken) ?? DocumentationComment.Empty;
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (3)
562OnSymbolUsage(extensionBlockMethod?.AssociatedSymbol, ValueUsageInfo.Read); 814AddIfCandidateSymbol(builder, extensionBlockMethod?.AssociatedSymbol); 983if (methodSymbol.AssociatedSymbol != null)
Microsoft.CodeAnalysis.NetAnalyzers (28)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\DoNotExposeGenericLists.cs (1)
93if (methodSymbol.AssociatedSymbol != null)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\InterfaceMethodsShouldBeCallableByChildTypes.Fixer.cs (4)
62symbolToChange = candidateToIncreaseVisibility.AssociatedSymbol; 63if (methodSymbol.AssociatedSymbol?.Kind == SymbolKind.Property) 65var originalProperty = (IPropertySymbol)methodSymbol.AssociatedSymbol; 86ISymbol? symbolToChange = methodSymbol.IsAccessorMethod() ? methodSymbol.AssociatedSymbol : methodSymbol;
Microsoft.CodeQuality.Analyzers\QualityGuidelines\AvoidInfiniteRecursion.cs (1)
63!operationTarget.Member.Equals(methodSymbol.AssociatedSymbol))
Microsoft.CodeQuality.Analyzers\QualityGuidelines\MarkMembersAsStatic.cs (7)
148propertyOrEventCandidates.Add(methodSymbol.AssociatedSymbol!, context.CancellationToken); 228if (methodSymbol.IsConstructor() || methodSymbol.IsFinalizer() || methodSymbol.AssociatedSymbol.IsIndexer()) 273if (methodSymbol.AssociatedSymbol is IPropertySymbol property 281if (methodSymbol.AssociatedSymbol != null) 284attributes = attributes.AddRange(methodSymbol.AssociatedSymbol.GetAttributes()); 385symbol = symbol is IMethodSymbol method && method.AssociatedSymbol != null 386? method.AssociatedSymbol :
Microsoft.CodeQuality.Analyzers\QualityGuidelines\PreferJaggedArraysOverMultidimensional.cs (1)
105if (method.IsOverride || method.AssociatedSymbol != null)
Microsoft.NetCore.Analyzers\InteropServices\DynamicInterfaceCastableImplementation.cs (1)
135if (member is not IMethodSymbol { AssociatedSymbol: IPropertySymbol or IEventSymbol })
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.cs (1)
1415containingSymbol = method.AssociatedSymbol!;
Microsoft.NetCore.Analyzers\Performance\UseConcreteTypeAnalyzer.Collector.cs (1)
401if (methodSym.AssociatedSymbol is IPropertySymbol propertySym)
Microsoft.NetCore.Analyzers\Performance\UseCountProperly.cs (1)
768methodSymbol.AssociatedSymbol == isEmptyPropertySymbol &&
Microsoft.NetCore.Analyzers\Runtime\DetectPreviewFeatureAnalyzer.cs (4)
583SyntaxNode? returnTypeNode = GetPreviewReturnTypeSyntaxNodeForMethodOrProperty(method.IsPropertyGetter() ? method.AssociatedSymbol! : method, methodReturnType); 599SyntaxNode? returnTypeNode = GetPreviewReturnTypeSyntaxNodeForMethodOrProperty(method.IsPropertyGetter() ? method.AssociatedSymbol! : method, innerPreviewSymbol); 677(symbol is IMethodSymbol method && method.AssociatedSymbol != null && SymbolIsAnnotatedAsPreview(method.AssociatedSymbol, requiresPreviewFeaturesSymbols, previewFeatureAttributeSymbol)))
Microsoft.NetCore.Analyzers\Runtime\DoNotPassLiteralsAsLocalizedParameters.cs (1)
309ISymbol containingSymbol = symbol is IMethodSymbol { AssociatedSymbol: IPropertySymbol propertySymbol } ? propertySymbol : symbol.ContainingSymbol;
Microsoft.NetCore.Analyzers\Runtime\InstantiateArgumentExceptionsCorrectly.cs (1)
290((IMethodSymbol)targetSymbol).AssociatedSymbol?.Name == stringArgument;
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
60members = members.Where(m => m.Kind != SymbolKind.Method || ((IMethodSymbol)m).AssociatedSymbol == null);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (3)
426method.AssociatedSymbol?.GetParameters().Length == 0; 435method.AssociatedSymbol.IsIndexer(); 746&& methodSymbol.AssociatedSymbol is IPropertySymbol propertySymbol
Microsoft.CodeAnalysis.ResxSourceGenerator (3)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
59members = members.Where(m => m.Kind != SymbolKind.Method || ((IMethodSymbol)m).AssociatedSymbol == null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
379if (method.AssociatedSymbol != null) 381symbol = method.AssociatedSymbol;
Microsoft.CodeAnalysis.VisualBasic (2)
SymbolDisplay\SymbolDisplayVisitor.Members.vb (1)
328Dim associatedPropertyOrEvent = symbol.AssociatedSymbol
Symbols\MethodSymbol.vb (1)
1132Private ReadOnly Property IMethodSymbol_AssociatedSymbol As ISymbol Implements IMethodSymbol.AssociatedSymbol
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
142If method.AssociatedSymbol IsNot Nothing Then 532If method.AssociatedSymbol IsNot Nothing Then
Microsoft.CodeAnalysis.VisualBasic.Features (1)
CodeLens\VisualBasicDisplayInfoService.vb (1)
100Dim propertySymbol = TryCast(methodSymbol.AssociatedSymbol, IPropertySymbol)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
142If method.AssociatedSymbol IsNot Nothing Then 532If method.AssociatedSymbol IsNot Nothing Then
Microsoft.CodeAnalysis.Workspaces (13)
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (1)
190if (containingMethod.AssociatedSymbol is IPropertySymbol property)
FindSymbols\FindReferences\Finders\PropertyAccessorSymbolReferenceFinder.cs (3)
31result.AddIfNotNull(symbol.AssociatedSymbol); 54if (symbol.AssociatedSymbol is IPropertySymbol property && 81if (symbol.AssociatedSymbol is not IPropertySymbol property ||
FindSymbols\ReferenceLocationExtensions.cs (1)
96return method.AssociatedSymbol;
FindSymbols\SymbolFinder_Hierarchy.cs (1)
159? ((IMethodSymbol)symbol).AssociatedSymbol?.Name
ReassignedVariable\AbstractReassignedVariableService.cs (1)
185methodOrProperty = method.AssociatedSymbol as IPropertySymbol;
Rename\RenameUtilities.cs (2)
252return ((IMethodSymbol)symbol).AssociatedSymbol; 383if (symbol is IParameterSymbol { ContainingSymbol: IMethodSymbol { AssociatedSymbol: IPropertySymbol associatedParameterProperty } containingMethod })
Shared\Extensions\SemanticModelExtensions.cs (2)
38if (method.AssociatedSymbol != null) 40return method.AssociatedSymbol;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
379if (method.AssociatedSymbol != null) 381symbol = method.AssociatedSymbol;
Microsoft.Interop.ComInterfaceGenerator (2)
ComInterfaceGenerator.cs (1)
349private static StubMemberKind ClassifyMemberKind(IMethodSymbol symbol) => (symbol.MethodKind, symbol.AssociatedSymbol) switch
ComMethodInfo.cs (1)
368if (accessor.AssociatedSymbol is not IPropertySymbol property)
Microsoft.Interop.SourceGeneration (3)
DefaultMarshallingInfoParser.cs (1)
62IElementInfoProvider elementInfoProvider = method.AssociatedSymbol is IPropertySymbol
MethodSignatureElementInfoProvider.cs (1)
19Debug.Assert(method.AssociatedSymbol is not IPropertySymbol,
SignatureContext.cs (1)
115ImmutableArray<AttributeData> associatedPropertyAttributes = method.AssociatedSymbol is IPropertySymbol property
Roslyn.Diagnostics.Analyzers (3)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
59members = members.Where(m => m.Kind != SymbolKind.Method || ((IMethodSymbol)m).AssociatedSymbol == null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
379if (method.AssociatedSymbol != null) 381symbol = method.AssociatedSymbol;
Roslyn.Diagnostics.CSharp.Analyzers (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (4)
127if (method.AssociatedSymbol is IEventSymbol) 133if (method.AssociatedSymbol is IPropertySymbol property) 677if (method.AssociatedSymbol is IEventSymbol) 683if (method.AssociatedSymbol is IPropertySymbol property)
Roslyn.Diagnostics.VisualBasic.Analyzers (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
142If method.AssociatedSymbol IsNot Nothing Then 532If method.AssociatedSymbol IsNot Nothing Then