11 types derived from AttributeData
GenerateDocumentationAndConfigFiles (1)
Microsoft.CodeAnalysis.Analyzers (1)
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp (1)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (1)
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.Workspaces (1)
Mvc.Api.Analyzers.Test (1)
Roslyn.Diagnostics.Analyzers (1)
Text.Analyzers (1)
1419 references to AttributeData
ConfigurationSchemaGenerator (3)
EventSourceGenerator (1)
GenerateDocumentationAndConfigFiles (87)
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\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 (48)
Metrics (20)
Metrics.Legacy (20)
Microsoft.Analyzers.Extra (6)
Microsoft.Analyzers.Local (2)
Microsoft.AspNetCore.App.Analyzers (47)
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\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.Mvc.Api.Analyzers (22)
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 (97)
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\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 (20)
Microsoft.CodeAnalysis.BannedApiAnalyzers (91)
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\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.CodeStyle (10)
Microsoft.CodeAnalysis.CodeStyle.Fixes (68)
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\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.Semantic.UnitTests (4)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (3)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (6)
Microsoft.CodeAnalysis.Extensions.Package (2)
Microsoft.CodeAnalysis.Features (31)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (89)
Microsoft.CodeAnalysis.PublicApiAnalyzers (22)
Microsoft.CodeAnalysis.ResxSourceGenerator (20)
Microsoft.CodeAnalysis.Test.Utilities (3)
Mocks\TestMessageProvider.cs (3)
273protected override void ReportInvalidAttributeArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, AttributeData attribute)
288protected override void ReportMarshalUnmanagedTypeNotValidForFields(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute)
293protected override void ReportMarshalUnmanagedTypeOnlyValidForFields(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute)
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.Workspaces (86)
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\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.Extensions.Logging.Generators (14)
Microsoft.Extensions.Options.SourceGeneration (5)
Microsoft.Extensions.Validation.ValidationsGenerator (25)
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 (36)
Microsoft.Interop.JavaScript.JSImportGenerator (8)
Microsoft.Interop.LibraryImportGenerator (23)
Microsoft.Interop.LibraryImportGenerator.Downlevel (7)
Microsoft.Interop.SourceGeneration (44)
MarshallingInfoParser.cs (13)
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)
250private MarshallingInfo? GetMarshallingInfoForAttribute(AttributeData attribute, ITypeSymbol type, int indirectionDepth, UseSiteAttributeProvider useSiteAttributes, GetMarshallingInfoCallback marshallingInfoCallback)
255private MarshallingInfo? GetMarshallingInfoForAttributes(ReadOnlySpan<AttributeData> attrs, ITypeSymbol type, int indirectionDepth, UseSiteAttributeProvider useSiteAttributes, GetMarshallingInfoCallback marshallingInfoCallback)
259foreach (var attr in attrs)
299public bool TryGetInfoForElementName(AttributeData attrData, string elementName, GetMarshallingInfoCallback marshallingInfoCallback, IElementInfoProvider rootProvider, [NotNullWhen(true)] out TypePositionInfo? info)
326public 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)
Mvc.Api.Analyzers.Test (4)
Roslyn.Diagnostics.Analyzers (109)
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\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)
System.Private.CoreLib.Generators (3)
System.Text.Json.SourceGeneration (8)
System.Text.RegularExpressions.Generator (2)
Test.Utilities (19)
Text.Analyzers (88)
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\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,