6 implementations of GetAttributes
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
164public ImmutableArray<AttributeData> GetAttributes()
Microsoft.CodeAnalysis.CSharp (2)
Symbols\PublicModel\PreprocessingSymbol.cs (1)
64ImmutableArray<AttributeData> ISymbol.GetAttributes() => ImmutableArray<AttributeData>.Empty;
Symbols\PublicModel\Symbol.cs (1)
120ImmutableArray<AttributeData> ISymbol.GetAttributes()
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
86public ImmutableArray<AttributeData> GetAttributes()
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Symbol.vb (1)
1347Private Function ISymbol_GetAttributes() As ImmutableArray(Of AttributeData) Implements ISymbol.GetAttributes
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
164public ImmutableArray<AttributeData> GetAttributes()
347 references to GetAttributes
Aspire.Hosting.Analyzers (1)
AppHostAnalyzer.cs (1)
103var attrData = parameter.GetAttributes()
ConfigurationSchemaGenerator (3)
ConfigSchemaEmitter.cs (1)
412var attributes = propertySymbol?.GetAttributes();
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 (4)
ISymbolExtensions.cs (4)
22 foreach (var attr in symbol.GetAttributes ()) 32 foreach (var attr in member.GetAttributes ()) { 44 foreach (var attr in member.GetAttributes ()) { 217 foreach (var attr in methodSymbol.GetAttributes ()) {
Microsoft.Analyzers.Extra (9)
AsyncMethodWithoutCancellation.cs (1)
131.GetAttributes()
CallAnalysis\Arrays.cs (1)
115if (keyType.GetAttributes().Any(a => a.AttributeClass != null && SymbolEqualityComparer.Default.Equals(a.AttributeClass, flagsAttr)))
CallAnalysis\Fixers\LegacyLoggingFixer.cs (2)
198foreach (var methodAttr in methodSymbol.GetAttributes()) 637foreach (var methodAttr in methodSymbol.GetAttributes())
ConditionalAccessAnalyzer.cs (2)
42if (MaybeNull(propRef.Property.GetAttributes())) 55if (MaybeNull(fieldRef.Field.GetAttributes()))
MakeExeTypesInternalAnalyzer.cs (2)
97foreach (var attr in type.GetAttributes()) 121var attrs = member.GetAttributes();
UsingToStringInLoggersAnalyzer.cs (1)
53return symbol.GetAttributes().Any(a => a.AttributeClass != null && IsLoggerMessageAttribute(a.AttributeClass));
Microsoft.Analyzers.Local (2)
Utilities\SymbolExtensions.cs (2)
39foreach (var a in sym.GetAttributes()) 52foreach (var a in sym.GetAttributes())
Microsoft.AspNetCore.App.Analyzers (11)
Mvc\DetectAmbiguousActionRoutes.cs (1)
216foreach (var attribute in actionSymbol.GetAttributes())
Mvc\DetectOverriddenAuthorizeAttribute.cs (1)
159foreach (var attribute in symbol.GetAttributes())
Mvc\MvcAnalyzer.cs (2)
97foreach (var attribute in methodSymbol.GetAttributes()) 122foreach (var attribute in methodSymbol.GetAttributes())
RouteEmbeddedLanguage\Infrastructure\RoutePatternParametersDetector.cs (1)
87foreach (var attributeData in child.GetAttributes())
RouteEmbeddedLanguage\Infrastructure\RouteStringSyntaxDetector.cs (1)
313foreach (var attribute in symbol.GetAttributes())
RouteHandlers\DetectMisplacedLambdaAttribute.cs (1)
40var attributes = methodSymbol.GetAttributes();
src\Shared\Roslyn\CodeAnalysisExtensions.cs (2)
23foreach (var declaredAttribute in symbol.GetAttributes()) 133foreach (var declaredAttribute in symbol.GetAttributes())
src\Shared\RoslynUtils\SymbolExtensions.cs (2)
54foreach (var attributeData in symbol.GetAttributes()) 92foreach (var attributeData in symbol.GetAttributes())
Microsoft.AspNetCore.Components.Analyzers (4)
ComponentFacts.cs (4)
25return property.GetAttributes().Any(a => 43return property.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.ParameterAttribute)); 58var attribute = property.GetAttributes().FirstOrDefault(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.ParameterAttribute)); 87return property.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.CascadingParameterAttribute));
Microsoft.AspNetCore.Components.SdkAnalyzers (4)
ComponentFacts.cs (4)
25return property.GetAttributes().Any(a => 43return property.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.ParameterAttribute)); 58var attribute = property.GetAttributes().FirstOrDefault(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.ParameterAttribute)); 87return property.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.CascadingParameterAttribute));
Microsoft.AspNetCore.Http.RequestDelegateGenerator (5)
src\Shared\RoslynUtils\SymbolExtensions.cs (2)
54foreach (var attributeData in symbol.GetAttributes()) 92foreach (var attributeData in symbol.GetAttributes())
StaticRouteHandlerModel\EndpointParameter.cs (3)
27ProcessEndpointParameterSource(endpoint, parameter, parameter.GetAttributes(), wellKnownTypes); 39attributeBuilder.AddRange(property.GetAttributes()); 42attributeBuilder.AddRange(parameter.GetAttributes());
Microsoft.AspNetCore.Mvc.Analyzers (3)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (1)
126foreach (var attribute in symbol.GetAttributes())
src\Shared\Roslyn\CodeAnalysisExtensions.cs (2)
23foreach (var declaredAttribute in symbol.GetAttributes()) 133foreach (var declaredAttribute in symbol.GetAttributes())
Microsoft.AspNetCore.Mvc.Api.Analyzers (3)
ActualApiResponseMetadataFactory.cs (1)
280var attributes = symbol.GetAttributes();
src\Shared\Roslyn\CodeAnalysisExtensions.cs (2)
23foreach (var declaredAttribute in symbol.GetAttributes()) 133foreach (var declaredAttribute in symbol.GetAttributes())
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 (7)
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (2)
279var attributes = symbol.GetAttributes().Where(a => IsSuppressionAttribute(a)); 315var attributes = symbol.GetAttributes().Where(a => IsSuppressionAttribute(a));
SourceGeneration\GeneratedCodeUtilities.cs (1)
36foreach (var attribute in symbol.GetAttributes())
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithMetadataName.cs (3)
39/// To get the entire list of attributes, use <see cref="ISymbol.GetAttributes"/> on <see cref="TargetSymbol"/>. 145addMatchingAttributes(symbol.GetAttributes()); 151addMatchingAttributes(module.GetAttributes());
SymbolDisplay\AbstractSymbolDisplayVisitor.cs (1)
190foreach (var attribute in typeSymbol.GetAttributes())
Microsoft.CodeAnalysis.CodeStyle (8)
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
731foreach (var attribute in symbol.GetAttributes()) 888=> methodSymbol.GetAttributes().Any(static (a, self) => self._attributeSetForMethodsToIgnore.Contains(a.AttributeClass), this);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
241if (method.GetAttributes().Any(static (a, self) => a.AttributeClass is { } attributeClass && self._attributeSetForMethodsToIgnore.Contains(attributeClass), this))
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
36foreach (var attribute in symbol.GetAttributes())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (2)
806=> symbol.GetAttributes().Any(static x => x.AttributeClass is 817return symbol.GetAttributes().Any(static (attribute, attributeClass) => attributeClass.Equals(attribute.AttributeClass), attributeClass);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (2)
711foreach (var attributeData in type.ContainingAssembly.GetAttributes()) 764namedType.OriginalDefinition.GetAttributes().Any(static a => a.AttributeClass?.SpecialType == SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute);
Microsoft.CodeAnalysis.CodeStyle.Fixes (13)
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\GenerateDefaultConstructorsCodeAction.cs (1)
77parameter, parameter.GetAttributes().WhereAsArray(a => a.AttributeClass is null || a.AttributeClass.IsAccessibleWithin(classType)));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (1)
43foreach (var attribute in typeSymbol.GetAttributes())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
303attributes ?? parameter.GetAttributes(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\INamedTypeSymbolExtensions.cs (1)
21namedType.GetAttributes(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (5)
64method.GetAttributes(), 90method.GetAttributes(), 117typeParameter.GetAttributes(), 150var methodHasAttribute = method.GetAttributes().Any(shouldRemoveAttribute, arg); 166attributes: method.GetAttributes().WhereAsArray(static (a, arg) => !shouldRemoveAttribute(a, arg), arg),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IParameterSymbolExtensions.cs (2)
27parameter.GetAttributes(), 39return parameter.GetAttributes() == attributes
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IPropertySymbolExtensions.cs (2)
27property.GetAttributes(), 53property.GetAttributes(),
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (2)
337if (namedType.GetAttributes().Any(a => a.AttributeClass.IsCollectionBuilderAttribute())) 893.GetAttributes()
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
532!member.GetAttributes().Any() &&
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (13)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ConstructorGenerator.cs (1)
57attributeLists: AttributeGenerator.GenerateAttributeLists(constructor.GetAttributes(), info),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ConversionGenerator.cs (1)
67attributeLists: AttributeGenerator.GenerateAttributeLists(method.GetAttributes(), info),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\DestructorGenerator.cs (1)
53attributeLists: AttributeGenerator.GenerateAttributeLists(destructor.GetAttributes(), info),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EventGenerator.cs (2)
120AttributeGenerator.GenerateAttributeLists(@event.GetAttributes(), info), 150var attributes = @event.GetAttributes();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (1)
101AttributeGenerator.GenerateAttributeLists(field.GetAttributes(), info),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (2)
144=> parameter.WithAttributes(parameter.GetAttributes().WhereAsArray(static (a, destination) => FilterAttribute(a, destination), destination)); 229attributes.AddRange(AttributeGenerator.GenerateAttributeLists(method.GetAttributes(), info));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
263return AttributeGenerator.GenerateAttributeLists(namedType.GetAttributes(), info);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\OperatorGenerator.cs (1)
94attributeLists: AttributeGenerator.GenerateAttributeLists(method.GetAttributes(), info),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ParameterGenerator.cs (1)
122var attributes = parameter.GetAttributes();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (1)
149var attributes = property.GetAttributes();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\TypeParameterGenerator.cs (1)
34AttributeGenerator.GenerateAttributeLists(symbol.GetAttributes(), info),
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
Emit\InAttributeModifierTests.cs (1)
51Assert.Empty(m.Parameters[0].GetAttributes());
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (39)
Attributes\AttributeTests.cs (8)
711var attrs = m0.GetAttributes(); 1427var attrs = compilation.Assembly.GetAttributes(); 4899var ca = goo.GetAttributes().First().CommonConstructorArguments.First(); 5721var args = info.Symbol.GetAttributes()[0].CommonConstructorArguments; 8680Assert.Equal(0, assembly.GetAttributes().Length); 8723Assert.Equal(0, assembly.GetAttributes().Length); 8770Assert.Equal(0, assembly.GetAttributes().Length); 8855Assert.Equal(0, type.GetAttributes()[0].ConstructorArguments.Count());
Attributes\AttributeTests_Assembly.cs (12)
871var attrs = comp.Assembly.GetAttributes(); 894var attrs = comp.Assembly.GetAttributes(); 1022.GetAttributes() 1083var attrs = consoleappCompilation.Assembly.GetAttributes(); 1126Assert.Equal(0, consoleappCompilation.Assembly.GetAttributes().Length); 1204var attrs = consoleappCompilation.Assembly.GetAttributes(); 1241Assert.Equal(0, consoleappCompilation.Assembly.GetAttributes().Length); 1284var attrs = consoleappCompilation.Assembly.GetAttributes(); 1377var attrs = consoleappCompilation.Assembly.GetAttributes(); 1425var attrs = compilation.Assembly.GetAttributes(); 1436attrs = compilation.Assembly.GetAttributes(); 1444attrs = compilation.Assembly.GetAttributes();
Attributes\AttributeTests_CallerInfoAttributes.cs (1)
2299var arguments = compilation.GetTypeByMetadataName("Program").GetAttributes().Single().CommonConstructorArguments;
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();
Semantics\PrimaryConstructorTests.cs (10)
3250Assert.Empty(c.GetAttributes()); 3251Assert.True(c.Constructors.All(ctor => ctor.GetAttributes().IsEmpty)); 3380Assert.Equal("A", c.GetAttributes().Single().ToString()); 3381Assert.True(c.Constructors.All(ctor => ctor.GetAttributes().IsEmpty)); 3401Assert.Equal("A", c.GetAttributes().Single().ToString()); 3402Assert.True(c.Constructors.All(ctor => ctor.GetAttributes().IsEmpty)); 20620Assert.Equal(1, primaryConstructor.GetAttributes().Length); 20654Assert.Equal(1, primaryConstructor1.GetAttributes().Length); 20698Assert.Equal(1, primaryConstructor1.GetAttributes().Length); 20795Assert.Equal(0, primaryConstructor1.GetAttributes().Length);
Microsoft.CodeAnalysis.CSharp.Features (4)
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
96field.GetAttributes(),
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (2)
337if (namedType.GetAttributes().Any(a => a.AttributeClass.IsCollectionBuilderAttribute())) 893.GetAttributes()
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
532!member.GetAttributes().Any() &&
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (13)
Semantics\LambdaDiscardParametersTests.cs (1)
395static ImmutableArray<string> getParameterAttributes(IParameterSymbol parameter) => parameter.GetAttributes().SelectAsArray(a => a.ToString());
Semantics\LambdaTests.cs (5)
3639return format(expr, method.GetAttributes(), method.GetReturnTypeAttributes(), method.Parameters.SelectMany(p => p.GetAttributes())); 3897verifyAttributes(symbol.GetAttributes(), "PropAttribute", "ReturnAttribute", "MethodAttribute"); 3899verifyAttributes(symbol.Parameters[0].GetAttributes(), "ParamAttribute", "TypeParamAttribute"); 4095Assert.Equal("System.ObsoleteAttribute", symbol.GetAttributes().Single().ToString());
Semantics\LocalFunctionTests.cs (5)
506var attributes = symbol.GetAttributes().As<CSharpAttributeData>(); 554var attributes = symbol.GetAttributes(); 824var attributes = symbol.GetAttributes(); 856var attrs = paramSymbol.GetAttributes(); 974var attributes = symbol.GetAttributes();
Semantics\NullableReferenceTypesTests.cs (2)
6468var attribute = c.GetAttributes().Single(); 6490var attribute = c.GetAttributes().Single();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Compilation\SemanticModelAPITests.cs (1)
4453var attribute = method.GetAttributes().Single();
Symbols\Metadata\PE\LoadingAttributes.cs (1)
1514Assert.Equal(expected, c.GetTypeByMetadataName("Test").GetAttributes().Single().ToString());
Symbols\Retargeting\RetargetCustomAttributes.cs (2)
350var a = c1.GetAttributes().Single(); 392var a = c1.GetAttributes().Single();
Microsoft.CodeAnalysis.CSharp.Workspaces (13)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ConstructorGenerator.cs (1)
57attributeLists: AttributeGenerator.GenerateAttributeLists(constructor.GetAttributes(), info),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ConversionGenerator.cs (1)
67attributeLists: AttributeGenerator.GenerateAttributeLists(method.GetAttributes(), info),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\DestructorGenerator.cs (1)
53attributeLists: AttributeGenerator.GenerateAttributeLists(destructor.GetAttributes(), info),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EventGenerator.cs (2)
120AttributeGenerator.GenerateAttributeLists(@event.GetAttributes(), info), 150var attributes = @event.GetAttributes();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (1)
101AttributeGenerator.GenerateAttributeLists(field.GetAttributes(), info),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (2)
144=> parameter.WithAttributes(parameter.GetAttributes().WhereAsArray(static (a, destination) => FilterAttribute(a, destination), destination)); 229attributes.AddRange(AttributeGenerator.GenerateAttributeLists(method.GetAttributes(), info));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
263return AttributeGenerator.GenerateAttributeLists(namedType.GetAttributes(), info);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\OperatorGenerator.cs (1)
94attributeLists: AttributeGenerator.GenerateAttributeLists(method.GetAttributes(), info),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ParameterGenerator.cs (1)
122var attributes = parameter.GetAttributes();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (1)
149var attributes = property.GetAttributes();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\TypeParameterGenerator.cs (1)
34AttributeGenerator.GenerateAttributeLists(symbol.GetAttributes(), info),
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (2)
234return typeC.GetAttributes().First(); 4967var attribute = symbol.GetAttributes().Single();
Microsoft.CodeAnalysis.EditorFeatures (1)
Navigation\AbstractDefinitionLocationService.cs (1)
178var attributes = method.GetAttributes();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
CodeGeneration\CodeGenerationTests.cs (1)
555var attribute = attributeTarget.GetAttributes().Single(attr => Equals(attr.AttributeClass, attributeType));
Microsoft.CodeAnalysis.Features (11)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
109=> typeSymbol.GetAttributes()
DesignerAttribute\DesignerAttributeDiscoveryService.cs (1)
320var attribute = type.GetAttributes().FirstOrDefault(d => IsDesignerAttribute(d.AttributeClass));
EmbeddedLanguages\EmbeddedLanguageDetector.cs (1)
448foreach (var attribute in symbol.GetAttributes())
ExtractInterface\AbstractExtractInterfaceService.cs (1)
406? CodeGenerationSymbolFactory.CreateAccessorSymbol(property.GetMethod, property.GetMethod.GetAttributes())
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
87=> _symbol.GetAttributes();
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (1)
90useDecompiler = !symbol.ContainingAssembly.GetAttributes().Any(static attribute => attribute.AttributeClass?.Name == nameof(SuppressIldasmAttribute)
MetadataAsSource\MetadataAsSourceHelpers.cs (1)
107foreach (var attribute in assemblySymbol.GetAttributes())
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
731foreach (var attribute in symbol.GetAttributes()) 888=> methodSymbol.GetAttributes().Any(static (a, self) => self._attributeSetForMethodsToIgnore.Contains(a.AttributeClass), this);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
241if (method.GetAttributes().Any(static (a, self) => a.AttributeClass is { } attributeClass && self._attributeSetForMethodsToIgnore.Contains(attributeClass), this))
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\GenerateDefaultConstructorsCodeAction.cs (1)
77parameter, parameter.GetAttributes().WhereAsArray(a => a.AttributeClass is null || a.AttributeClass.IsAccessibleWithin(classType)));
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Symbol.vb (1)
1347Private Function ISymbol_GetAttributes() As ImmutableArray(Of AttributeData) Implements ISymbol.GetAttributes
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (13)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ConstructorGenerator.vb (1)
40.WithAttributeLists(AttributeGenerator.GenerateAttributeBlocks(constructor.GetAttributes(), options)) _
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ConversionGenerator.vb (1)
51AttributeGenerator.GenerateAttributeBlocks(method.GetAttributes(), options),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EventGenerator.vb (4)
124result.WithAttributeLists(GenerateAttributeBlocks([event].GetAttributes(), options)), 146attributeLists:=GenerateAttributeBlocks([event].GetAttributes(), options), 155attributeLists:=GenerateAttributeBlocks([event].GetAttributes(), options), 194Return CodeGenerationSymbolFactory.CreateParameterSymbol(parameter.GetAttributes(), parameter.RefKind, isParams:=False, type:=parameter.Type, name:=parameter.Name, hasDefaultValue:=False)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\FieldGenerator.vb (1)
83AttributeGenerator.GenerateAttributeBlocks(field.GetAttributes(), options),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\MethodGenerator.vb (1)
79WithAttributeLists(AttributeGenerator.GenerateAttributeBlocks(method.GetAttributes(), options)).
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (1)
161Return AttributeGenerator.GenerateAttributeBlocks(namedType.GetAttributes(), options)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\OperatorGenerator.vb (1)
46AttributeGenerator.GenerateAttributeBlocks(method.GetAttributes(), options),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ParameterGenerator.vb (2)
54GenerateAttributeBlocks(parameter.GetAttributes(), options), 66GenerateAttributeBlocks(parameter.GetAttributes(), options),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\PropertyGenerator.vb (1)
70WithAttributeLists(AttributeGenerator.GenerateAttributeBlocks([property].GetAttributes(), options)).
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
Utilities\NamedTypeSymbolExtensions.vb (1)
21If Not type.GetAttributes().Where(Function(a) Equals(a.AttributeClass, designerGeneratedAttribute)).Any() Then
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (13)
Attributes\AssemblyAttributes.vb (9)
1310Dim attrs = consoleappCompilation.Assembly.GetAttributes() 1344Assert.Equal(0, consoleappCompilation.Assembly.GetAttributes().Length) 1427Dim attrs = consoleappCompilation.Assembly.GetAttributes() 1455Assert.Equal(0, consoleappCompilation.Assembly.GetAttributes().Length) 1501Dim attrs = consoleappCompilation.Assembly.GetAttributes() 1599Dim attrs = consoleappCompilation.Assembly.GetAttributes() 1634Dim attrs = comp.Assembly.GetAttributes() 1643attrs = comp.Assembly.GetAttributes() 1651attrs = comp.Assembly.GetAttributes()
Attributes\AttributeTests.vb (1)
1901Dim ca = goo.GetAttributes().First().CommonConstructorArguments.First()
Attributes\AttributeTests_WellKnownAttributes.vb (3)
724AssertEx.SetEqual({"System.SerializableAttribute", "BobAttribute"}, typeC.GetAttributes().Select(Function(a) a.ToString())) 738AssertEx.SetEqual({"System.SerializableAttribute", "BobAttribute"}, typeC1.GetAttributes().Select(Function(a) a.ToString())) 747AssertEx.SetEqual({"BobAttribute"}, typeC2.GetAttributes().Select(Function(a) a.ToString()))
Microsoft.CodeAnalysis.VisualBasic.Features (2)
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (2)
292eventType.GetAttributes(), eventType.DeclaredAccessibility, 298boundEvent.GetAttributes(), boundEvent.DeclaredAccessibility,
Microsoft.CodeAnalysis.VisualBasic.Workspaces (13)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ConstructorGenerator.vb (1)
40.WithAttributeLists(AttributeGenerator.GenerateAttributeBlocks(constructor.GetAttributes(), options)) _
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ConversionGenerator.vb (1)
51AttributeGenerator.GenerateAttributeBlocks(method.GetAttributes(), options),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EventGenerator.vb (4)
124result.WithAttributeLists(GenerateAttributeBlocks([event].GetAttributes(), options)), 146attributeLists:=GenerateAttributeBlocks([event].GetAttributes(), options), 155attributeLists:=GenerateAttributeBlocks([event].GetAttributes(), options), 194Return CodeGenerationSymbolFactory.CreateParameterSymbol(parameter.GetAttributes(), parameter.RefKind, isParams:=False, type:=parameter.Type, name:=parameter.Name, hasDefaultValue:=False)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\FieldGenerator.vb (1)
83AttributeGenerator.GenerateAttributeBlocks(field.GetAttributes(), options),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\MethodGenerator.vb (1)
79WithAttributeLists(AttributeGenerator.GenerateAttributeBlocks(method.GetAttributes(), options)).
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (1)
161Return AttributeGenerator.GenerateAttributeBlocks(namedType.GetAttributes(), options)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\OperatorGenerator.vb (1)
46AttributeGenerator.GenerateAttributeBlocks(method.GetAttributes(), options),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ParameterGenerator.vb (2)
54GenerateAttributeBlocks(parameter.GetAttributes(), options), 66GenerateAttributeBlocks(parameter.GetAttributes(), options),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\PropertyGenerator.vb (1)
70WithAttributeLists(AttributeGenerator.GenerateAttributeBlocks([property].GetAttributes(), options)).
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
CodeGeneration\SyntaxGeneratorTests.vb (1)
213Return typeC.GetAttributes().First()
Microsoft.CodeAnalysis.Workspaces (25)
FindSymbols\FindReferences\DependentProjectsFinder.cs (1)
287foreach (var attr in assembly.GetAttributes().Where(IsInternalsVisibleToAttribute))
Shared\Extensions\ISymbolExtensions.cs (2)
91var attributes = symbol.GetAttributes(); 114attributes = attributes.IsDefault ? symbol.GetAttributes() : attributes;
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
36foreach (var attribute in symbol.GetAttributes())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (2)
806=> symbol.GetAttributes().Any(static x => x.AttributeClass is 817return symbol.GetAttributes().Any(static (attribute, attributeClass) => attributeClass.Equals(attribute.AttributeClass), attributeClass);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (2)
711foreach (var attributeData in type.ContainingAssembly.GetAttributes()) 764namedType.OriginalDefinition.GetAttributes().Any(static a => a.AttributeClass?.SpecialType == SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (1)
43foreach (var attribute in typeSymbol.GetAttributes())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
303attributes ?? parameter.GetAttributes(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\INamedTypeSymbolExtensions.cs (1)
21namedType.GetAttributes(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (8)
64method.GetAttributes(), 73CodeGenerationSymbolFactory.CreateParameterSymbol(p.GetAttributes(), p.RefKind, p.IsParams, p.Type.SubstituteTypes(mapping, typeGenerator), p.Name, p.IsOptional, 90method.GetAttributes(), 117typeParameter.GetAttributes(), 150var methodHasAttribute = method.GetAttributes().Any(shouldRemoveAttribute, arg); 153.Any(static (m, arg) => m.GetAttributes().Any(shouldRemoveAttribute, arg), arg); 166attributes: method.GetAttributes().WhereAsArray(static (a, arg) => !shouldRemoveAttribute(a, arg), arg), 169p.GetAttributes().WhereAsArray(static (a, arg) => !shouldRemoveAttribute(a, arg), arg),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IParameterSymbolExtensions.cs (2)
27parameter.GetAttributes(), 39return parameter.GetAttributes() == attributes
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IPropertySymbolExtensions.cs (4)
27property.GetAttributes(), 47.Any(static (p, arg) => p.GetAttributes().Any(ShouldRemoveAttribute, arg), arg); 53property.GetAttributes(), 62p.GetAttributes().WhereAsArray(static (a, arg) => !ShouldRemoveAttribute(a, arg), arg),
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (4)
VisualStudioMSBuildWorkspaceTests.cs (4)
1905var attrs = sym.GetAttributes(); 1928var attrs = sym.GetAttributes(); 1952var attrs = sym.GetAttributes(); 1975var attrs = sym.GetAttributes();
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
120ImmutableArray<AttributeData> boundAttributes = logMethodSymbol.GetAttributes();
Microsoft.Extensions.Options.SourceGeneration (2)
Parser.cs (1)
350foreach (var attribute in member.GetAttributes().Where(a => a.AttributeClass is not null))
ParserUtilities.cs (1)
21var attrs = symbol.GetAttributes();
Microsoft.Gen.ComplianceReports (7)
Parser.cs (7)
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())
Microsoft.Gen.ContextualOptions (2)
ContextReceiver.cs (1)
49.Where(_ => _.symbol!.GetAttributes().Any(attribute => SymbolEqualityComparer.Default.Equals(attribute.AttributeClass, holder!.OptionsContextAttribute)))
ContextualOptionsGenerator.cs (1)
41.Where(_ => _.symbol!.GetAttributes().Any(attribute => SymbolEqualityComparer.Default.Equals(attribute.AttributeClass, holder!.OptionsContextAttribute)))
Microsoft.Gen.Logging (2)
Parsing\Parser.cs (1)
472.GetAttributes()
src\Generators\Shared\ParserUtilities.cs (1)
26var attrs = symbol.GetAttributes();
Microsoft.Gen.Logging.Unit.Tests (1)
LogParserUtilitiesTests.cs (1)
90.Setup(x => x.GetAttributes())
Microsoft.Gen.Metrics (2)
Parser.cs (1)
91foreach (var methodAttribute in methodSymbol.GetAttributes())
src\Generators\Shared\ParserUtilities.cs (1)
26var attrs = symbol.GetAttributes();
Microsoft.Gen.MetricsReports (2)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
91foreach (var methodAttribute in methodSymbol.GetAttributes())
src\Generators\Shared\ParserUtilities.cs (1)
26var attrs = symbol.GetAttributes();
Microsoft.Interop.ComInterfaceGenerator (23)
Analyzers\AddGeneratedComClassAnalyzer.cs (3)
36if (type.GetAttributes().Any(attr => generatedComClassAttributeType.Equals(attr.AttributeClass, SymbolEqualityComparer.Default))) 49if (iface.GetAttributes().Any(attr => generatedComInterfaceAttributeType.Equals(attr.AttributeClass, SymbolEqualityComparer.Default))) 57&& type.BaseType.GetAttributes().Any(attr => generatedComClassAttributeType.Equals(attr.AttributeClass, SymbolEqualityComparer.Default)))
Analyzers\ComHostingDoesNotSupportGeneratedComInterfaceAnalyzer.cs (2)
53if (containingType.GetAttributes().Any(attr => generatedComClassAttribute.Equals(attr.AttributeClass, SymbolEqualityComparer.Default))) 61if (iface.GetAttributes().Any(attr => generatedComInterfaceAttribute.Equals(attr.AttributeClass, SymbolEqualityComparer.Default)))
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (2)
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);
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (1)
99var comImportAttribute = await declaringType.GetAttributes().First(attr => attr.AttributeClass.Equals(comImportAttributeType, SymbolEqualityComparer.Default)).ApplicationSyntaxReference.GetSyntaxAsync(ct).ConfigureAwait(false);
Analyzers\GeneratedComInterfaceAttributeAnalyzer.cs (2)
35ImmutableArray<AttributeData> customAttributes = typeSymbol.GetAttributes(); 78foreach (AttributeData attr in symbol.GetAttributes())
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (2)
37sourceGeneratedComRecognizers.Add(type => type.GetAttributes().Any(attr => generatedComClassAttribute.Equals(attr.AttributeClass, SymbolEqualityComparer.Default))); 41sourceGeneratedComRecognizers.Add(type => type.GetAttributes().Any(attr => generatedComInterfaceAttribute.Equals(attr.AttributeClass, SymbolEqualityComparer.Default)));
ComClassInfo.cs (1)
45AttributeData? generatedComInterfaceAttribute = iface.GetAttributes().FirstOrDefault(attr => attr.AttributeClass?.ToDisplayString() == TypeNames.GeneratedComInterfaceAttribute);
ComInterfaceGenerator.cs (1)
246foreach (AttributeData attr in symbol.GetAttributes())
ComInterfaceInfo.cs (2)
297foreach (var attr in implemented.GetAttributes()) 331foreach (var attr in interfaceSymbol.GetAttributes())
ComMethodInfo.cs (2)
97new ComMethodInfo(null!, method.Name, method.GetAttributes().Select(AttributeInfo.From).ToImmutableArray().ToSequenceEqual(), false), 144var attributes = method.GetAttributes();
GeneratedComInterfaceAttributeData.cs (1)
42foreach (var attr in interfaceSymbol.GetAttributes())
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
245&& !parameter.GetAttributes().Any(attr => attr.AttributeClass?.ToDisplayString() == TypeNames.System_Runtime_InteropServices_MarshalAsAttribute))
VtableIndexStubGenerator.cs (3)
210foreach (AttributeData attr in symbol.GetAttributes()) 300var unmanagedObjectUnwrapper = symbol.ContainingType.GetAttributes().FirstOrDefault(att => att.AttributeClass.IsOfType(TypeNames.UnmanagedObjectUnwrapperAttribute)); 419if (!method.ContainingType.GetAttributes().Any(att => att.AttributeClass.IsOfType(TypeNames.UnmanagedObjectUnwrapperAttribute)))
Microsoft.Interop.JavaScript.JSImportGenerator (2)
JSExportGenerator.cs (1)
178foreach (AttributeData attr in symbol.GetAttributes())
JSImportGenerator.cs (1)
158foreach (AttributeData attr in symbol.GetAttributes())
Microsoft.Interop.LibraryImportGenerator (9)
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 (1)
662foreach (AttributeData attrLocal in method.GetAttributes())
Analyzers\CustomMarshallerAttributeFixer.cs (1)
182=> (ITypeSymbol)attributedTypeSymbol.GetAttributes().First(attr =>
Analyzers\ShapeBreakingDiagnosticSuppressor.cs (1)
60AttributeData? attrData = containingType.GetAttributes().FirstOrDefault(
LibraryImportGenerator.cs (1)
238foreach (AttributeData attr in symbol.GetAttributes())
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
245&& !parameter.GetAttributes().Any(attr => attr.AttributeClass?.ToDisplayString() == TypeNames.System_Runtime_InteropServices_MarshalAsAttribute))
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
DownlevelLibraryImportGenerator.cs (1)
173foreach (AttributeData attr in symbol.GetAttributes())
Microsoft.Interop.SourceGeneration (14)
CompilationExtensions.cs (2)
17if (compilation.SourceModule.GetAttributes().Any(attr => attr.AttributeClass.ToDisplayString() == TypeNames.System_Runtime_CompilerServices_SkipLocalsInitAttribute)) 21if (compilation.SourceModule.GetAttributes().Any(attr => attr.AttributeClass.ToDisplayString() == TypeNames.System_Runtime_CompilerServices_DisableRuntimeMarshallingAttribute))
ManualTypeMarshallingHelper.cs (3)
86&& entryPointType.GetAttributes().Any(attr => attr.AttributeClass.ToDisplayString() == TypeNames.ContiguousCollectionMarshallerAttribute); 91return entryPointType.GetAttributes().Any(attr => attr.AttributeClass.ToDisplayString() == TypeNames.CustomMarshallerAttribute); 155var attrs = entryPointType.GetAttributes().Where(attr => attr.AttributeClass.ToDisplayString() == TypeNames.CustomMarshallerAttribute).ToArray();
MarshallingInfoParser.cs (1)
242foreach (AttributeData typeAttribute in type.GetAttributes())
MethodSignatureElementInfoProvider.cs (2)
49marshallingInfoCallback(param.Type, new UseSiteAttributeProvider(_useSiteAttributeParsers, param.GetAttributes(), rootProvider, _generatorDiagnostics, marshallingInfoCallback), 0), _compilation) with 71marshallingInfoCallback(param.Type, new UseSiteAttributeProvider(_useSiteAttributeParsers, param.GetAttributes(), rootProvider, _generatorDiagnostics, marshallingInfoCallback), 0), _compilation) with
SignatureContext.cs (3)
112MarshallingInfo marshallingInfo = marshallingInfoParser.ParseMarshallingInfo(param.Type, param.GetAttributes()); 156if (method.GetAttributes().Any(IsSkipLocalsInitAttribute)) 163if (type.GetAttributes().Any(IsSkipLocalsInitAttribute))
TypePositionInfo.cs (1)
90var (byValueContentsMarshalKind, inLocation, outLocation) = GetByValueContentsMarshalKind(paramSymbol.GetAttributes(), compilation);
TypeSymbolExtensions.cs (2)
120foreach (AttributeData attr in type.GetAttributes()) 137foreach (AttributeData attr in type.GetAttributes())
Microsoft.Maui.Controls.BindingSourceGen (1)
ISymbolExtensions.cs (1)
53 return symbol.GetAttributes().FirstOrDefault(attr => attr.AttributeClass?.Name == attributeName);
Microsoft.Maui.Controls.SourceGen (1)
CodeBehindGenerator.cs (1)
212 foreach (var attr in symbol.GetAttributes())
Microsoft.ML.InternalCodeAnalyzer (6)
BestFriendAnalyzer.cs (2)
99assemblyWantsBestFriends = symbolAssembly.GetAttributes().Any(a => Equals(a.AttributeClass, wantsToBeBestFriendsAttributeType)); 104if (symbol.GetAttributes().Any(a => Equals(a.AttributeClass, bestFriendAttributeType)))
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())
InstanceInitializerAnalyzer.cs (1)
49if (symbol.GetAttributes().Any(i => i.AttributeClass.Name == "ArgumentAttribute"))
Mvc.Api.Analyzers.Test (3)
ActualApiResponseMetadataFactoryTest.cs (2)
28var attribute = compilation.GetTypeByMetadataName(typeof(TestActionResultUsingStatusCodesConstants).FullName).GetAttributes()[0]; 42var attribute = compilation.GetTypeByMetadataName(typeof(TestActionResultUsingHttpStatusCodeCast).FullName).GetAttributes()[0];
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 (4)
Helpers\RoslynExtensions.cs (2)
120=> attributeType != null && memberInfo.GetAttributes().Any(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, attributeType)); 379return symbol.GetAttributes().Any(attr =>
JsonSourceGenerator.Parser.cs (2)
240foreach (AttributeData attributeData in contextClassSymbol.GetAttributes()) 1254foreach (AttributeData attributeData in memberInfo.GetAttributes())
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationAnalyzer.cs (1)
48if (propertySymbol.GetAttributes()
System.Windows.Forms.Analyzers.VisualBasic (1)
Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationDiagnosticAnalyzer.vb (1)
51If propertySymbol.GetAttributes().Any(
System.Windows.Forms.PrivateSourceGenerators (1)
System\Windows\Forms\SourceGenerators\EnumValidationGenerator.cs (1)
226bool isFlags = enumType.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, flagsAttributeType));