64 references to AttributeConstructor
Microsoft.Analyzers.Extra (5)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (5)
201methodAttr.AttributeConstructor is not null) 203var argLevel = GetLogMethodAttributeParameter(methodAttr.AttributeConstructor.Parameters, methodAttr.ConstructorArguments, "level"); 211var argMessage = GetLogMethodAttributeParameter(methodAttr.AttributeConstructor.Parameters, methodAttr.ConstructorArguments, "message"); 640methodAttr.AttributeConstructor is not null) 642var arg = GetLogMethodAttributeParameter(methodAttr.AttributeConstructor.Parameters, methodAttr.ConstructorArguments, "eventId");
Microsoft.AspNetCore.Mvc.Analyzers (1)
TopLevelParameterNameAnalyzer.cs (1)
195var constructorParameters = attribute.AttributeConstructor?.Parameters ?? ImmutableArray<IParameterSymbol>.Empty;
Microsoft.AspNetCore.Mvc.Api.Analyzers (2)
SymbolApiResponseMetadataProvider.cs (2)
202if (attribute.AttributeConstructor == null) 207var constructorParameters = attribute.AttributeConstructor.Parameters;
Microsoft.CodeAnalysis (10)
SymbolDisplay\AbstractSymbolDisplayVisitor.cs (1)
192var ctor = attribute.AttributeConstructor;
Symbols\Attributes\CommonAttributeData.cs (4)
203Debug.Assert(AttributeConstructor is object); 204var parameters = AttributeConstructor.Parameters; 412Debug.Assert(attribute.AttributeConstructor is object); 413if (attribute.AttributeConstructor.Parameters[0].Type.SpecialType == SpecialType.System_Int16)
Symbols\Attributes\CommonAttributeDataComparer.cs (4)
31attr1.AttributeConstructor == attr2.AttributeConstructor && 43hash = attr.AttributeConstructor != null ? Hash.Combine(attr.AttributeConstructor.GetHashCode(), hash) : hash;
Symbols\Attributes\MarshalAsAttributeDecoder.cs (1)
102if (attribute.AttributeConstructor.Parameters[0].Type.SpecialType == SpecialType.System_Int16)
Microsoft.CodeAnalysis.CodeStyle (3)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (3)
832attribute.AttributeConstructor?.Parameters is [_, { Name: "checkId", Type.SpecialType: SpecialType.System_String }, ..] && 840if (attribute.AttributeConstructor.Parameters[0].Name == "category" && 841attribute.AttributeConstructor.Parameters[0].Type.SpecialType == SpecialType.System_String &&
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (1)
43var ctor = attribute.AttributeConstructor;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (9)
Attributes\AttributeTests.cs (2)
652Assert.Equal("AAttribute..ctor(params System.Int32[] args)", attributeData.AttributeConstructor.ToTestDisplayString()); 653Assert.Equal(1, attributeData.AttributeConstructor.ParameterCount);
Attributes\AttributeTests_Dynamic.cs (2)
533Assert.Empty(dynamicAttribute.AttributeConstructor.Parameters); 538Assert.Equal("System.Boolean[]", dynamicAttribute.AttributeConstructor.Parameters.Single().TypeWithAnnotations.ToTestDisplayString());
Attributes\AttributeTests_Synthesized.cs (3)
65Assert.Equal("System.Int32", attribute.AttributeConstructor.Parameters.Single().TypeWithAnnotations.ToTestDisplayString()); 76Assert.Empty(attribute.AttributeConstructor.Parameters); 93Assert.Equal("System.Diagnostics.DebuggableAttribute.DebuggingModes", attribute.AttributeConstructor.Parameters.Single().TypeWithAnnotations.ToTestDisplayString());
Attributes\AttributeTests_Tuples.cs (1)
629Assert.Equal("System.String[]", tupleAttr.AttributeConstructor.Parameters.Single().TypeWithAnnotations.ToTestDisplayString());
OverloadResolutionPriorityTests.cs (1)
907AssertEx.Equal("C..ctor(System.Object o)", attr.AttributeConstructor.ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\LocalFunctionTests.cs (2)
558Assert.Equal(aAttribute.InstanceConstructors.Single(), attributeData.AttributeConstructor.GetSymbol()); 822Assert.Equal(aAttribute.InstanceConstructors.Single(), attributeData.AttributeConstructor.GetSymbol());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (9)
Symbols\Metadata\PE\LoadingAttributes.cs (3)
1061where a.AttributeConstructor.Equals((MethodSymbol)mctors[4]) 1131where a.AttributeConstructor.Equals((MethodSymbol)mctors[2]) 1142where a.AttributeConstructor.Equals((MethodSymbol)mctors[3])
Symbols\Retargeting\RetargetCustomAttributes.cs (6)
134TestAttributeRetargeting(symbol.GetReturnTypeAttributes().Where(a => a.AttributeConstructor == newMsCorLib_debuggerTypeProxyAttributeCtor)); 137Assert.Empty(symbol.GetReturnTypeAttributes().Where(a => a.AttributeConstructor == oldMsCorLib_debuggerTypeProxyAttributeCtor)); 148Assert.Same(newMsCorLib_debuggerTypeProxyAttributeCtor, attribute.AttributeConstructor); 149Assert.Same(newMsCorLib_systemType, attribute.AttributeConstructor.GetParameterType(0)); 353Assert.Null(a.AttributeConstructor); 395Assert.Null(a.AttributeConstructor);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
Extensions.cs (2)
392where a.AttributeConstructor.Equals(m) 399where a.AttributeConstructor.Equals(m)
TestAttributesVisitor.cs (2)
210Assert.NotNull(attribute.AttributeConstructor); 211var containingType = attribute.AttributeConstructor!.ContainingType;
Microsoft.CodeAnalysis.Features (3)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (3)
832attribute.AttributeConstructor?.Parameters is [_, { Name: "checkId", Type.SpecialType: SpecialType.System_String }, ..] && 840if (attribute.AttributeConstructor.Parameters[0].Name == "category" && 841attribute.AttributeConstructor.Parameters[0].Type.SpecialType == SpecialType.System_String &&
Microsoft.CodeAnalysis.Workspaces (4)
Shared\Extensions\ISymbolExtensions.cs (2)
135if (Equals(attribute.AttributeConstructor, constructor) && 190if (Equals(attribute.AttributeConstructor, constructor))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (1)
43var ctor = attribute.AttributeConstructor;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
171=> GetAttributes().WhereAsArray(a => a.AttributeConstructor.Equals(attributeConstructor));
Microsoft.Extensions.Options.SourceGeneration (4)
Parser.cs (3)
501ImmutableArray<IParameterSymbol> parameters = attribute.AttributeConstructor?.Parameters ?? ImmutableArray<IParameterSymbol>.Empty; 621ImmutableArray<IParameterSymbol> constructorParameters = attribute.AttributeConstructor?.Parameters ?? ImmutableArray<IParameterSymbol>.Empty; 632ImmutableArray<IParameterSymbol> constructorParameters = attribute.AttributeConstructor?.Parameters ?? ImmutableArray<IParameterSymbol>.Empty;
ParserUtilities.cs (1)
24if (SymbolEqualityComparer.Default.Equals(attribute, item.AttributeClass) && item.AttributeConstructor != null)
Microsoft.Gen.Logging (1)
src\Generators\Shared\ParserUtilities.cs (1)
29if (SymbolEqualityComparer.Default.Equals(attribute, item.AttributeClass) && item.AttributeConstructor != null)
Microsoft.Gen.Metrics (1)
src\Generators\Shared\ParserUtilities.cs (1)
29if (SymbolEqualityComparer.Default.Equals(attribute, item.AttributeClass) && item.AttributeConstructor != null)
Microsoft.Gen.MetricsReports (1)
src\Generators\Shared\ParserUtilities.cs (1)
29if (SymbolEqualityComparer.Default.Equals(attribute, item.AttributeClass) && item.AttributeConstructor != null)
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\ShapeBreakingDiagnosticSuppressor.cs (1)
62&& attr.AttributeConstructor is not null
Microsoft.Interop.SourceGeneration (3)
ManualTypeMarshallingHelper.cs (1)
167if (attr.AttributeConstructor is null)
MarshallingInfoParser.cs (1)
261if (attribute.AttributeConstructor is not null && parser.CanParseAttributeType(attribute.AttributeClass))
UseSiteAttributeProvider.cs (1)
64if (attribute.AttributeConstructor is not null && parser.CanParseAttributeType(attribute.AttributeClass))