7 types derived from AttributeData
GenerateDocumentationAndConfigFiles (1)
Microsoft.CodeAnalysis.Analyzers (1)
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp (1)
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.Workspaces (1)
Roslyn.Diagnostics.Analyzers (1)
1282 references to AttributeData
Aspire.Hosting.Integration.Analyzers (17)
ConfigurationSchemaGenerator (3)
EventSourceGenerator (1)
GenerateDocumentationAndConfigFiles (88)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (4)
97public TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode
103public TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode
132public abstract TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
134public abstract TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (29)
29ImmutableArray<AttributeData> attributes, Accessibility accessibility,
44ImmutableArray<AttributeData> attributes,
78ImmutableArray<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers,
103ImmutableArray<AttributeData> attributes,
120ImmutableArray<AttributeData> attributes,
139ImmutableArray<AttributeData> attributes, string typeName,
149ImmutableArray<AttributeData> attributes,
160ImmutableArray<AttributeData> returnTypeAttributes = default,
173ImmutableArray<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers,
181ImmutableArray<AttributeData> returnTypeAttributes = default,
192ImmutableArray<AttributeData> attributes,
199ImmutableArray<AttributeData> returnTypeAttributes = default,
225ImmutableArray<AttributeData> toTypeAttributes = default,
245ImmutableArray<AttributeData> attributes,
253ImmutableArray<AttributeData> toTypeAttributes = default,
277ImmutableArray<AttributeData> attributes, RefKind refKind, bool isParams, ITypeSymbol type, string name, bool isOptional = false, bool hasDefaultValue = false, object? defaultValue = null)
287ImmutableArray<AttributeData>? attributes = null,
329ImmutableArray<AttributeData> attributes,
358ImmutableArray<AttributeData> attributes = default,
383ImmutableArray<AttributeData> attributes,
403public static AttributeData CreateAttributeData(
415ImmutableArray<AttributeData> attributes,
434ImmutableArray<AttributeData> attributes,
460ImmutableArray<AttributeData> attributes,
512ImmutableArray<AttributeData> attributes = default,
521Optional<ImmutableArray<AttributeData>> returnTypeAttributes = default)
542ImmutableArray<AttributeData> attributes = default,
570ImmutableArray<AttributeData> attributes = default,
591ImmutableArray<AttributeData> attributes = default,
ILLink.RoslynAnalyzer (46)
Microsoft.Analyzers.Extra (6)
Microsoft.Analyzers.Local (2)
Microsoft.AspNetCore.App.Analyzers (47)
src\aspnetcore\src\Shared\RoslynUtils\SymbolExtensions.cs (21)
54foreach (var attributeData in symbol.GetAttributes())
65public static bool HasAttribute(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol attributeType)
89public static bool TryGetAttribute(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol attributeType, [NotNullWhen(true)] out AttributeData? matchedAttribute)
91foreach (var attributeData in attributes)
106return symbol.TryGetAttributeImplementingInterface(interfaceType, out var _);
109public static bool TryGetAttributeImplementingInterface(this ISymbol symbol, INamedTypeSymbol interfaceType, [NotNullWhen(true)] out AttributeData? matchedAttribute)
111foreach (var attributeData in symbol.GetAttributes())
124public static bool HasAttributeImplementingInterface(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol interfaceType)
126return attributes.TryGetAttributeImplementingInterface(interfaceType, out var _);
129public static bool TryGetAttributeImplementingInterface(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol interfaceType, [NotNullWhen(true)] out AttributeData? matchedAttribute)
131foreach (var attributeData in attributes)
146return symbol.TryGetAttributeInheritingFrom(baseType, out var _);
149public static bool TryGetAttributeInheritingFrom(this ISymbol symbol, INamedTypeSymbol baseType, [NotNullWhen(true)] out AttributeData? matchedAttribute)
154public static bool HasAttributeInheritingFrom(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol baseType)
156return attributes.TryGetAttributeInheritingFrom(baseType, out var _);
159public static bool TryGetAttributeInheritingFrom(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol baseType, [NotNullWhen(true)] out AttributeData? matchedAttribute)
161foreach (var attributeData in attributes)
280public static bool TryGetNamedArgumentValue<T>(this AttributeData attribute, string argumentName, out T? argumentValue)
Microsoft.AspNetCore.Components.Analyzers (1)
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (32)
src\aspnetcore\src\Shared\RoslynUtils\SymbolExtensions.cs (21)
54foreach (var attributeData in symbol.GetAttributes())
65public static bool HasAttribute(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol attributeType)
89public static bool TryGetAttribute(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol attributeType, [NotNullWhen(true)] out AttributeData? matchedAttribute)
91foreach (var attributeData in attributes)
106return symbol.TryGetAttributeImplementingInterface(interfaceType, out var _);
109public static bool TryGetAttributeImplementingInterface(this ISymbol symbol, INamedTypeSymbol interfaceType, [NotNullWhen(true)] out AttributeData? matchedAttribute)
111foreach (var attributeData in symbol.GetAttributes())
124public static bool HasAttributeImplementingInterface(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol interfaceType)
126return attributes.TryGetAttributeImplementingInterface(interfaceType, out var _);
129public static bool TryGetAttributeImplementingInterface(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol interfaceType, [NotNullWhen(true)] out AttributeData? matchedAttribute)
131foreach (var attributeData in attributes)
146return symbol.TryGetAttributeInheritingFrom(baseType, out var _);
149public static bool TryGetAttributeInheritingFrom(this ISymbol symbol, INamedTypeSymbol baseType, [NotNullWhen(true)] out AttributeData? matchedAttribute)
154public static bool HasAttributeInheritingFrom(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol baseType)
156return attributes.TryGetAttributeInheritingFrom(baseType, out var _);
159public static bool TryGetAttributeInheritingFrom(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol baseType, [NotNullWhen(true)] out AttributeData? matchedAttribute)
161foreach (var attributeData in attributes)
280public static bool TryGetNamedArgumentValue<T>(this AttributeData attribute, string argumentName, out T? argumentValue)
StaticRouteHandlerModel\EndpointParameter.cs (11)
39var attributeBuilder = ImmutableArray.CreateBuilder<AttributeData>();
68private void ProcessEndpointParameterSource(Endpoint endpoint, ISymbol symbol, ImmutableArray<AttributeData> attributes, WellKnownTypes wellKnownTypes)
70if (attributes.TryGetAttributeImplementingInterface(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromRouteMetadata), out var fromRouteAttribute))
77else if (attributes.TryGetAttributeImplementingInterface(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromQueryMetadata), out var fromQueryAttribute))
84else if (attributes.TryGetAttributeImplementingInterface(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromHeaderMetadata), out var fromHeaderAttribute))
91else if (attributes.TryGetAttributeImplementingInterface(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromFormMetadata), out var fromFormAttribute))
150if (attributes.TryGetAttributeInheritingFrom(wellKnownTypes.Get(WellKnownType.Microsoft_Extensions_DependencyInjection_FromKeyedServicesAttribute), out var keyedServicesAttribute))
156else if (attributes.TryGetAttributeInheritingFrom(wellKnownTypes.Get(WellKnownType.Microsoft_Extensions_DependencyInjection_FromKeyedServicesAttribute), out var keyedServicesAttribute))
424ImmutableArray<AttributeData> attributes,
429if (!attributes.TryGetAttributeImplementingInterface(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromBodyMetadata), out var fromBodyAttribute))
446private static string GetEscapedParameterName(AttributeData attribute, string parameterName)
Microsoft.AspNetCore.Mvc.Analyzers (15)
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (2)
Microsoft.CodeAnalysis (43)
Diagnostic\CommonMessageProvider.cs (6)
264protected abstract void ReportInvalidAttributeArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, AttributeData attribute);
266public void ReportInvalidAttributeArgument(BindingDiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, AttributeData attribute)
294protected abstract void ReportMarshalUnmanagedTypeNotValidForFields(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute);
296public void ReportMarshalUnmanagedTypeNotValidForFields(BindingDiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute)
304protected abstract void ReportMarshalUnmanagedTypeOnlyValidForFields(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute);
306public void ReportMarshalUnmanagedTypeOnlyValidForFields(BindingDiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute)
Microsoft.CodeAnalysis.Analyzers (98)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (4)
97public TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode
103public TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode
132public abstract TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
134public abstract TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (29)
29ImmutableArray<AttributeData> attributes, Accessibility accessibility,
44ImmutableArray<AttributeData> attributes,
78ImmutableArray<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers,
103ImmutableArray<AttributeData> attributes,
120ImmutableArray<AttributeData> attributes,
139ImmutableArray<AttributeData> attributes, string typeName,
149ImmutableArray<AttributeData> attributes,
160ImmutableArray<AttributeData> returnTypeAttributes = default,
173ImmutableArray<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers,
181ImmutableArray<AttributeData> returnTypeAttributes = default,
192ImmutableArray<AttributeData> attributes,
199ImmutableArray<AttributeData> returnTypeAttributes = default,
225ImmutableArray<AttributeData> toTypeAttributes = default,
245ImmutableArray<AttributeData> attributes,
253ImmutableArray<AttributeData> toTypeAttributes = default,
277ImmutableArray<AttributeData> attributes, RefKind refKind, bool isParams, ITypeSymbol type, string name, bool isOptional = false, bool hasDefaultValue = false, object? defaultValue = null)
287ImmutableArray<AttributeData>? attributes = null,
329ImmutableArray<AttributeData> attributes,
358ImmutableArray<AttributeData> attributes = default,
383ImmutableArray<AttributeData> attributes,
403public static AttributeData CreateAttributeData(
415ImmutableArray<AttributeData> attributes,
434ImmutableArray<AttributeData> attributes,
460ImmutableArray<AttributeData> attributes,
512ImmutableArray<AttributeData> attributes = default,
521Optional<ImmutableArray<AttributeData>> returnTypeAttributes = default)
542ImmutableArray<AttributeData> attributes = default,
570ImmutableArray<AttributeData> attributes = default,
591ImmutableArray<AttributeData> attributes = default,
Microsoft.CodeAnalysis.AnalyzerUtilities (21)
Microsoft.CodeAnalysis.CodeStyle (11)
Microsoft.CodeAnalysis.CodeStyle.Fixes (68)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (4)
97public TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode
103public TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode
132public abstract TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
134public abstract TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (29)
29ImmutableArray<AttributeData> attributes, Accessibility accessibility,
44ImmutableArray<AttributeData> attributes,
78ImmutableArray<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers,
103ImmutableArray<AttributeData> attributes,
120ImmutableArray<AttributeData> attributes,
139ImmutableArray<AttributeData> attributes, string typeName,
149ImmutableArray<AttributeData> attributes,
160ImmutableArray<AttributeData> returnTypeAttributes = default,
173ImmutableArray<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers,
181ImmutableArray<AttributeData> returnTypeAttributes = default,
192ImmutableArray<AttributeData> attributes,
199ImmutableArray<AttributeData> returnTypeAttributes = default,
225ImmutableArray<AttributeData> toTypeAttributes = default,
245ImmutableArray<AttributeData> attributes,
253ImmutableArray<AttributeData> toTypeAttributes = default,
277ImmutableArray<AttributeData> attributes, RefKind refKind, bool isParams, ITypeSymbol type, string name, bool isOptional = false, bool hasDefaultValue = false, object? defaultValue = null)
287ImmutableArray<AttributeData>? attributes = null,
329ImmutableArray<AttributeData> attributes,
358ImmutableArray<AttributeData> attributes = default,
383ImmutableArray<AttributeData> attributes,
403public static AttributeData CreateAttributeData(
415ImmutableArray<AttributeData> attributes,
434ImmutableArray<AttributeData> attributes,
460ImmutableArray<AttributeData> attributes,
512ImmutableArray<AttributeData> attributes = default,
521Optional<ImmutableArray<AttributeData>> returnTypeAttributes = default)
542ImmutableArray<AttributeData> attributes = default,
570ImmutableArray<AttributeData> attributes = default,
591ImmutableArray<AttributeData> attributes = default,
Microsoft.CodeAnalysis.CSharp (12)
Errors\MessageProvider.cs (3)
262protected override void ReportInvalidAttributeArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, AttributeData attribute)
280protected override void ReportMarshalUnmanagedTypeNotValidForFields(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute)
285protected override void ReportMarshalUnmanagedTypeOnlyValidForFields(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute)
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (7)
Microsoft.CodeAnalysis.CSharp.Features (8)
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
Microsoft.CodeAnalysis.Extensions.Package (2)
Microsoft.CodeAnalysis.Features (31)
Microsoft.CodeAnalysis.NetAnalyzers (89)
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.cs (11)
241foreach (AttributeData attribute in method.GetAttributes())
1812static void MergePlatformAttributes(ImmutableArray<AttributeData> immediateAttributes, ref PlatformAttributes parentAttributes,
1816foreach (AttributeData attribute in immediateAttributes)
2057AttributeData attribute, SmallDictionary<string, (string relatedPlatform, bool isSubset)> relatedPlatforms)
2088private static bool TryParsePlatformNameAndVersion(AttributeData attribute, out string platformName, [NotNullWhen(true)] out Version? version)
2100private static bool HasNonEmptyStringArgument(AttributeData attribute, [NotNullWhen(true)] out string? stringArgument)
2144private static bool AddAttribute(AttributeData attribute, Version version, Versions attributes)
2176static void AddOrUpdateObsoletedAttribute(AttributeData attribute, Versions attributes, Version version)
2199static void AddOrUpdateUnsupportedAttribute(AttributeData attribute, Versions attributes, Version version)
2241private static string? PopulateMessage(AttributeData attribute)
2252private static string? PopulateUrl(AttributeData attribute)
Microsoft.NetCore.Analyzers\Performance\ConstantExpectedAnalyzer.UnmanagedHelper.cs (5)
57public static bool TryCreate(IParameterSymbol parameterSymbol, AttributeData attributeData, T typeMin, T typeMax, [NotNullWhen(true)] out ConstantExpectedParameter? parameter)
59public static bool Validate(IParameterSymbol parameterSymbol, AttributeData attributeData, T typeMin, T typeMax, DiagnosticHelper diagnosticHelper, out ImmutableArray<Diagnostic> diagnostics)
109public bool Validate(IParameterSymbol parameterSymbol, AttributeData attributeData, T typeMin, T typeMax, DiagnosticHelper diagnosticHelper, out ImmutableArray<Diagnostic> diagnostics)
122public bool TryCreate(IParameterSymbol parameterSymbol, AttributeData attributeData, T typeMin, T typeMax, [NotNullWhen(true)] out ConstantExpectedParameter? parameter)
134private bool IsValidMinMax(AttributeData attributeData, T typeMin, T typeMax, out T minValue, out T maxValue, out ErrorKind errorFlags)
Microsoft.CodeAnalysis.Razor.Compiler (33)
Microsoft.CodeAnalysis.ResxSourceGenerator (21)
Microsoft.CodeAnalysis.VisualBasic (14)
Errors\MessageProvider.vb (3)
488Protected Overrides Sub ReportInvalidAttributeArgument(diagnostics As DiagnosticBag, attributeSyntax As SyntaxNode, parameterIndex As Integer, attribute As AttributeData)
503Protected Overrides Sub ReportMarshalUnmanagedTypeNotValidForFields(diagnostics As DiagnosticBag, attributeSyntax As SyntaxNode, parameterIndex As Integer, unmanagedTypeName As String, attribute As AttributeData)
508Protected Overrides Sub ReportMarshalUnmanagedTypeOnlyValidForFields(diagnostics As DiagnosticBag, attributeSyntax As SyntaxNode, parameterIndex As Integer, unmanagedTypeName As String, attribute As AttributeData)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (7)
Microsoft.CodeAnalysis.VisualBasic.Features (4)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (6)
Microsoft.CodeAnalysis.Workspaces (88)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (4)
97public TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode
103public TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode
132public abstract TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
134public abstract TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (29)
29ImmutableArray<AttributeData> attributes, Accessibility accessibility,
44ImmutableArray<AttributeData> attributes,
78ImmutableArray<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers,
103ImmutableArray<AttributeData> attributes,
120ImmutableArray<AttributeData> attributes,
139ImmutableArray<AttributeData> attributes, string typeName,
149ImmutableArray<AttributeData> attributes,
160ImmutableArray<AttributeData> returnTypeAttributes = default,
173ImmutableArray<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers,
181ImmutableArray<AttributeData> returnTypeAttributes = default,
192ImmutableArray<AttributeData> attributes,
199ImmutableArray<AttributeData> returnTypeAttributes = default,
225ImmutableArray<AttributeData> toTypeAttributes = default,
245ImmutableArray<AttributeData> attributes,
253ImmutableArray<AttributeData> toTypeAttributes = default,
277ImmutableArray<AttributeData> attributes, RefKind refKind, bool isParams, ITypeSymbol type, string name, bool isOptional = false, bool hasDefaultValue = false, object? defaultValue = null)
287ImmutableArray<AttributeData>? attributes = null,
329ImmutableArray<AttributeData> attributes,
358ImmutableArray<AttributeData> attributes = default,
383ImmutableArray<AttributeData> attributes,
403public static AttributeData CreateAttributeData(
415ImmutableArray<AttributeData> attributes,
434ImmutableArray<AttributeData> attributes,
460ImmutableArray<AttributeData> attributes,
512ImmutableArray<AttributeData> attributes = default,
521Optional<ImmutableArray<AttributeData>> returnTypeAttributes = default)
542ImmutableArray<AttributeData> attributes = default,
570ImmutableArray<AttributeData> attributes = default,
591ImmutableArray<AttributeData> attributes = default,
Microsoft.Diagnostics.DataContractReader.DataGenerator (11)
Microsoft.DotNet.ApiCompatibility (22)
Microsoft.DotNet.ApiSymbolExtensions (6)
Microsoft.Extensions.Configuration.Binder.SourceGeneration (2)
Microsoft.Extensions.Logging.Generators (2)
Microsoft.Extensions.Options.SourceGeneration (5)
Microsoft.Extensions.Validation.ValidationsGenerator (26)
src\aspnetcore\src\Shared\RoslynUtils\SymbolExtensions.cs (21)
54foreach (var attributeData in symbol.GetAttributes())
65public static bool HasAttribute(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol attributeType)
89public static bool TryGetAttribute(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol attributeType, [NotNullWhen(true)] out AttributeData? matchedAttribute)
91foreach (var attributeData in attributes)
106return symbol.TryGetAttributeImplementingInterface(interfaceType, out var _);
109public static bool TryGetAttributeImplementingInterface(this ISymbol symbol, INamedTypeSymbol interfaceType, [NotNullWhen(true)] out AttributeData? matchedAttribute)
111foreach (var attributeData in symbol.GetAttributes())
124public static bool HasAttributeImplementingInterface(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol interfaceType)
126return attributes.TryGetAttributeImplementingInterface(interfaceType, out var _);
129public static bool TryGetAttributeImplementingInterface(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol interfaceType, [NotNullWhen(true)] out AttributeData? matchedAttribute)
131foreach (var attributeData in attributes)
146return symbol.TryGetAttributeInheritingFrom(baseType, out var _);
149public static bool TryGetAttributeInheritingFrom(this ISymbol symbol, INamedTypeSymbol baseType, [NotNullWhen(true)] out AttributeData? matchedAttribute)
154public static bool HasAttributeInheritingFrom(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol baseType)
156return attributes.TryGetAttributeInheritingFrom(baseType, out var _);
159public static bool TryGetAttributeInheritingFrom(this ImmutableArray<AttributeData> attributes, INamedTypeSymbol baseType, [NotNullWhen(true)] out AttributeData? matchedAttribute)
161foreach (var attributeData in attributes)
280public static bool TryGetNamedArgumentValue<T>(this AttributeData attribute, string argumentName, out T? argumentValue)
Microsoft.Gen.BuildMetadata (2)
Microsoft.Gen.ComplianceReports (8)
Microsoft.Gen.Logging (17)
Microsoft.Gen.Logging.Unit.Tests (3)
Microsoft.Gen.MetadataExtractor (14)
Microsoft.Gen.Metrics (6)
Microsoft.Gen.MetricsReports (6)
Microsoft.Interop.ComInterfaceGenerator (50)
Microsoft.Interop.JavaScript.JSImportGenerator (13)
Microsoft.Interop.LibraryImportGenerator (32)
Microsoft.Interop.LibraryImportGenerator.Downlevel (14)
Microsoft.Interop.SourceGeneration (60)
MarshallingInfoParser.cs (13)
19public sealed record UseSiteAttributeData(int IndirectionDepth, CountInfo CountInfo, AttributeData AttributeData, TypePositionInfo? IidParameterIndexInfo = null);
49UseSiteAttributeData ParseAttribute(AttributeData attributeData, IElementInfoProvider elementInfoProvider, GetMarshallingInfoCallback marshallingInfoCallback);
73MarshallingInfo? ParseAttribute(AttributeData attributeData, ITypeSymbol type, int indirectionDepth, UseSiteAttributeProvider useSiteAttributes, GetMarshallingInfoCallback marshallingInfoCallback);
118bool TryGetInfoForElementName(AttributeData attrData, string elementName, GetMarshallingInfoCallback marshallingInfoCallback, IElementInfoProvider rootProvider, out TypePositionInfo info);
128bool TryGetInfoForParamIndex(AttributeData attrData, int paramIndex, GetMarshallingInfoCallback marshallingInfoCallback, IElementInfoProvider rootProvider, out TypePositionInfo info);
144public static bool TryGetInfoForElementName(this IElementInfoProvider provider, AttributeData attrData, string elementName, GetMarshallingInfoCallback marshallingInfoCallback, out TypePositionInfo info)
157public static bool TryGetInfoForParamIndex(this IElementInfoProvider provider, AttributeData attrData, int paramIndex, GetMarshallingInfoCallback marshallingInfoCallback, out TypePositionInfo info)
215IEnumerable<AttributeData> useSiteAttributes)
251private MarshallingInfo? GetMarshallingInfoForAttribute(AttributeData attribute, ITypeSymbol type, int indirectionDepth, UseSiteAttributeProvider useSiteAttributes, GetMarshallingInfoCallback marshallingInfoCallback)
256private MarshallingInfo? GetMarshallingInfoForAttributes(ReadOnlySpan<AttributeData> attrs, ITypeSymbol type, int indirectionDepth, UseSiteAttributeProvider useSiteAttributes, GetMarshallingInfoCallback marshallingInfoCallback)
260foreach (var attr in attrs)
300public bool TryGetInfoForElementName(AttributeData attrData, string elementName, GetMarshallingInfoCallback marshallingInfoCallback, IElementInfoProvider rootProvider, [NotNullWhen(true)] out TypePositionInfo? info)
327public bool TryGetInfoForParamIndex(AttributeData attrData, int paramIndex, GetMarshallingInfoCallback marshallingInfoCallback, IElementInfoProvider rootProvider, [NotNullWhen(true)] out TypePositionInfo? info)
Microsoft.Maui.Controls.BindingSourceGen (4)
Microsoft.Maui.Controls.SourceGen (1)
Microsoft.ML.InternalCodeAnalyzer (3)
Roslyn.Diagnostics.Analyzers (110)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (4)
97public TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode
103public TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode
132public abstract TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
134public abstract TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (29)
29ImmutableArray<AttributeData> attributes, Accessibility accessibility,
44ImmutableArray<AttributeData> attributes,
78ImmutableArray<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers,
103ImmutableArray<AttributeData> attributes,
120ImmutableArray<AttributeData> attributes,
139ImmutableArray<AttributeData> attributes, string typeName,
149ImmutableArray<AttributeData> attributes,
160ImmutableArray<AttributeData> returnTypeAttributes = default,
173ImmutableArray<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers,
181ImmutableArray<AttributeData> returnTypeAttributes = default,
192ImmutableArray<AttributeData> attributes,
199ImmutableArray<AttributeData> returnTypeAttributes = default,
225ImmutableArray<AttributeData> toTypeAttributes = default,
245ImmutableArray<AttributeData> attributes,
253ImmutableArray<AttributeData> toTypeAttributes = default,
277ImmutableArray<AttributeData> attributes, RefKind refKind, bool isParams, ITypeSymbol type, string name, bool isOptional = false, bool hasDefaultValue = false, object? defaultValue = null)
287ImmutableArray<AttributeData>? attributes = null,
329ImmutableArray<AttributeData> attributes,
358ImmutableArray<AttributeData> attributes = default,
383ImmutableArray<AttributeData> attributes,
403public static AttributeData CreateAttributeData(
415ImmutableArray<AttributeData> attributes,
434ImmutableArray<AttributeData> attributes,
460ImmutableArray<AttributeData> attributes,
512ImmutableArray<AttributeData> attributes = default,
521Optional<ImmutableArray<AttributeData>> returnTypeAttributes = default)
542ImmutableArray<AttributeData> attributes = default,
570ImmutableArray<AttributeData> attributes = default,
591ImmutableArray<AttributeData> attributes = default,
Roslyn.Diagnostics.CSharp.Analyzers (7)
Roslyn.Diagnostics.VisualBasic.Analyzers (6)
System.Private.CoreLib.Generators (3)
System.Text.Json.SourceGeneration (14)
JsonSourceGenerator.Parser.cs (13)
271foreach (AttributeData attributeData in symbol.GetAttributes())
329foreach (AttributeData attributeData in contextClassSymbol.GetAttributes())
369foreach (AttributeData attributeData in contextTypeSymbol.GetAttributes())
398private SourceGenerationOptionsSpec ParseJsonSourceGenerationOptionsAttribute(INamedTypeSymbol contextType, AttributeData attributeData)
627private TypeToGenerate? ParseJsonSerializableAttribute(AttributeData attributeData)
999foreach (AttributeData attributeData in typeToGenerate.Type.GetAttributes())
1556foreach (AttributeData attr in namedType.GetAttributes())
1982foreach (AttributeData attr in type.GetAttributes())
2001foreach (AttributeData attr in type.GetAttributes())
2619foreach (AttributeData attributeData in memberInfo.GetAttributes())
2965private TypeRef? GetConverterTypeFromJsonConverterAttribute(INamedTypeSymbol contextType, ISymbol declaringSymbol, AttributeData attributeData, ref HashSet<string>? experimentalIds, ITypeSymbol? typeToConvert = null)
2984private TypeRef? GetConverterTypeFromAttribute(INamedTypeSymbol contextType, ITypeSymbol? converterType, ISymbol declaringSymbol, AttributeData attributeData, ref HashSet<string>? experimentalIds, ITypeSymbol? typeToConvert = null)
3025private TypeRef? GetTypeClassifierFactoryTypeFromAttribute(INamedTypeSymbol contextType, ITypeSymbol? classifierType, ISymbol declaringSymbol, AttributeData attributeData, ref HashSet<string>? experimentalIds)
System.Text.RegularExpressions.Generator (2)