3 types derived from AttributeData
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Attributes\AttributeData.cs (1)
25internal abstract partial class CSharpAttributeData : AttributeData
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Attributes\AttributeData.vb (1)
23Inherits AttributeData
Mvc.Api.Analyzers.Test (1)
DeclaredApiResponseMetadataTest.cs (1)
153private class TestAttributeData : AttributeData
664 references to AttributeData
ConfigurationSchemaGenerator (3)
ConfigSchemaEmitter.cs (1)
419foreach (var attribute in attributes)
ConfigSchemaGenerator.cs (1)
60foreach (var attribute in assembly.GetAttributes())
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (1)
674AttributeData? attributeData = property.GetAttributes().FirstOrDefault(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, _typeSymbols.ConfigurationKeyNameAttribute));
ILLink.RoslynAnalyzer (47)
COMAnalyzer.cs (2)
62 if (symbol.TryGetAttribute (MarshalAsAttribute, out var marshalAsAttribute) && 115 } else if (typeSymbol.TryGetAttribute (StructLayoutAttribute, out var structLayoutAttribute) &&
DataFlow\LocalDataFlowVisitor.cs (2)
732 if (calledMethod.TryGetAttribute (nameof (DoesNotReturnAttribute), out var doesNotReturnAttributeData)) { 755 if (!parameter.TryGetAttribute (nameof (DoesNotReturnIfAttribute), out var attributeData))
DynamicallyAccessedMembersAnalyzer.cs (6)
190 || (overrideMethod.TryGetReturnAttribute (DynamicallyAccessedMembersAnalyzer.DynamicallyAccessedMembersAttribute, out var _) 191 && baseMethod.TryGetReturnAttribute (DynamicallyAccessedMembersAnalyzer.DynamicallyAccessedMembersAttribute, out var _)) 212 || (overrideParam.ParameterSymbol!.TryGetAttribute (DynamicallyAccessedMembersAnalyzer.DynamicallyAccessedMembersAttribute, out var _) 213 && baseParam.ParameterSymbol!.TryGetAttribute (DynamicallyAccessedMembersAnalyzer.DynamicallyAccessedMembersAttribute, out var _)) 236 || (overrideMethod.TypeParameters[i].TryGetAttribute (DynamicallyAccessedMembersAnalyzer.DynamicallyAccessedMembersAttribute, out var _) 237 && baseMethod.TypeParameters[i].TryGetAttribute (DynamicallyAccessedMembersAnalyzer.DynamicallyAccessedMembersAttribute, out var _))
ISymbolExtensions.cs (11)
22 foreach (var attr in symbol.GetAttributes ()) 29 internal static bool TryGetAttribute (this ISymbol member, string attributeName, [NotNullWhen (returnValue: true)] out AttributeData? attribute) 32 foreach (var attr in member.GetAttributes ()) { 42 internal static IEnumerable<AttributeData> GetAttributes (this ISymbol member, string attributeName) 44 foreach (var attr in member.GetAttributes ()) { 58 if (!TryGetAttribute (symbol, DynamicallyAccessedMembersAnalyzer.DynamicallyAccessedMembersAttribute, out var dynamicallyAccessedMembers)) 66 AttributeData? dynamicallyAccessedMembers = null; 67 foreach (var returnTypeAttribute in methodSymbol.GetReturnTypeAttributes ()) 83 foreach (var featureGuardAttribute in propertySymbol.GetAttributes (DynamicallyAccessedMembersAnalyzer.FullyQualifiedFeatureGuardAttribute)) { 90 internal static bool TryGetReturnAttribute (this IMethodSymbol member, string attributeName, [NotNullWhen (returnValue: true)] out AttributeData? attribute) 93 foreach (var attr in member.GetReturnTypeAttributes ()) {
RequiresAnalyzerBase.cs (6)
98 if (instanceCtor.DoesMemberRequire (RequiresAttributeName, out var requiresAttribute) && 167 if (!member.DoesMemberRequire (RequiresAttributeName, out var requiresAttribute)) 226 private void CreateRequiresDiagnostic (ISymbol member, AttributeData requiresAttribute, in DiagnosticContext diagnosticContext) 260 protected abstract string GetMessageFromAttribute (AttributeData requiresAttribute); 262 public static string GetUrlFromAttribute (AttributeData? requiresAttribute) 273 protected abstract bool VerifyAttributeArguments (AttributeData attribute);
RequiresAssemblyFilesAnalyzer.cs (2)
126 protected override bool VerifyAttributeArguments (AttributeData attribute) => attribute.ConstructorArguments.Length == 0 || 129 protected override string GetMessageFromAttribute (AttributeData requiresAttribute)
RequiresDynamicCodeAnalyzer.cs (2)
139 protected override bool VerifyAttributeArguments (AttributeData attribute) => 142 protected override string GetMessageFromAttribute (AttributeData? requiresAttribute)
RequiresISymbolExtensions.cs (2)
15 public static bool DoesMemberRequire (this ISymbol member, string requiresAttribute, [NotNullWhen (returnValue: true)] out AttributeData? requiresAttributeData) 40 public static bool IsInRequiresScope (this ISymbol member, string attributeName, [NotNullWhen (true)] out AttributeData? requiresAttribute)
RequiresUnreferencedCodeAnalyzer.cs (3)
34 && baseType.TryGetAttribute (RequiresUnreferencedCodeAttribute, out var requiresUnreferencedCodeAttribute)) { 97 protected override bool VerifyAttributeArguments (AttributeData attribute) => 100 protected override string GetMessageFromAttribute (AttributeData? requiresAttribute) =>
RequiresUnreferencedCodeUtils.cs (5)
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) 36 public static bool VerifyRequiresUnreferencedCodeAttributeArguments (AttributeData attribute) 39 public static string GetMessageFromAttribute (AttributeData? requiresAttribute)
TrimAnalysis\DiagnosticContext.cs (2)
68 && symbol.TryGetAttribute (DynamicallyAccessedMembersAnalyzer.DynamicallyAccessedMembersAttribute, out var _)) 71 && method.TryGetReturnAttribute (DynamicallyAccessedMembersAnalyzer.DynamicallyAccessedMembersAttribute, out var _))) {
TrimAnalysis\ReflectionAccessAnalyzer.cs (4)
86 void ReportRequiresUnreferencedCodeDiagnostic (Location location, AttributeData requiresAttributeData, ISymbol member) 101 if (methodSymbol.IsInRequiresUnreferencedCodeAttributeScope (out var requiresUnreferencedCodeAttributeData)) { 137 if (member.IsInRequiresUnreferencedCodeAttributeScope (out AttributeData? requiresUnreferencedCodeAttribute)) { 191 if (fieldSymbol.TryGetRequiresUnreferencedCodeAttribute (out var requiresUnreferencedCodeAttributeData))
Microsoft.Analyzers.Extra (6)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (2)
198foreach (var methodAttr in methodSymbol.GetAttributes()) 637foreach (var methodAttr in methodSymbol.GetAttributes())
ConditionalAccessAnalyzer.cs (2)
117bool MaybeNull(ImmutableArray<AttributeData> attrs) 119foreach (var attr in attrs)
MakeExeTypesInternalAnalyzer.cs (2)
97foreach (var attr in type.GetAttributes()) 122foreach (var attr in attrs)
Microsoft.Analyzers.Local (2)
Utilities\SymbolExtensions.cs (2)
39foreach (var a in sym.GetAttributes()) 52foreach (var a in sym.GetAttributes())
Microsoft.AspNetCore.App.Analyzers (40)
Mvc\DetectAmbiguousActionRoutes.cs (2)
122var actionNameAttribute = actionSymbol.GetAttributes(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Mvc_ActionNameAttribute), inherit: true).FirstOrDefault(); 216foreach (var attribute in actionSymbol.GetAttributes())
Mvc\DetectOverriddenAuthorizeAttribute.cs (6)
118var attributeUsage = attribute.GetAttributes(attributeUsageAttributeType, inherit: true).FirstOrDefault(); 155AttributeData? localAuthorizeAttribute = null; 156List<AttributeData>? localAuthorizeAttributeOverflow = null; 159foreach (var attribute in symbol.GetAttributes()) 199foreach (var extraAttribute in localAuthorizeAttributeOverflow ?? Enumerable.Empty<AttributeData>())
Mvc\MvcAnalyzer.cs (5)
71var controllerRouteAttribute = namedTypeSymbol.GetAttributes(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Mvc_RouteAttribute), inherit: true).FirstOrDefault(); 97foreach (var attribute in methodSymbol.GetAttributes()) 122foreach (var attribute in methodSymbol.GetAttributes()) 170private static RouteUsageModel? GetRouteUsageModel(AttributeData attribute, RouteUsageCache routeUsageCache, CancellationToken cancellationToken) 191private record struct AttributeInfo(AttributeData AttributeData, bool IsTargetingMethod);
RouteEmbeddedLanguage\Infrastructure\RoutePatternParametersDetector.cs (2)
46if (!parameterSymbol.TryGetAttributeImplementingInterface(fromRouteMetadata, out var attributeData)) 87foreach (var attributeData in child.GetAttributes())
RouteEmbeddedLanguage\Infrastructure\RouteStringSyntaxDetector.cs (2)
313foreach (var attribute in symbol.GetAttributes()) 327AttributeData attribute,
RouteHandlers\DetectMisplacedLambdaAttribute.cs (1)
43foreach (var attribute in attributes)
RouteHandlers\DisallowMvcBindArgumentsOnParameters.cs (1)
24var modelBindingAttribute = parameter.GetAttributes(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Mvc_ModelBinding_IBinderTypeProviderMetadata)).FirstOrDefault() ??
src\Shared\Roslyn\CodeAnalysisExtensions.cs (7)
21public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, ITypeSymbol attribute) 23foreach (var declaredAttribute in symbol.GetAttributes()) 32public static IEnumerable<AttributeData> GetAttributes(this IMethodSymbol methodSymbol, ITypeSymbol attribute, bool inherit) 40foreach (var attributeData in GetAttributes(current, attribute)) 54public static IEnumerable<AttributeData> GetAttributes(this ITypeSymbol typeSymbol, ITypeSymbol attribute, bool inherit) 61foreach (var attributeData in GetAttributes(type, attribute)) 133foreach (var declaredAttribute in symbol.GetAttributes())
src\Shared\RoslynUtils\SymbolExtensions.cs (14)
54foreach (var attributeData in symbol.GetAttributes()) 65public static bool HasAttribute(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol attributeType) 70public static bool TryGetAttribute(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol attributeType, [NotNullWhen(true)] out AttributeData? matchedAttribute) 72foreach (var attributeData in attributes) 87return symbol.TryGetAttributeImplementingInterface(interfaceType, out var _); 90public static bool TryGetAttributeImplementingInterface(this ISymbol symbol, INamedTypeSymbol interfaceType, [NotNullWhen(true)] out AttributeData? matchedAttribute) 92foreach (var attributeData in symbol.GetAttributes()) 105public static bool HasAttributeImplementingInterface(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol interfaceType) 107return attributes.TryGetAttributeImplementingInterface(interfaceType, out var _); 110public static bool TryGetAttributeImplementingInterface(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol interfaceType, [NotNullWhen(true)] out AttributeData? matchedAttribute) 112foreach (var attributeData in attributes) 203public static bool TryGetNamedArgumentValue<T>(this AttributeData attribute, string argumentName, out T? argumentValue)
Microsoft.AspNetCore.Components.Analyzers (1)
ComponentFacts.cs (1)
58var attribute = property.GetAttributes().FirstOrDefault(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.ParameterAttribute));
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
ComponentFacts.cs (1)
58var attribute = property.GetAttributes().FirstOrDefault(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.ParameterAttribute));
Microsoft.AspNetCore.Http.RequestDelegateGenerator (25)
src\Shared\RoslynUtils\SymbolExtensions.cs (14)
54foreach (var attributeData in symbol.GetAttributes()) 65public static bool HasAttribute(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol attributeType) 70public static bool TryGetAttribute(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol attributeType, [NotNullWhen(true)] out AttributeData? matchedAttribute) 72foreach (var attributeData in attributes) 87return symbol.TryGetAttributeImplementingInterface(interfaceType, out var _); 90public static bool TryGetAttributeImplementingInterface(this ISymbol symbol, INamedTypeSymbol interfaceType, [NotNullWhen(true)] out AttributeData? matchedAttribute) 92foreach (var attributeData in symbol.GetAttributes()) 105public static bool HasAttributeImplementingInterface(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol interfaceType) 107return attributes.TryGetAttributeImplementingInterface(interfaceType, out var _); 110public static bool TryGetAttributeImplementingInterface(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol interfaceType, [NotNullWhen(true)] out AttributeData? matchedAttribute) 112foreach (var attributeData in attributes) 203public static bool TryGetNamedArgumentValue<T>(this AttributeData attribute, string argumentName, out T? argumentValue)
StaticRouteHandlerModel\EndpointParameter.cs (11)
38var attributeBuilder = ImmutableArray.CreateBuilder<AttributeData>(); 67private void ProcessEndpointParameterSource(Endpoint endpoint, ISymbol symbol, ImmutableArray<AttributeData> attributes, WellKnownTypes wellKnownTypes) 69if (attributes.TryGetAttributeImplementingInterface(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromRouteMetadata), out var fromRouteAttribute)) 76else if (attributes.TryGetAttributeImplementingInterface(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromQueryMetadata), out var fromQueryAttribute)) 83else if (attributes.TryGetAttributeImplementingInterface(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromHeaderMetadata), out var fromHeaderAttribute)) 90else if (attributes.TryGetAttributeImplementingInterface(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromFormMetadata), out var fromFormAttribute)) 149if (attributes.TryGetAttribute(wellKnownTypes.Get(WellKnownType.Microsoft_Extensions_DependencyInjection_FromKeyedServicesAttribute), out var keyedServicesAttribute)) 155else if (attributes.TryGetAttribute(wellKnownTypes.Get(WellKnownType.Microsoft_Extensions_DependencyInjection_FromKeyedServicesAttribute), out var keyedServicesAttribute)) 423ImmutableArray<AttributeData> attributes, 428if (!attributes.TryGetAttributeImplementingInterface(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromBodyMetadata), out var fromBodyAttribute)) 445private static string GetEscapedParameterName(AttributeData attribute, string parameterName)
Microsoft.AspNetCore.Mvc.Analyzers (15)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (6)
84var attribute = GetAttribute(typeSymbol, routeAttribute); 98var attribute = GetAttribute(method, routeAttribute); 112var attribute = GetAttribute(method, filterAttribute); 124private static AttributeData? GetAttribute(ISymbol symbol, INamedTypeSymbol attributeType) 126foreach (var attribute in symbol.GetAttributes()) 137private static Location GetAttributeLocation(SymbolAnalysisContext context, AttributeData attribute)
src\Shared\Roslyn\CodeAnalysisExtensions.cs (7)
21public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, ITypeSymbol attribute) 23foreach (var declaredAttribute in symbol.GetAttributes()) 32public static IEnumerable<AttributeData> GetAttributes(this IMethodSymbol methodSymbol, ITypeSymbol attribute, bool inherit) 40foreach (var attributeData in GetAttributes(current, attribute)) 54public static IEnumerable<AttributeData> GetAttributes(this ITypeSymbol typeSymbol, ITypeSymbol attribute, bool inherit) 61foreach (var attributeData in GetAttributes(type, attribute)) 133foreach (var declaredAttribute in symbol.GetAttributes())
TopLevelParameterNameAnalyzer.cs (2)
152foreach (var attribute in symbol.GetAttributes(symbolCache.IModelNameProvider)) 178foreach (var attribute in parameterSymbol.GetAttributes(symbolCache.IBinderTypeProviderMetadata))
Microsoft.AspNetCore.Mvc.Api.Analyzers (22)
ActualApiResponseMetadataFactory.cs (2)
87var defaultStatusCodeAttribute = statementReturnType 246internal static int? GetDefaultStatusCode(AttributeData? attribute)
AddResponseTypeAttributeCodeFixAction.cs (1)
95var apiConventionMethodAttribute = context.Method.GetAttributes(context.SymbolCache.ApiConventionMethodAttribute).FirstOrDefault();
DeclaredApiResponseMetadata.cs (4)
14public static DeclaredApiResponseMetadata ForProducesResponseType(int statusCode, AttributeData attributeData, IMethodSymbol attributeSource) 19public static DeclaredApiResponseMetadata ForProducesDefaultResponse(AttributeData attributeData, IMethodSymbol attributeSource) 26AttributeData? attributeData, 40public AttributeData? Attribute { get; }
src\Shared\Roslyn\CodeAnalysisExtensions.cs (7)
21public static IEnumerable<AttributeData> GetAttributes(this ISymbol symbol, ITypeSymbol attribute) 23foreach (var declaredAttribute in symbol.GetAttributes()) 32public static IEnumerable<AttributeData> GetAttributes(this IMethodSymbol methodSymbol, ITypeSymbol attribute, bool inherit) 40foreach (var attributeData in GetAttributes(current, attribute)) 54public static IEnumerable<AttributeData> GetAttributes(this ITypeSymbol typeSymbol, ITypeSymbol attribute, bool inherit) 61foreach (var attributeData in GetAttributes(type, attribute)) 133foreach (var declaredAttribute in symbol.GetAttributes())
SymbolApiConventionMatcher.cs (2)
63var attribute = symbol.GetAttributes(symbolCache.ApiConventionNameMatchAttribute).FirstOrDefault(); 85var attribute = symbol.GetAttributes(symbolCache.ApiConventionTypeMatchAttribute).FirstOrDefault();
SymbolApiResponseMetadataProvider.cs (6)
47var errorTypeAttribute = 85var attribute = method.GetAttributes(symbolCache.ApiConventionMethodAttribute, inherit: true) 144foreach (var attribute in responseMetadataAttributes) 152var producesDefaultResponse = methodSymbol.GetAttributes(symbolCache.ProducesDefaultResponseTypeAttribute, inherit: true).FirstOrDefault(); 172var attribute = attributes[i]; 186internal static int GetStatusCode(AttributeData attribute)
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (2)
HubClientProxyGenerator.Parser.cs (1)
160foreach (var attributeData in methodSymbol.GetAttributes())
HubServerProxyGenerator.Parser.cs (1)
150foreach (var attributeData in methodSymbol.GetAttributes())
Microsoft.CodeAnalysis (43)
Diagnostic\CommonMessageProvider.cs (6)
260protected abstract void ReportInvalidAttributeArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, AttributeData attribute); 262public void ReportInvalidAttributeArgument(BindingDiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, AttributeData attribute) 290protected abstract void ReportMarshalUnmanagedTypeNotValidForFields(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute); 292public void ReportMarshalUnmanagedTypeNotValidForFields(BindingDiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute) 300protected abstract void ReportMarshalUnmanagedTypeOnlyValidForFields(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute); 302public void ReportMarshalUnmanagedTypeOnlyValidForFields(BindingDiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute)
Diagnostic\Diagnostic.cs (1)
354AttributeData? attribute;
Diagnostic\SuppressionInfo.cs (2)
25public AttributeData? Attribute { get; } 34internal SuppressionInfo(string id, AttributeData? attribute, ImmutableArray<Suppression> programmaticSuppressions)
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (7)
129public bool IsDiagnosticSuppressed(Diagnostic diagnostic, [NotNullWhen(true)] out AttributeData? suppressingAttribute) 274private bool IsSuppressionAttribute(AttributeData a) 283private static ImmutableDictionary<string, SuppressMessageInfo> DecodeLocalSuppressMessageAttributes(IEnumerable<AttributeData> attributes) 286foreach (var attribute in attributes) 319private static void DecodeGlobalSuppressMessageAttributes(Compilation compilation, GlobalSuppressions globalSuppressions, IEnumerable<AttributeData> attributes) 321foreach (var instance in attributes) 374private static bool TryDecodeSuppressMessageAttributeData(AttributeData attribute, out SuppressMessageInfo info)
DiagnosticAnalyzer\SuppressMessageInfo.cs (1)
15public AttributeData Attribute;
PEWriter\MetadataWriter.cs (1)
3450if (customAttribute is AttributeData { ApplicationSyntaxReference: { } syntaxReference })
SourceGeneration\GeneratedCodeUtilities.cs (1)
36foreach (var attribute in symbol.GetAttributes())
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithMetadataName.cs (10)
35/// <see cref="AttributeData"/>s for any matching attributes on <see cref="TargetSymbol"/>. Always non-empty. All 36/// these attributes will have an <see cref="AttributeData.AttributeClass"/> whose fully qualified name metadata 42public ImmutableArray<AttributeData> Attributes { get; } 48ImmutableArray<AttributeData> attributes) 75/// langword="true"/> for <paramref name="predicate"/> and which have a matching <see cref="AttributeData"/> whose 76/// <see cref="AttributeData.AttributeClass"/> has the same fully qualified, metadata name as <paramref 137static ImmutableArray<AttributeData> getMatchingAttributes( 143var result = ArrayBuilder<AttributeData>.GetInstance(); 156void addMatchingAttributes(ImmutableArray<AttributeData>? attributes) 161foreach (var attribute in attributes.Value)
SymbolDisplay\AbstractSymbolDisplayVisitor.cs (1)
190foreach (var attribute in typeSymbol.GetAttributes())
Symbols\Attributes\CommonAttributeData.cs (2)
397where TAttributeData : AttributeData 458where TAttributeData : AttributeData
Symbols\Attributes\CommonAttributeDataComparer.cs (5)
17/// Used to determine if two <see cref="AttributeData"/> instances are identical, 20internal sealed class CommonAttributeDataComparer : IEqualityComparer<AttributeData> 25public bool Equals(AttributeData attr1, AttributeData attr2) 38public int GetHashCode(AttributeData attr)
Symbols\Attributes\CustomAttributesBag.cs (1)
20where T : AttributeData
Symbols\Attributes\DecodeWellKnownAttributeArguments.cs (1)
14where TAttributeData : AttributeData
Symbols\Attributes\MarshalAsAttributeDecoder.cs (2)
18where TAttributeData : AttributeData 99private static UnmanagedType DecodeMarshalAsType(AttributeData attribute)
Symbols\IMethodSymbol.cs (1)
215ImmutableArray<AttributeData> GetReturnTypeAttributes();
Symbols\ISymbol.cs (1)
196ImmutableArray<AttributeData> GetAttributes();
Microsoft.CodeAnalysis.CodeStyle (8)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
585AttributeData attribute, 824AttributeData attribute,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
708foreach (var attribute in symbol.GetAttributes())
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
36foreach (var attribute in symbol.GetAttributes())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
711foreach (var attributeData in type.ContainingAssembly.GetAttributes())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (3)
30public static ImmutableArray<InterceptsLocationData> GetInterceptsLocationData(ImmutableArray<AttributeData> attributes) 34foreach (var attribute in attributes) 43public static bool TryGetInterceptsLocationData(AttributeData attribute, out InterceptsLocationData result)
Microsoft.CodeAnalysis.CodeStyle.Fixes (70)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (4)
98public TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 104public TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 133public abstract TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 135public abstract TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (1)
41foreach (var attribute in typeSymbol.GetAttributes())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
178public static T? GetReuseableSyntaxNodeForAttribute<T>(AttributeData attribute, CodeGenerationContextInfo info) 398public static bool IsCompilerInternalAttribute(AttributeData attribute)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (29)
34ImmutableArray<AttributeData> attributes, Accessibility accessibility, 49ImmutableArray<AttributeData> attributes, 83ImmutableArray<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers, 107ImmutableArray<AttributeData> attributes, 124ImmutableArray<AttributeData> attributes, 143ImmutableArray<AttributeData> attributes, string typeName, 153ImmutableArray<AttributeData> attributes, 164ImmutableArray<AttributeData> returnTypeAttributes = default, 177ImmutableArray<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers, 185ImmutableArray<AttributeData> returnTypeAttributes = default, 196ImmutableArray<AttributeData> attributes, 203ImmutableArray<AttributeData> returnTypeAttributes = default, 229ImmutableArray<AttributeData> toTypeAttributes = default, 249ImmutableArray<AttributeData> attributes, 257ImmutableArray<AttributeData> toTypeAttributes = default, 281ImmutableArray<AttributeData> attributes, RefKind refKind, bool isParams, ITypeSymbol type, string name, bool isOptional = false, bool hasDefaultValue = false, object? defaultValue = null) 291ImmutableArray<AttributeData>? attributes = null, 333ImmutableArray<AttributeData> attributes, 362ImmutableArray<AttributeData> attributes = default, 387ImmutableArray<AttributeData> attributes, 407public static AttributeData CreateAttributeData( 419ImmutableArray<AttributeData> attributes, 438ImmutableArray<AttributeData> attributes, 464ImmutableArray<AttributeData> attributes, 516ImmutableArray<AttributeData> attributes = default, 525Optional<ImmutableArray<AttributeData>> returnTypeAttributes = default) 546ImmutableArray<AttributeData> attributes = default, 572ImmutableArray<AttributeData> attributes = default, 593ImmutableArray<AttributeData> attributes = default,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (2)
94TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 104TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (4)
22private readonly ImmutableArray<AttributeData> _returnTypeAttributes; 24public virtual ImmutableArray<AttributeData> GetReturnTypeAttributes() 29ImmutableArray<AttributeData> attributes, 33ImmutableArray<AttributeData> returnTypeAttributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
30ImmutableArray<AttributeData> attributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAttributeData.cs (1)
15ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments) : AttributeData
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructorSymbol.cs (2)
19ImmutableArray<AttributeData> attributes, 32returnTypeAttributes: ImmutableArray<AttributeData>.Empty)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConversionSymbol.cs (2)
19ImmutableArray<AttributeData> attributes, 25ImmutableArray<AttributeData> toTypeAttributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationDestructorSymbol.cs (2)
13ImmutableArray<AttributeData> attributes) : CodeGenerationMethodSymbol(containingType, 23returnTypeAttributes: ImmutableArray<AttributeData>.Empty)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationEventSymbol.cs (1)
17ImmutableArray<AttributeData> attributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationFieldSymbol.cs (1)
19ImmutableArray<AttributeData> attributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (2)
29ImmutableArray<AttributeData> attributes, 38ImmutableArray<AttributeData> returnTypeAttributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
30ImmutableArray<AttributeData> attributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceOrTypeSymbol.cs (1)
22ImmutableArray<AttributeData> attributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationOperatorSymbol.cs (2)
20ImmutableArray<AttributeData> attributes, 26ImmutableArray<AttributeData> returnTypeAttributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationParameterSymbol.cs (1)
19ImmutableArray<AttributeData> attributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPropertySymbol.cs (1)
19ImmutableArray<AttributeData> attributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (5)
26private readonly ImmutableArray<AttributeData> _attributes; 37ImmutableArray<AttributeData> attributes, 164public ImmutableArray<AttributeData> GetAttributes() 167public ImmutableArray<AttributeData> GetAttributes(INamedTypeSymbol attributeType) 170public ImmutableArray<AttributeData> GetAttributes(IMethodSymbol attributeConstructor)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (1)
13ImmutableArray<AttributeData> attributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
24ImmutableArray<AttributeData> attributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (1)
174static bool shouldRemoveAttribute(AttributeData a, (INamedTypeSymbol[] removeAttributeTypes, ISymbol accessibleWithin) arg)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IPropertySymbolExtensions.cs (1)
69static bool ShouldRemoveAttribute(AttributeData a, (INamedTypeSymbol[] attributesToRemove, ISymbol accessibleWithin) arg)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
88attributes: ImmutableArray<AttributeData>.Empty));
Microsoft.CodeAnalysis.CSharp (12)
Errors\MessageProvider.cs (3)
258protected override void ReportInvalidAttributeArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, AttributeData attribute) 276protected override void ReportMarshalUnmanagedTypeNotValidForFields(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute) 281protected override void ReportMarshalUnmanagedTypeOnlyValidForFields(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute)
Symbols\Attributes\AttributeData.cs (1)
95return AttributeData.IsTargetEarlyAttribute(attributeType, argumentCount, description);
Symbols\PublicModel\MethodSymbol.cs (2)
266ImmutableArray<AttributeData> IMethodSymbol.GetReturnTypeAttributes() 268return _underlying.GetReturnTypeAttributes().Cast<CSharpAttributeData, AttributeData>();
Symbols\PublicModel\PreprocessingSymbol.cs (2)
64ImmutableArray<AttributeData> ISymbol.GetAttributes() => ImmutableArray<AttributeData>.Empty;
Symbols\PublicModel\Symbol.cs (2)
120ImmutableArray<AttributeData> ISymbol.GetAttributes() 122return StaticCast<AttributeData>.From(UnderlyingSymbol.GetAttributes());
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
539AttributeData.DecodeMethodImplAttribute<MethodWellKnownAttributeData, AttributeSyntax, CSharpAttributeData, AttributeLocation>(ref arguments, MessageProvider.Instance);
Symbols\Source\SourceNamedTypeSymbol.cs (1)
1133AttributeData.DecodeStructLayoutAttribute<TypeWellKnownAttributeData, AttributeSyntax, CSharpAttributeData, AttributeLocation>(
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (4)
22ImmutableArray<AttributeData> attributes, 49AttributeData attribute, SyntaxToken? target, CSharpCodeGenerationContextInfo info) 61private static AttributeSyntax? TryGenerateAttribute(AttributeData attribute, CSharpCodeGenerationContextInfo info) 84private static AttributeArgumentListSyntax? GenerateAttributeArgumentList(SyntaxGenerator generator, AttributeData attribute)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
318IEnumerable<AttributeData> attributes, 366AttributeData attributeToRemove,
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (13)
Attributes\AttributeTests.cs (1)
1430foreach (var a in attrs)
Attributes\AttributeTests_Assembly.cs (4)
1085foreach (var a in attrs) 1206foreach (var a in attrs) 1285foreach (var a in attrs) 1379foreach (var a in attrs)
OverloadResolutionPriorityTests.cs (1)
906var attr = c!.GetAttributes().Single();
Semantics\ParamsCollectionTests.cs (7)
239var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 355var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 538var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 683var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 1427var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 2551var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 2687var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (6)
Semantics\LambdaTests.cs (1)
3901void verifyAttributes(ImmutableArray<AttributeData> attributes, params string[] expectedAttributeNames)
Semantics\LocalFunctionTests.cs (3)
555var attributeData = attributes.Single(); 819var attributeData = returnAttributes.Single(); 857var attr = attrs.Single();
Semantics\NullableReferenceTypesTests.cs (2)
6468var attribute = c.GetAttributes().Single(); 6490var attribute = c.GetAttributes().Single();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Compilation\SemanticModelAPITests.cs (1)
4453var attribute = method.GetAttributes().Single();
Symbols\Retargeting\RetargetCustomAttributes.cs (2)
350var a = c1.GetAttributes().Single(); 392var a = c1.GetAttributes().Single();
Microsoft.CodeAnalysis.CSharp.Workspaces (6)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (4)
22ImmutableArray<AttributeData> attributes, 49AttributeData attribute, SyntaxToken? target, CSharpCodeGenerationContextInfo info) 61private static AttributeSyntax? TryGenerateAttribute(AttributeData attribute, CSharpCodeGenerationContextInfo info) 84private static AttributeArgumentListSyntax? GenerateAttributeArgumentList(SyntaxGenerator generator, AttributeData attribute)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
318IEnumerable<AttributeData> attributes, 366AttributeData attributeToRemove,
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (2)
230private static AttributeData GetAttributeData(string decl, string use) 4967var attribute = symbol.GetAttributes().Single();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (10)
CodeGeneration\CodeGenerationTests.cs (3)
371ImmutableArray<AttributeData> attributes = default, 536var attr = CodeGenerationSymbolFactory.CreateAttributeData(GetTypeSymbol(attributeClass)(testContext.SemanticModel)); 555var attribute = attributeTarget.GetAttributes().Single(attr => Equals(attr.AttributeClass, attributeType));
CodeGeneration\CodeGenerationTests.CSharp.cs (2)
493addMethod: CodeGenerationSymbolFactory.CreateAccessorSymbol(ImmutableArray<AttributeData>.Empty, Accessibility.NotApplicable, ImmutableArray<SyntaxNode>.Empty), 494removeMethod: CodeGenerationSymbolFactory.CreateAccessorSymbol(ImmutableArray<AttributeData>.Empty, Accessibility.NotApplicable, ImmutableArray<SyntaxNode>.Empty),
CodeGeneration\CodeGenerationTests.VisualBasic.cs (5)
424ImmutableArray<AttributeData>.Empty, Accessibility.NotApplicable, ImmutableArray<SyntaxNode>.Empty), 448addMethod: CodeGenerationSymbolFactory.CreateAccessorSymbol(ImmutableArray<AttributeData>.Empty, Accessibility.NotApplicable, ImmutableArray<SyntaxNode>.Empty), 477ImmutableArray<AttributeData>.Empty, Accessibility.NotApplicable, addStatements), 479ImmutableArray<AttributeData>.Empty, Accessibility.NotApplicable, removeStatements), 481ImmutableArray<AttributeData>.Empty, Accessibility.NotApplicable, raiseStatements),
Microsoft.CodeAnalysis.Features (15)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.cs (1)
33var attribute = diagnostic.GetSuppressionInfo(compilation).Attribute;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Attribute.cs (3)
24private readonly AttributeData _attribute; 27AttributeData attribute, 36AttributeData attribute,
DesignerAttribute\DesignerAttributeDiscoveryService.cs (1)
320var attribute = type.GetAttributes().FirstOrDefault(d => IsDesignerAttribute(d.AttributeClass));
EmbeddedLanguages\EmbeddedLanguageDetector.cs (2)
448foreach (var attribute in symbol.GetAttributes()) 460AttributeData attribute,
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (2)
254private ImmutableArray<AttributeData> DetermineAttributes() 261var attribute = CodeGenerationSymbolFactory.CreateAttributeData(serializableType);
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
86public ImmutableArray<AttributeData> GetAttributes()
MetadataAsSource\AbstractMetadataAsSourceService.WrappedMethodSymbol.cs (1)
96public ImmutableArray<AttributeData> GetReturnTypeAttributes()
MetadataAsSource\MetadataAsSourceHelpers.cs (1)
107foreach (var attribute in assemblySymbol.GetAttributes())
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
585AttributeData attribute, 824AttributeData attribute,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
708foreach (var attribute in symbol.GetAttributes())
Microsoft.CodeAnalysis.Test.Utilities (3)
Mocks\TestMessageProvider.cs (3)
268protected override void ReportInvalidAttributeArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, AttributeData attribute) 283protected override void ReportMarshalUnmanagedTypeNotValidForFields(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute) 288protected override void ReportMarshalUnmanagedTypeOnlyValidForFields(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute)
Microsoft.CodeAnalysis.VisualBasic (14)
Errors\MessageProvider.vb (3)
482Protected Overrides Sub ReportInvalidAttributeArgument(diagnostics As DiagnosticBag, attributeSyntax As SyntaxNode, parameterIndex As Integer, attribute As AttributeData) 497Protected Overrides Sub ReportMarshalUnmanagedTypeNotValidForFields(diagnostics As DiagnosticBag, attributeSyntax As SyntaxNode, parameterIndex As Integer, unmanagedTypeName As String, attribute As AttributeData) 502Protected Overrides Sub ReportMarshalUnmanagedTypeOnlyValidForFields(diagnostics As DiagnosticBag, attributeSyntax As SyntaxNode, parameterIndex As Integer, unmanagedTypeName As String, attribute As AttributeData)
Symbols\Attributes\AttributeData.vb (1)
93Return AttributeData.IsTargetEarlyAttribute(attributeType, argumentCount, description)
Symbols\MethodSymbol.vb (2)
1134Private Function IMethodSymbol_GetReturnTypeAttributes() As ImmutableArray(Of AttributeData) Implements IMethodSymbol.GetReturnTypeAttributes 1135Return ImmutableArrayExtensions.Cast(Of VisualBasicAttributeData, AttributeData)(Me.GetReturnTypeAttributes)
Symbols\Source\SourceMethodSymbol.vb (1)
1642AttributeData.DecodeMethodImplAttribute(Of MethodWellKnownAttributeData, AttributeSyntax, VisualBasicAttributeData, AttributeLocation)(arguments, MessageProvider.Instance)
Symbols\Source\SourceNamedTypeSymbol.vb (1)
2271AttributeData.DecodeStructLayoutAttribute(Of CommonTypeWellKnownAttributeData, AttributeSyntax, VisualBasicAttributeData, AttributeLocation)(
Symbols\Source\SourceParameterSymbol.vb (1)
271If AttributeData.IsTargetEarlyAttribute(attributeType:=attribute.AttributeClass, attributeArgCount:=attribute.CommonConstructorArguments.Length, description:=AttributeDescription.CallerArgumentExpressionAttribute) Then
Symbols\Symbol.vb (2)
1347Private Function ISymbol_GetAttributes() As ImmutableArray(Of AttributeData) Implements ISymbol.GetAttributes 1348Return StaticCast(Of AttributeData).From(Me.GetAttributes())
VisualBasicExtensions.vb (3)
611Public Function GetFieldAttributes(eventSymbol As IEventSymbol) As ImmutableArray(Of AttributeData) 614Return StaticCast(Of AttributeData).From(vbevent.GetFieldAttributes()) 616Return ImmutableArray(Of AttributeData).Empty
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (7)
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (1)
151attributes:=ImmutableArray(Of AttributeData).Empty,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\AttributeGenerator.vb (4)
15Public Function GenerateAttributeBlocks(attributes As ImmutableArray(Of AttributeData), options As CodeGenerationContextInfo, Optional target As SyntaxToken? = Nothing) As SyntaxList(Of AttributeListSyntax) 25Private Function GenerateAttributeBlock(attribute As AttributeData, options As CodeGenerationContextInfo, target As SyntaxToken?) As AttributeListSyntax 30Private Function GenerateAttribute(attribute As AttributeData, options As CodeGenerationContextInfo, target As SyntaxToken?) As AttributeSyntax 41Private Function GenerateArgumentList(generator As SyntaxGenerator, attribute As AttributeData) As ArgumentListSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
327attributes As IEnumerable(Of AttributeData), 359Public Overrides Function RemoveAttribute(Of TDeclarationNode As SyntaxNode)(destination As TDeclarationNode, attributeToRemove As AttributeData, options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode
Microsoft.CodeAnalysis.VisualBasic.Features (4)
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (1)
148attributes:=ImmutableArray(Of AttributeData).Empty,
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.vb (1)
64attributes:=ImmutableArray(Of AttributeData).Empty,
GenerateType\VisualBasicGenerateTypeService.vb (1)
692attributes:=ImmutableArray(Of AttributeData).Empty,
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (1)
151attributes:=ImmutableArray(Of AttributeData).Empty,
Microsoft.CodeAnalysis.VisualBasic.Workspaces (6)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\AttributeGenerator.vb (4)
15Public Function GenerateAttributeBlocks(attributes As ImmutableArray(Of AttributeData), options As CodeGenerationContextInfo, Optional target As SyntaxToken? = Nothing) As SyntaxList(Of AttributeListSyntax) 25Private Function GenerateAttributeBlock(attribute As AttributeData, options As CodeGenerationContextInfo, target As SyntaxToken?) As AttributeListSyntax 30Private Function GenerateAttribute(attribute As AttributeData, options As CodeGenerationContextInfo, target As SyntaxToken?) As AttributeSyntax 41Private Function GenerateArgumentList(generator As SyntaxGenerator, attribute As AttributeData) As ArgumentListSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
327attributes As IEnumerable(Of AttributeData), 359Public Overrides Function RemoveAttribute(Of TDeclarationNode As SyntaxNode)(destination As TDeclarationNode, attributeToRemove As AttributeData, options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
CodeGeneration\SyntaxGeneratorTests.vb (1)
209Private Shared Function GetAttributeData(decl As String, use As String) As AttributeData
Microsoft.CodeAnalysis.Workspaces (88)
Editing\SyntaxGenerator.cs (1)
1021public SyntaxNode Attribute(AttributeData attribute)
FindSymbols\FindReferences\DependentProjectsFinder.cs (2)
246private static bool IsInternalsVisibleToAttribute(AttributeData attr) 286foreach (var attr in assembly.GetAttributes().Where(IsInternalsVisibleToAttribute))
Shared\Extensions\IParameterSymbolExtensions.cs (1)
13public static IParameterSymbol WithAttributes(this IParameterSymbol parameter, ImmutableArray<AttributeData> attributes)
Shared\Extensions\ISymbolExtensions.cs (9)
107ISymbol symbol, INamedTypeSymbol? hideModuleNameAttribute, ImmutableArray<AttributeData> attributes = default) 116foreach (var attribute in attributes) 128ImmutableArray<AttributeData> attributes, bool hideAdvancedMembers, IMethodSymbol? constructor) 133foreach (var attribute in attributes) 151ImmutableArray<AttributeData> attributes, ImmutableArray<IMethodSymbol> constructors) 160ImmutableArray<AttributeData> attributes, ImmutableArray<IMethodSymbol> constructors) 169ImmutableArray<AttributeData> attributes, ImmutableArray<IMethodSymbol> constructors) 182ImmutableArray<AttributeData> attributes, ImmutableArray<IMethodSymbol> attributeConstructors, int hiddenFlag) 184foreach (var attribute in attributes)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
36foreach (var attribute in symbol.GetAttributes())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
711foreach (var attributeData in type.ContainingAssembly.GetAttributes())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (3)
30public static ImmutableArray<InterceptsLocationData> GetInterceptsLocationData(ImmutableArray<AttributeData> attributes) 34foreach (var attribute in attributes) 43public static bool TryGetInterceptsLocationData(AttributeData attribute, out InterceptsLocationData result)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (4)
98public TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 104public TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 133public abstract TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 135public abstract TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (1)
41foreach (var attribute in typeSymbol.GetAttributes())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
178public static T? GetReuseableSyntaxNodeForAttribute<T>(AttributeData attribute, CodeGenerationContextInfo info) 398public static bool IsCompilerInternalAttribute(AttributeData attribute)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (29)
34ImmutableArray<AttributeData> attributes, Accessibility accessibility, 49ImmutableArray<AttributeData> attributes, 83ImmutableArray<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers, 107ImmutableArray<AttributeData> attributes, 124ImmutableArray<AttributeData> attributes, 143ImmutableArray<AttributeData> attributes, string typeName, 153ImmutableArray<AttributeData> attributes, 164ImmutableArray<AttributeData> returnTypeAttributes = default, 177ImmutableArray<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers, 185ImmutableArray<AttributeData> returnTypeAttributes = default, 196ImmutableArray<AttributeData> attributes, 203ImmutableArray<AttributeData> returnTypeAttributes = default, 229ImmutableArray<AttributeData> toTypeAttributes = default, 249ImmutableArray<AttributeData> attributes, 257ImmutableArray<AttributeData> toTypeAttributes = default, 281ImmutableArray<AttributeData> attributes, RefKind refKind, bool isParams, ITypeSymbol type, string name, bool isOptional = false, bool hasDefaultValue = false, object? defaultValue = null) 291ImmutableArray<AttributeData>? attributes = null, 333ImmutableArray<AttributeData> attributes, 362ImmutableArray<AttributeData> attributes = default, 387ImmutableArray<AttributeData> attributes, 407public static AttributeData CreateAttributeData( 419ImmutableArray<AttributeData> attributes, 438ImmutableArray<AttributeData> attributes, 464ImmutableArray<AttributeData> attributes, 516ImmutableArray<AttributeData> attributes = default, 525Optional<ImmutableArray<AttributeData>> returnTypeAttributes = default) 546ImmutableArray<AttributeData> attributes = default, 572ImmutableArray<AttributeData> attributes = default, 593ImmutableArray<AttributeData> attributes = default,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (2)
94TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 104TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (4)
22private readonly ImmutableArray<AttributeData> _returnTypeAttributes; 24public virtual ImmutableArray<AttributeData> GetReturnTypeAttributes() 29ImmutableArray<AttributeData> attributes, 33ImmutableArray<AttributeData> returnTypeAttributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
30ImmutableArray<AttributeData> attributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAttributeData.cs (1)
15ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments) : AttributeData
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructorSymbol.cs (2)
19ImmutableArray<AttributeData> attributes, 32returnTypeAttributes: ImmutableArray<AttributeData>.Empty)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConversionSymbol.cs (2)
19ImmutableArray<AttributeData> attributes, 25ImmutableArray<AttributeData> toTypeAttributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationDestructorSymbol.cs (2)
13ImmutableArray<AttributeData> attributes) : CodeGenerationMethodSymbol(containingType, 23returnTypeAttributes: ImmutableArray<AttributeData>.Empty)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationEventSymbol.cs (1)
17ImmutableArray<AttributeData> attributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationFieldSymbol.cs (1)
19ImmutableArray<AttributeData> attributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (2)
29ImmutableArray<AttributeData> attributes, 38ImmutableArray<AttributeData> returnTypeAttributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
30ImmutableArray<AttributeData> attributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceOrTypeSymbol.cs (1)
22ImmutableArray<AttributeData> attributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationOperatorSymbol.cs (2)
20ImmutableArray<AttributeData> attributes, 26ImmutableArray<AttributeData> returnTypeAttributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationParameterSymbol.cs (1)
19ImmutableArray<AttributeData> attributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPropertySymbol.cs (1)
19ImmutableArray<AttributeData> attributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (5)
26private readonly ImmutableArray<AttributeData> _attributes; 37ImmutableArray<AttributeData> attributes, 164public ImmutableArray<AttributeData> GetAttributes() 167public ImmutableArray<AttributeData> GetAttributes(INamedTypeSymbol attributeType) 170public ImmutableArray<AttributeData> GetAttributes(IMethodSymbol attributeConstructor)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (1)
13ImmutableArray<AttributeData> attributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
24ImmutableArray<AttributeData> attributes,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (1)
174static bool shouldRemoveAttribute(AttributeData a, (INamedTypeSymbol[] removeAttributeTypes, ISymbol accessibleWithin) arg)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IPropertySymbolExtensions.cs (1)
69static bool ShouldRemoveAttribute(AttributeData a, (INamedTypeSymbol[] attributesToRemove, ISymbol accessibleWithin) arg)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
88attributes: ImmutableArray<AttributeData>.Empty));
Microsoft.Extensions.Logging.Generators (2)
LoggerMessageGenerator.Parser.cs (2)
120ImmutableArray<AttributeData> boundAttributes = logMethodSymbol.GetAttributes(); 127foreach (AttributeData attributeData in boundAttributes)
Microsoft.Extensions.Options.SourceGeneration (5)
Parser.cs (3)
350foreach (var attribute in member.GetAttributes().Where(a => a.AttributeClass is not null)) 619private void TrackCompareAttributeForSubstitution(AttributeData attribute, ITypeSymbol modelType, ref string attributeFullQualifiedName) 630private void TrackRangeAttributeForSubstitution(AttributeData attribute, ITypeSymbol memberType, ref string attributeFullQualifiedName)
ParserUtilities.cs (2)
14internal static AttributeData? GetSymbolAttributeAnnotationOrDefault(ISymbol? attribute, ISymbol symbol) 22foreach (var item in attrs)
Microsoft.Gen.ComplianceReports (8)
Parser.cs (8)
118foreach (var attribute in ps!.GetAttributes()) 166foreach (var attribute in typeSymbol.GetAttributes()) 172foreach (var attribute in memberType.GetAttributes()) 178foreach (AttributeData attribute in member.GetAttributes()) 207foreach (var a in method.GetAttributes()) 229foreach (var attribute in p.Type.GetAttributes()) 235foreach (AttributeData attribute in p.GetAttributes()) 253private ClassifiedItem? AppendAttributeClassifications(ClassifiedItem? ci, AttributeData attribute)
Microsoft.Gen.Logging (17)
Parsing\AttributeProcessors.cs (4)
24ExtractLoggerMessageAttributeValues(AttributeData attr, SymbolHolder symbols) 128public static (bool skipNullProperties, bool omitReferenceName, bool transitive) ExtractLogPropertiesAttributeValues(AttributeData attr) 166public static (bool omitReferenceName, ITypeSymbol providerType, string providerMethodName) ExtractTagProviderAttributeValues(AttributeData attr) 193public static string ExtractTagNameAttributeValues(AttributeData attr)
Parsing\Parser.cs (4)
106var logPropertiesAttribute = ParserUtilities.GetSymbolAttributeAnnotationOrDefault(symbols.LogPropertiesAttribute, paramSymbol); 121var tagProviderAttribute = ParserUtilities.GetSymbolAttributeAnnotationOrDefault(symbols.TagProviderAttribute, paramSymbol); 368var attr = ParserUtilities.GetSymbolAttributeAnnotationOrDefault(symbols.LoggerMessageAttribute, methodSymbol)!; 571var tagNameAttribute = ParserUtilities.GetSymbolAttributeAnnotationOrDefault(symbols.TagNameAttribute, paramSymbol);
Parsing\Parser.LogProperties.cs (5)
23AttributeData logPropertiesAttribute, 130var logPropertiesAttribute = ParserUtilities.GetSymbolAttributeAnnotationOrDefault(symbols.LogPropertiesAttribute, property); 131var logPropertyIgnoreAttribute = ParserUtilities.GetSymbolAttributeAnnotationOrDefault(symbols.LogPropertyIgnoreAttribute, property); 132var tagProviderAttribute = ParserUtilities.GetSymbolAttributeAnnotationOrDefault(symbols.TagProviderAttribute, property); 190var tagNameAttribute = ParserUtilities.GetSymbolAttributeAnnotationOrDefault(symbols.TagNameAttribute, property);
Parsing\Parser.TagProvider.cs (2)
14AttributeData tagProviderAttribute, 47AttributeData tagProviderAttribute,
src\Generators\Shared\ParserUtilities.cs (2)
19internal static AttributeData? GetSymbolAttributeAnnotationOrDefault(ISymbol? attribute, ISymbol symbol) 27foreach (var item in attrs)
Microsoft.Gen.Logging.Unit.Tests (3)
LogParserUtilitiesTests.cs (2)
91.Returns(Array.Empty<AttributeData>().ToImmutableArray()); 175var logPropertiesAttribute = new Mock<AttributeData>();
ParserUtilitiesTests.cs (1)
81var result = ParserUtilities.GetSymbolAttributeAnnotationOrDefault(null, null!);
Microsoft.Gen.Metrics (6)
Parser.cs (4)
91foreach (var methodAttribute in methodSymbol.GetAttributes()) 257var attributeData = ParserUtilities.GetSymbolAttributeAnnotationOrDefault(symbols.TagNameAttribute, symbol); 277AttributeData attribute, 395AttributeData methodAttribute,
src\Generators\Shared\ParserUtilities.cs (2)
19internal static AttributeData? GetSymbolAttributeAnnotationOrDefault(ISymbol? attribute, ISymbol symbol) 27foreach (var item in attrs)
Microsoft.Gen.MetricsReports (6)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (4)
91foreach (var methodAttribute in methodSymbol.GetAttributes()) 257var attributeData = ParserUtilities.GetSymbolAttributeAnnotationOrDefault(symbols.TagNameAttribute, symbol); 277AttributeData attribute, 395AttributeData methodAttribute,
src\Generators\Shared\ParserUtilities.cs (2)
19internal static AttributeData? GetSymbolAttributeAnnotationOrDefault(ISymbol? attribute, ISymbol symbol) 27foreach (var item in attrs)
Microsoft.Interop.ComInterfaceGenerator (36)
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (3)
51AttributeData? interfaceTypeAttributeData = type.GetAttributes().FirstOrDefault(a => a.AttributeClass.Equals(interfaceTypeAttribute, SymbolEqualityComparer.Default)); 76AttributeData comImportAttribute = type.GetAttributes().First(attr => attr.AttributeClass.ToDisplayString() == TypeNames.System_Runtime_InteropServices_ComImportAttribute); 146private static MarshallingInfoParser CreateComImportMarshallingInfoParser(StubEnvironment env, GeneratorDiagnosticsBag diagnostics, IMethodSymbol method, AttributeData unparsedAttributeData)
Analyzers\GeneratedComInterfaceAttributeAnalyzer.cs (5)
35ImmutableArray<AttributeData> customAttributes = typeSymbol.GetAttributes(); 41&& GetAttribute(typeSymbol, TypeNames.InterfaceTypeAttribute, out AttributeData? comInterfaceAttribute) 49private static bool InterfaceTypeAttributeIsSupported(AttributeData comInterfaceAttribute, out string argument) 76private static bool GetAttribute(ISymbol symbol, string attributeDisplayName, [NotNullWhen(true)] out AttributeData? attribute) 78foreach (AttributeData attr in symbol.GetAttributes())
AttributeInfo.cs (1)
25internal static AttributeInfo From(AttributeData attribute)
ComClassInfo.cs (1)
45AttributeData? generatedComInterfaceAttribute = iface.GetAttributes().FirstOrDefault(attr => attr.AttributeClass?.ToDisplayString() == TypeNames.GeneratedComInterfaceAttribute);
ComInterfaceGenerator.cs (5)
243AttributeData? lcidConversionAttr = null; 244AttributeData? suppressGCTransitionAttribute = null; 245AttributeData? unmanagedCallConvAttribute = null; 246foreach (AttributeData attr in symbol.GetAttributes()) 271GeneratedComInterfaceCompilationData.TryGetGeneratedComInterfaceAttributeFromInterface(symbol.ContainingType, out var generatedComAttribute);
ComInterfaceInfo.cs (4)
297foreach (var attr in implemented.GetAttributes()) 329AttributeData? guidAttr = null; 330AttributeData? _ = null; // Interface Attribute Type. We'll always assume IUnknown for now. 331foreach (var attr in interfaceSymbol.GetAttributes())
ComMethodInfo.cs (1)
146foreach (var attr in attributes)
GeneratedComInterfaceAttributeData.cs (4)
39public static bool TryGetGeneratedComInterfaceAttributeFromInterface(INamedTypeSymbol interfaceSymbol, [NotNullWhen(true)] out AttributeData? generatedComInterfaceAttribute) 42foreach (var attr in interfaceSymbol.GetAttributes()) 55bool found = TryGetGeneratedComInterfaceAttributeFromInterface(interfaceSymbol, out var attr); 60public static GeneratedComInterfaceCompilationData GetDataFromAttribute(AttributeData attr)
GeneratorDiagnostics.cs (2)
519AttributeData attributeData, 537AttributeData attributeData,
VirtualMethodPointerStubGenerator.cs (2)
285public static ImmutableArray<FunctionPointerUnmanagedCallingConventionSyntax> GenerateCallConvSyntaxFromAttributes(AttributeData? suppressGCTransitionAttribute, AttributeData? unmanagedCallConvAttribute, ImmutableArray<FunctionPointerUnmanagedCallingConventionSyntax> defaultCallingConventions)
VtableIndexStubGenerator.cs (8)
129private static VirtualMethodIndexCompilationData? ProcessVirtualMethodIndexAttribute(AttributeData attrData) 206AttributeData? virtualMethodIndexAttr = null; 207AttributeData? lcidConversionAttr = null; 208AttributeData? suppressGCTransitionAttribute = null; 209AttributeData? unmanagedCallConvAttribute = null; 210foreach (AttributeData attr in symbol.GetAttributes()) 300var unmanagedObjectUnwrapper = symbol.ContainingType.GetAttributes().FirstOrDefault(att => att.AttributeClass.IsOfType(TypeNames.UnmanagedObjectUnwrapperAttribute)); 324private static MarshallingInfo CreateExceptionMarshallingInfo(AttributeData virtualMethodIndexAttr, ISymbol symbol, Compilation compilation, GeneratorDiagnosticsBag diagnostics, VirtualMethodIndexCompilationData virtualMethodIndexData)
Microsoft.Interop.JavaScript.JSImportGenerator (8)
JSExportGenerator.cs (3)
157private static JSExportData? ProcessJSExportAttribute(AttributeData attrData) 177AttributeData? jsExportAttr = null; 178foreach (AttributeData attr in symbol.GetAttributes())
JSImportGenerator.cs (3)
129private static JSImportData? ProcessJSImportAttribute(AttributeData attrData) 157AttributeData? jsImportAttr = null; 158foreach (AttributeData attr in symbol.GetAttributes())
JSMarshalAsAttributeInfoParser.cs (2)
22public MarshallingInfo ParseAttribute(AttributeData attributeData, ITypeSymbol type, int indirectionDepth, UseSiteAttributeProvider useSiteAttributes, GetMarshallingInfoCallback marshallingInfoCallback) 62UseSiteAttributeData IUseSiteAttributeParser.ParseAttribute(AttributeData attributeData, IElementInfoProvider elementInfoProvider, GetMarshallingInfoCallback marshallingInfoCallback)
Microsoft.Interop.LibraryImportGenerator (21)
Analyzers\ConvertToLibraryImportAnalyzer.cs (4)
121foreach (AttributeData attr in method.GetAttributes()) 142AttributeData dllImportAttribute = method.GetAttributes().First(attr => attr.AttributeClass.ToDisplayString() == TypeNames.DllImportAttribute); 186AttributeData? bestFitMappingContainingType = method.ContainingType.GetAttributes().FirstOrDefault(attr => attr.AttributeClass.ToDisplayString() == TypeNames.System_Runtime_InteropServices_BestFitMappingAttribute); 192AttributeData? bestFitMappingContainingAssembly = method.ContainingAssembly.GetAttributes().FirstOrDefault(attr => attr.AttributeClass.ToDisplayString() == TypeNames.System_Runtime_InteropServices_BestFitMappingAttribute);
Analyzers\ConvertToLibraryImportFixer.cs (3)
213if (!TryGetAttribute(methodSymbol, dllImportAttrType, out AttributeData? dllImportAttr)) 659private static bool TryGetAttribute(IMethodSymbol method, INamedTypeSymbol attributeType, out AttributeData? attr) 662foreach (AttributeData attrLocal in method.GetAttributes())
Analyzers\ShapeBreakingDiagnosticSuppressor.cs (1)
60AttributeData? attrData = containingType.GetAttributes().FirstOrDefault(
GeneratorDiagnostics.cs (1)
275AttributeData attributeData,
LibraryImportGenerator.cs (12)
112private static List<AttributeSyntax> GenerateSyntaxForForwardedAttributes(AttributeData? suppressGCTransitionAttribute, AttributeData? unmanagedCallConvAttribute, AttributeData? defaultDllImportSearchPathsAttribute, AttributeData? wasmImportLinkageAttribute) 186private static LibraryImportCompilationData? ProcessLibraryImportAttribute(AttributeData attrData) 232AttributeData? generatedDllImportAttr = null; 233AttributeData? lcidConversionAttr = null; 234AttributeData? suppressGCTransitionAttribute = null; 235AttributeData? unmanagedCallConvAttribute = null; 236AttributeData? defaultDllImportSearchPathsAttribute = null; 237AttributeData? wasmImportLinkageAttribute = null; 238foreach (AttributeData attr in symbol.GetAttributes())
Microsoft.Interop.LibraryImportGenerator.Downlevel (7)
DownlevelLibraryImportGenerator.cs (6)
88private static List<AttributeSyntax> GenerateSyntaxForForwardedAttributes(AttributeData? defaultDllImportSearchPathsAttribute) 128private static LibraryImportCompilationData? ProcessLibraryImportAttribute(AttributeData attrData) 170AttributeData? generatedDllImportAttr = null; 171AttributeData? lcidConversionAttr = null; 172AttributeData? defaultDllImportSearchPathsAttribute = null; 173foreach (AttributeData attr in symbol.GetAttributes())
GeneratorDiagnostics.cs (1)
275AttributeData attributeData,
Microsoft.Interop.SourceGeneration (43)
ComInterfaceMarshallingInfoProvider.cs (1)
26public MarshallingInfo? ParseAttribute(AttributeData attributeData, ITypeSymbol type, int indirectionDepth, UseSiteAttributeProvider useSiteAttributes, GetMarshallingInfoCallback marshallingInfoCallback)
CustomMarshallingInfoHelper.cs (2)
16AttributeData attrData, 136AttributeData attrData,
DefaultMarshallingInfoParser.cs (1)
32public static MarshallingInfoParser Create(StubEnvironment env, GeneratorDiagnosticsBag diagnostics, IMethodSymbol method, InteropAttributeCompilationData interopAttributeData, AttributeData unparsedAttributeData)
DiagnosticExtensions.cs (4)
30this AttributeData attributeData, 43this AttributeData attributeData, 134this AttributeData attributeData, 147this AttributeData attributeData,
GeneratorDiagnosticsBag.cs (3)
56AttributeData attributeData, 69AttributeData attributeData, 82AttributeData attributeData,
ManualTypeMarshallingHelper.cs (1)
165foreach (AttributeData attr in attrs)
MarshalAsParser.cs (2)
133UseSiteAttributeData IUseSiteAttributeParser.ParseAttribute(AttributeData attributeData, IElementInfoProvider elementInfoProvider, GetMarshallingInfoCallback marshallingInfoCallback) 152MarshallingInfo? IMarshallingInfoAttributeParser.ParseAttribute(AttributeData attributeData, ITypeSymbol type, int indirectionDepth, UseSiteAttributeProvider useSiteAttributes, GetMarshallingInfoCallback marshallingInfoCallback)
MarshalAsWithCustomMarshallersParser.cs (1)
37MarshallingInfo? IMarshallingInfoAttributeParser.ParseAttribute(AttributeData attributeData, ITypeSymbol type, int indirectionDepth, UseSiteAttributeProvider useSiteAttributes, GetMarshallingInfoCallback marshallingInfoCallback)
MarshallingInfoParser.cs (12)
18public sealed record UseSiteAttributeData(int IndirectionDepth, CountInfo CountInfo, AttributeData AttributeData); 48UseSiteAttributeData ParseAttribute(AttributeData attributeData, IElementInfoProvider elementInfoProvider, GetMarshallingInfoCallback marshallingInfoCallback); 72MarshallingInfo? ParseAttribute(AttributeData attributeData, ITypeSymbol type, int indirectionDepth, UseSiteAttributeProvider useSiteAttributes, GetMarshallingInfoCallback marshallingInfoCallback); 117bool TryGetInfoForElementName(AttributeData attrData, string elementName, GetMarshallingInfoCallback marshallingInfoCallback, IElementInfoProvider rootProvider, out TypePositionInfo info); 127bool TryGetInfoForParamIndex(AttributeData attrData, int paramIndex, GetMarshallingInfoCallback marshallingInfoCallback, IElementInfoProvider rootProvider, out TypePositionInfo info); 143public static bool TryGetInfoForElementName(this IElementInfoProvider provider, AttributeData attrData, string elementName, GetMarshallingInfoCallback marshallingInfoCallback, out TypePositionInfo info) 156public static bool TryGetInfoForParamIndex(this IElementInfoProvider provider, AttributeData attrData, int paramIndex, GetMarshallingInfoCallback marshallingInfoCallback, out TypePositionInfo info) 214IEnumerable<AttributeData> useSiteAttributes) 242foreach (AttributeData typeAttribute in type.GetAttributes()) 255private MarshallingInfo? GetMarshallingInfoForAttribute(AttributeData attribute, ITypeSymbol type, int indirectionDepth, UseSiteAttributeProvider useSiteAttributes, GetMarshallingInfoCallback marshallingInfoCallback) 298public bool TryGetInfoForElementName(AttributeData attrData, string elementName, GetMarshallingInfoCallback marshallingInfoCallback, IElementInfoProvider rootProvider, [NotNullWhen(true)] out TypePositionInfo? info) 325public bool TryGetInfoForParamIndex(AttributeData attrData, int paramIndex, GetMarshallingInfoCallback marshallingInfoCallback, IElementInfoProvider rootProvider, [NotNullWhen(true)] out TypePositionInfo? info)
MarshalUsingAttributeParser.cs (3)
28MarshallingInfo? IMarshallingInfoAttributeParser.ParseAttribute(AttributeData attributeData, ITypeSymbol type, int indirectionDepth, UseSiteAttributeProvider useSiteAttributes, GetMarshallingInfoCallback marshallingInfoCallback) 64UseSiteAttributeData IUseSiteAttributeParser.ParseAttribute(AttributeData attributeData, IElementInfoProvider elementInfoProvider, GetMarshallingInfoCallback marshallingInfoCallback) 72private CountInfo ParseCountInfo(AttributeData attributeData, IElementInfoProvider elementInfoProvider, GetMarshallingInfoCallback marshallingInfoCallback)
MethodSignatureElementInfoProvider.cs (2)
29public bool TryGetInfoForElementName(AttributeData attrData, string elementName, GetMarshallingInfoCallback marshallingInfoCallback, IElementInfoProvider rootProvider, out TypePositionInfo info) 60public bool TryGetInfoForParamIndex(AttributeData attrData, int paramIndex, GetMarshallingInfoCallback marshallingInfoCallback, IElementInfoProvider rootProvider, out TypePositionInfo info)
NativeMarshallingAttributeParser.cs (1)
22public MarshallingInfo? ParseAttribute(AttributeData attributeData, ITypeSymbol type, int indirectionDepth, UseSiteAttributeProvider useSiteAttributes, GetMarshallingInfoCallback marshallingInfoCallback)
SignatureContext.cs (1)
172static bool IsSkipLocalsInitAttribute(AttributeData a)
StringMarshallingInfoProvider.cs (2)
17private readonly AttributeData _stringMarshallingCustomAttribute; 20public StringMarshallingInfoProvider(Compilation compilation, GeneratorDiagnosticsBag diagnostics, AttributeData stringMarshallingCustomAttribute, DefaultMarshallingInfo defaultMarshallingInfo)
TypePositionInfo.cs (2)
116private static (ByValueContentsMarshalKind, Location? inAttribute, Location? outAttribute) GetByValueContentsMarshalKind(IEnumerable<AttributeData> attributes, Compilation compilation) 125foreach (AttributeData attr in attributes)
TypeSymbolExtensions.cs (2)
120foreach (AttributeData attr in type.GetAttributes()) 137foreach (AttributeData attr in type.GetAttributes())
UseSiteAttributeProvider.cs (3)
31IEnumerable<AttributeData> useSiteAttributes, 38foreach (AttributeData attribute in useSiteAttributes) 58UseSiteAttributeData? GetUseSiteInfoForAttribute(AttributeData attribute)
Microsoft.ML.InternalCodeAnalyzer (3)
BestFriendOnPublicDeclarationsAnalyzer.cs (1)
62var attribute = context.Symbol.GetAttributes().FirstOrDefault(a => Equals(a.AttributeClass, attributeType));
ContractsCheckNameofFixProvider.cs (1)
143AttributeData attr = s.GetAttributes().FirstOrDefault(a => a.AttributeClass.Name == "ArgumentAttribute");
IMethodSymbolExtensions.cs (1)
14foreach (var attribute in method.GetAttributes())
Mvc.Api.Analyzers.Test (4)
ActualApiResponseMetadataFactoryTest.cs (2)
28var attribute = compilation.GetTypeByMetadataName(typeof(TestActionResultUsingStatusCodesConstants).FullName).GetAttributes()[0]; 42var attribute = compilation.GetTypeByMetadataName(typeof(TestActionResultUsingHttpStatusCodeCast).FullName).GetAttributes()[0];
DeclaredApiResponseMetadataTest.cs (1)
14private readonly AttributeData AttributeData = new TestAttributeData();
SymbolApiResponseMetadataProviderTest.cs (1)
393var attribute = method.GetAttributes().First();
System.Private.CoreLib.Generators (4)
EventSourceGenerator.Parser.cs (1)
35foreach (AttributeData attribute in context.TargetSymbol.GetAttributes())
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (3)
169foreach (var attributeData in methodSymbol.GetAttributes()) 384foreach (var attributeData in symbol.GetAttributes()) 517foreach (var attributeData in symbolThatMightHaveCompExactlyDependsOnAttribute.GetAttributes())
System.Text.Json.SourceGeneration (8)
Helpers\RoslynExtensions.cs (1)
31public static Location? GetLocation(this AttributeData attributeData)
JsonSourceGenerator.Parser.cs (7)
240foreach (AttributeData attributeData in contextClassSymbol.GetAttributes()) 261private SourceGenerationOptionsSpec ParseJsonSourceGenerationOptionsAttribute(INamedTypeSymbol contextType, AttributeData attributeData) 452private TypeToGenerate? ParseJsonSerializableAttribute(AttributeData attributeData) 699foreach (AttributeData attributeData in typeToGenerate.Type.GetAttributes()) 1254foreach (AttributeData attributeData in memberInfo.GetAttributes()) 1562private TypeRef? GetConverterTypeFromJsonConverterAttribute(INamedTypeSymbol contextType, ISymbol declaringSymbol, AttributeData attributeData) 1577private TypeRef? GetConverterTypeFromAttribute(INamedTypeSymbol contextType, ITypeSymbol? converterType, ISymbol declaringSymbol, AttributeData attributeData)
System.Text.RegularExpressions.Generator (2)
RegexGenerator.Parser.cs (2)
62ImmutableArray<AttributeData> boundAttributes = context.Attributes; 67AttributeData generatedRegexAttr = boundAttributes[0];