1 instantiation of AttributeSyntax
Microsoft.CodeAnalysis.CSharp (1)
_generated\1\Syntax.xml.Internal.Generated.cs (1)
16061internal override SyntaxNode CreateRed(SyntaxNode? parent, int position) => new CSharp.Syntax.AttributeSyntax(this, parent, position);
437 references to AttributeSyntax
Microsoft.AspNetCore.App.Analyzers (5)
Mvc\MvcAnalyzer.cs (1)
177if (attribute.ApplicationSyntaxReference.GetSyntax(cancellationToken) is AttributeSyntax attributeSyntax &&
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (2)
297foreach (var attribute in attributeList.Attributes) 362foreach (var attribute in attributeList.Attributes)
RouteEmbeddedLanguage\Infrastructure\RouteStringSyntaxDetector.cs (1)
476if (argumentList.Parent is not AttributeSyntax invocableExpression)
RouteEmbeddedLanguage\Infrastructure\RouteUsageDetector.cs (1)
199if (argumentList.Parent is not AttributeSyntax attribute)
Microsoft.AspNetCore.Mvc.Api.Analyzers (4)
AddResponseTypeAttributeCodeFixAction.cs (4)
72AttributeSyntax attributeSyntax; 201private static AttributeSyntax CreateProducesResponseTypeAttribute(in CodeActionContext context, int statusCode, out bool addUsingDirective) 214private static AttributeSyntax CreateProducesResponseTypeAttribute(in CodeActionContext context, int statusCode, ITypeSymbol typeSymbol, out bool addUsingDirective) 246private static AttributeSyntax CreateProducesDefaultResponseTypeAttribute()
Microsoft.CodeAnalysis.CSharp (230)
_generated\0\Syntax.xml.Main.Generated.cs (9)
494public virtual TResult? VisitAttribute(AttributeSyntax node) => this.DefaultVisit(node); 1246public virtual void VisitAttribute(AttributeSyntax node) => this.DefaultVisit(node); 1997public override SyntaxNode? VisitAttribute(AttributeSyntax node) 4896public static AttributeListSyntax AttributeList(SyntaxToken openBracketToken, AttributeTargetSpecifierSyntax? target, SeparatedSyntaxList<AttributeSyntax> attributes, SyntaxToken closeBracketToken) 4904public static AttributeListSyntax AttributeList(AttributeTargetSpecifierSyntax? target, SeparatedSyntaxList<AttributeSyntax> attributes) 4908public static AttributeListSyntax AttributeList(SeparatedSyntaxList<AttributeSyntax> attributes = default) 4923public static AttributeSyntax Attribute(NameSyntax name, AttributeArgumentListSyntax? argumentList) 4926return (AttributeSyntax)Syntax.InternalSyntax.SyntaxFactory.Attribute((Syntax.InternalSyntax.NameSyntax)name.Green, argumentList == null ? null : (Syntax.InternalSyntax.AttributeArgumentListSyntax)argumentList.Green).CreateRed(); 4930public static AttributeSyntax Attribute(NameSyntax name)
_generated\2\Syntax.xml.Syntax.Generated.cs (10)
9829public SeparatedSyntaxList<AttributeSyntax> Attributes 9834return red != null ? new SeparatedSyntaxList<AttributeSyntax>(red, GetChildIndex(2)) : default; 9860public AttributeListSyntax Update(SyntaxToken openBracketToken, AttributeTargetSpecifierSyntax? target, SeparatedSyntaxList<AttributeSyntax> attributes, SyntaxToken closeBracketToken) 9874public AttributeListSyntax WithAttributes(SeparatedSyntaxList<AttributeSyntax> attributes) => Update(this.OpenBracketToken, this.Target, attributes, this.CloseBracketToken); 9877public AttributeListSyntax AddAttributes(params AttributeSyntax[] items) => WithAttributes(this.Attributes.AddRange(items)); 9965public AttributeSyntax Update(NameSyntax name, AttributeArgumentListSyntax? argumentList) 9969var newNode = SyntaxFactory.Attribute(name, argumentList); 9977public AttributeSyntax WithName(NameSyntax name) => Update(name, this.ArgumentList); 9978public AttributeSyntax WithArgumentList(AttributeArgumentListSyntax? argumentList) => Update(this.Name, argumentList); 9980public AttributeSyntax AddArgumentListArguments(params AttributeArgumentSyntax[] items)
Binder\Binder_Attributes.cs (18)
30ImmutableArray<Binder> binders, ImmutableArray<AttributeSyntax> attributesToBind, Symbol ownerSymbol, NamedTypeSymbol[] boundAttributeTypes, 31Action<AttributeSyntax>? beforeAttributePartBound, 32Action<AttributeSyntax>? afterAttributePartBound, 47AttributeSyntax attributeToBind = attributesToBind[i]; 73ImmutableArray<AttributeSyntax> attributesToBind, 77Action<AttributeSyntax>? beforeAttributePartBound, 78Action<AttributeSyntax>? afterAttributePartBound, 90AttributeSyntax attributeSyntax = attributesToBind[i]; 127AttributeSyntax node, NamedTypeSymbol boundAttributeType, 128Action<AttributeSyntax>? beforeAttributePartBound, 129Action<AttributeSyntax>? afterAttributePartBound, 138internal BoundAttribute BindAttribute(AttributeSyntax node, NamedTypeSymbol attributeType, Symbol? attributedMember, BindingDiagnosticBag diagnostics) 155private static BoundAttribute BindAttributeCore(Binder binder, AttributeSyntax node, NamedTypeSymbol attributeType, Symbol? attributedMember, BindingDiagnosticBag diagnostics) 298return new SourceAttributeData(Compilation, (AttributeSyntax)boundAttribute.Syntax, attributeType, attributeConstructor, hasErrors); 302ValidateTypeForAttributeParameters(attributeConstructor.Parameters, ((AttributeSyntax)boundAttribute.Syntax).Name, diagnostics, ref hasErrors); 323(AttributeSyntax)boundAttribute.Syntax, 337(AttributeSyntax)boundAttribute.Syntax, 707AttributeSyntax syntax,
Binder\Binder_Expressions.cs (1)
6371AttributeSyntax { Name: { } name } => name.Location,
Binder\Binder_Symbols.cs (1)
1014case AttributeSyntax parent when parent.Name == node: // [nint]
Binder\EarlyWellKnownAttributeBinder.cs (6)
27AttributeSyntax node, NamedTypeSymbol boundAttributeType, 28Action<AttributeSyntax> beforeAttributePartBound, 29Action<AttributeSyntax> afterAttributePartBound, 43AttributeSyntax node, NamedTypeSymbol boundAttributeType, 44Action<AttributeSyntax> beforeAttributePartBound, 45Action<AttributeSyntax> afterAttributePartBound,
Binder\ExpressionVariableFinder.cs (1)
167public override void VisitAttribute(AttributeSyntax node)
Binder\LocalBinderFactory.cs (1)
479public override void VisitAttribute(AttributeSyntax node)
Compilation\AttributeSemanticModel.cs (7)
22AttributeSyntax syntax, 39public static AttributeSemanticModel Create(PublicSemanticModel containingSemanticModel, AttributeSyntax syntax, NamedTypeSymbol attributeType, AliasSymbol aliasOpt, Symbol? attributeTarget, Binder rootBinder, ImmutableDictionary<Symbol, Symbol>? parentRemappedSymbolsOpt) 48public static SpeculativeSemanticModelWithMemberModel CreateSpeculative(SyntaxTreeSemanticModel parentSemanticModel, AttributeSyntax syntax, NamedTypeSymbol attributeType, AliasSymbol aliasOpt, Binder rootBinder, ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt, int position) 89var attribute = (AttributeSyntax)node; 120return IsNullableAnalysisEnabledIn(Compilation, (AttributeSyntax)Root); 123internal static bool IsNullableAnalysisEnabledIn(CSharpCompilation compilation, AttributeSyntax syntax)
Compilation\CSharpSemanticModel.cs (13)
126or AttributeSyntax 240private Binder GetSpeculativeBinderForAttribute(int position, AttributeSyntax attribute) 403private BoundAttribute GetSpeculativelyBoundAttribute(int position, AttributeSyntax attribute, out Binder binder) 688public SymbolInfo GetSymbolInfo(AttributeSyntax attributeSyntax, CancellationToken cancellationToken = default(CancellationToken)) 763public SymbolInfo GetSpeculativeSymbolInfo(int position, AttributeSyntax attribute) 1012public TypeInfo GetTypeInfo(AttributeSyntax attributeSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1114public ImmutableArray<ISymbol> GetMemberGroup(AttributeSyntax attribute, CancellationToken cancellationToken = default(CancellationToken)) 2771public bool TryGetSpeculativeSemanticModel(int position, AttributeSyntax attribute, out SemanticModel speculativeModel) 4001parentSyntax.Kind() == SyntaxKind.Attribute && ((AttributeSyntax)parentSyntax).Name == boundNode.Syntax) 5021case AttributeSyntax attribute: 5048case AttributeSyntax attribute: 5069case AttributeSyntax attribute: 5092case AttributeSyntax attribute:
Compilation\PublicSemanticModel.cs (1)
17protected AttributeSemanticModel CreateModelForAttribute(Binder enclosingBinder, AttributeSyntax attribute, MemberSemanticModel containingModel)
Compilation\SpeculativeSemanticModelWithMemberModel.cs (4)
44AttributeSyntax syntax, 164case AttributeSyntax attribute: 178private MemberSemanticModel GetOrAddModelForAttribute(MemberSemanticModel containing, AttributeSyntax attribute) 181(node, binderAndModel) => CreateModelForAttribute(binderAndModel.binder, (AttributeSyntax)node, binderAndModel.model),
Compilation\SyntaxTreeSemanticModel.cs (5)
760internal PublicSemanticModel CreateSpeculativeAttributeSemanticModel(int position, AttributeSyntax attribute, Binder binder, AliasSymbol aliasOpt, NamedTypeSymbol attributeType) 953return GetOrAddModelForAttribute((AttributeSyntax)memberDecl); 975private MemberSemanticModel GetOrAddModelForAttribute(AttributeSyntax attribute) 985(node, binderAndModel) => CreateModelForAttribute(binderAndModel.binder, (AttributeSyntax)node, binderAndModel.model), 1236return CreateModelForAttribute(defaultOuter(), (AttributeSyntax)node, containingModel: null);
CSharpExtensions.cs (5)
561public static SymbolInfo GetSymbolInfo(this SemanticModel? semanticModel, AttributeSyntax attributeSyntax, CancellationToken cancellationToken = default(CancellationToken)) 631public static SymbolInfo GetSpeculativeSymbolInfo(this SemanticModel? semanticModel, int position, AttributeSyntax attribute) 733public static TypeInfo GetTypeInfo(this SemanticModel? semanticModel, AttributeSyntax attributeSyntax, CancellationToken cancellationToken = default(CancellationToken)) 977public static ImmutableArray<ISymbol> GetMemberGroup(this SemanticModel? semanticModel, AttributeSyntax attribute, CancellationToken cancellationToken = default(CancellationToken)) 1311public static bool TryGetSpeculativeSemanticModel([NotNullWhen(true)] this SemanticModel? semanticModel, int position, AttributeSyntax attribute, [NotNullWhen(true)] out SemanticModel? speculativeModel)
Declarations\DeclarationTreeBuilder.cs (1)
912foreach (var attribute in attributeList.Attributes)
Errors\MessageProvider.cs (10)
264var node = (AttributeSyntax)attributeSyntax; 270var node = (AttributeSyntax)attributeSyntax; 276var node = (AttributeSyntax)attributeSyntax; 292var node = (AttributeSyntax)attributeSyntax; 298var node = (AttributeSyntax)attributeSyntax;
SourceGeneration\CSharpSyntaxHelper.cs (3)
30=> node is AttributeSyntax; 33=> ((AttributeSyntax)node).Name; 44Debug.Assert(attribute is AttributeSyntax);
src\roslyn\src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
376foreach (var attribute in attributeList.Attributes)
Symbols\Attributes\AttributeData.cs (13)
86internal static bool IsTargetEarlyAttribute(NamedTypeSymbol attributeType, AttributeSyntax attributeSyntax, AttributeDescription description) 213internal void DecodeSecurityAttribute<T>(Symbol targetSymbol, CSharpCompilation compilation, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 239internal static void DecodeSkipLocalsInitAttribute<T>(CSharpCompilation compilation, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 250internal static void DecodeMemberNotNullAttribute<T>(TypeSymbol type, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 286private static void ReportBadNotNullMemberIfNeeded(TypeSymbol type, DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, string memberName) 300internal static void DecodeMemberNotNullWhenAttribute<T>(TypeSymbol type, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 337private DeclarativeSecurityAction DecodeSecurityAttributeAction(Symbol targetSymbol, CSharpCompilation compilation, AttributeSyntax? nodeOpt, out bool hasErrors, BindingDiagnosticBag diagnostics) 380private DeclarativeSecurityAction DecodeSecurityAction(TypedConstant typedValue, Symbol targetSymbol, AttributeSyntax? nodeOpt, BindingDiagnosticBag diagnostics, out bool hasErrors) 468private static Location GetSecurityAttributeActionSyntaxLocation(AttributeSyntax? nodeOpt, TypedConstant typedValue, out object displayString) 506private string? DecodePermissionSetAttribute(CSharpCompilation compilation, AttributeSyntax? nodeOpt, BindingDiagnosticBag diagnostics) 570internal void DecodeClassInterfaceAttribute(AttributeSyntax? nodeOpt, BindingDiagnosticBag diagnostics) 595internal void DecodeInterfaceTypeAttribute(AttributeSyntax node, BindingDiagnosticBag diagnostics) 621internal string DecodeGuidAttribute(AttributeSyntax? nodeOpt, BindingDiagnosticBag diagnostics)
Symbols\Attributes\SourceAttributeData.cs (4)
61internal SourceAttributeData(CSharpCompilation compilation, AttributeSyntax attributeSyntax, NamedTypeSymbol attributeClass, MethodSymbol? attributeConstructor, bool hasErrors) 77AttributeSyntax attributeSyntax, 134var attributeSyntax = (AttributeSyntax)_applicationNode.GetSyntax();
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (5)
118internal sealed override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 163protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 204MarshalAsAttributeDecoder<FieldWellKnownAttributeData, AttributeSyntax, CSharpAttributeData, AttributeLocation>.Decode(ref arguments, AttributeTargets.Field, MessageProvider.Instance); 265private void VerifyConstantValueMatches(ConstantValue attrValue, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 313internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData)
Symbols\Source\QuickAttributeChecker.cs (1)
123public bool IsPossibleMatch(AttributeSyntax attr, QuickAttributes pattern)
Symbols\Source\SourceAssemblySymbol.cs (16)
1328var arguments = new DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation>(); 1670Func<AttributeSyntax, Binder?, bool> attributeMatches = attribute switch 1682bool isPossibleAssemblySignatureKeyAttribute(AttributeSyntax node, Binder? rootBinderOpt) 1688bool isPossibleAssemblyKeyNameAttribute(AttributeSyntax node, Binder? rootBinderOpt) 1694bool isPossibleAssemblyKeyFileAttribute(AttributeSyntax node, Binder? rootBinderOpt) 1704private static PooledHashSet<AttributeSyntax> t_forwardedTypesAttributesInProgress; 1722t_forwardedTypesAttributesInProgress = PooledHashSet<AttributeSyntax>.GetInstance(); 1748private static void BeforePossibleForwardedTypesAttributePartBound(AttributeSyntax node) 1754private static void AfterPossibleForwardedTypesAttributePartBound(AttributeSyntax node) 1760private bool IsPossibleForwardedTypesAttribute(AttributeSyntax node, Binder rootBinderOpt) 2199private static Location GetAssemblyAttributeLocationForDiagnostic(AttributeSyntax attributeSyntaxOpt) 2204private void DecodeTypeForwardedToAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 2271AttributeSyntax nodeOpt, 2360protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 2365private void DecodeWellKnownAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, int index, bool isFromNetModule) 2615private static void ValidateIntegralAttributeNonNegativeArguments(CSharpAttributeData attribute, AttributeSyntax nodeOpt, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceComplexParameterSymbol.cs (20)
619internal override void EarlyDecodeWellKnownAttributeType(NamedTypeSymbol attributeType, AttributeSyntax attributeSyntax) 642internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 731private (CSharpAttributeData?, BoundAttribute?) EarlyDecodeAttributeForDefaultParameterValue(AttributeDescription description, ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 760protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 810MarshalAsAttributeDecoder<ParameterWellKnownAttributeData, AttributeSyntax, CSharpAttributeData, AttributeLocation>.Decode(ref arguments, AttributeTargets.Parameter, MessageProvider.Instance); 916private void DecodeDefaultParameterValueAttribute(AttributeDescription description, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 919var syntax = arguments.AttributeSyntaxOpt; 958private ConstantValue DecodeDefaultParameterValueAttribute(AttributeDescription description, CSharpAttributeData attribute, AttributeSyntax node, bool diagnose, BindingDiagnosticBag diagnosticsOpt) 977private ConstantValue DecodeDefaultParameterValueAttribute(CSharpAttributeData attribute, AttributeSyntax node, bool diagnose, BindingDiagnosticBag diagnosticsOpt) 1058private bool IsValidCallerInfoContext(AttributeSyntax node) => !ContainingSymbol.IsExplicitInterfaceImplementation() 1068private bool IsOnPartialImplementation(AttributeSyntax node) 1083private void ValidateCallerLineNumberAttribute(AttributeSyntax node, BindingDiagnosticBag diagnostics) 1111private void ValidateCallerFilePathAttribute(AttributeSyntax node, BindingDiagnosticBag diagnostics) 1144private void ValidateCallerMemberNameAttribute(AttributeSyntax node, BindingDiagnosticBag diagnostics) 1182private void ValidateCallerArgumentExpressionAttribute(AttributeSyntax node, CSharpAttributeData attribute, BindingDiagnosticBag diagnostics) 1255private void ValidateCancellationTokenAttribute(AttributeSyntax node, BindingDiagnosticBag diagnostics) 1281private void DecodeInterpolatedStringHandlerArgumentAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, BindingDiagnosticBag diagnostics, int attributeIndex) 1367int? decodeName(TypedConstant constant, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1438static void setInterpolatedStringHandlerAttributeError(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1445internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData)
Symbols\Source\SourceConstructorSymbolBase.cs (1)
242internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments)
Symbols\Source\SourceEventSymbol.cs (2)
299internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 342protected sealed override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments)
Symbols\Source\SourceFieldSymbol.cs (1)
114protected sealed override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments)
Symbols\Source\SourceMemberFieldSymbol.cs (1)
157internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (17)
331internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 509protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 524private void DecodeWellKnownAttributeAppliedToMethod(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 538AttributeData.DecodeMethodImplAttribute<MethodWellKnownAttributeData, AttributeSyntax, CSharpAttributeData, AttributeLocation>(ref arguments, MessageProvider.Instance, this.ContainingType); 703ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, 730private void ValidateConditionalAttribute(CSharpAttributeData attribute, AttributeSyntax node, BindingDiagnosticBag diagnostics) 794private void DecodeWellKnownAttributeAppliedToReturnValue(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 805MarshalAsAttributeDecoder<ReturnTypeWellKnownAttributeData, AttributeSyntax, CSharpAttributeData, AttributeLocation>.Decode(ref arguments, AttributeTargets.ReturnValue, MessageProvider.Instance); 832private void DecodeDllImportAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 957private void DecodeModuleInitializerAttribute(DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1006private void DecodeInterceptsLocationAttribute(DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1024private void DecodeInterceptsLocationChecksumBased(DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, int version, string? data) 1165DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, 1171var attributeSyntax = arguments.AttributeSyntaxOpt; 1350static void reportFeatureNotEnabled(BindingDiagnosticBag diagnostics, AttributeSyntax attributeSyntax, ArrayBuilder<string> namespaceNames) 1389private void DecodeUnmanagedCallersOnlyAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1475internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData)
Symbols\Source\SourceModuleSymbol.cs (1)
580protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments)
Symbols\Source\SourceNamedTypeSymbol.cs (8)
907internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 1115protected sealed override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1158AttributeData.DecodeStructLayoutAttribute<TypeWellKnownAttributeData, AttributeSyntax, CSharpAttributeData, AttributeLocation>( 1300foreach (AttributeSyntax attr in attrList.Attributes) 1316private AttributeUsageInfo DecodeAttributeUsageAttribute(CSharpAttributeData attribute, AttributeSyntax node, bool diagnose, BindingDiagnosticBag diagnosticsOpt = null) 1353private void DecodeCoClassAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1406private void ValidateConditionalAttribute(CSharpAttributeData attribute, AttributeSyntax node, BindingDiagnosticBag diagnostics) 1636internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData)
Symbols\Source\SourcePropertySymbolBase.cs (6)
496static bool isPossibleIndexerNameAttribute(AttributeSyntax node, Binder? rootBinderOpt) 503static bool isPossibleIndexerNameAttributeInExtension(AttributeSyntax node, Binder? rootBinderOpt) 1464internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 1544protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1727internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData) 1739private void ValidateIndexerNameAttribute(CSharpAttributeData attribute, AttributeSyntax node, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceTypeParameterSymbol.cs (1)
404protected sealed override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments)
Symbols\Symbol.cs (2)
1545internal bool ReportExplicitUseOfReservedAttributes(in DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, ReservedAttributes permitted) 1637bool reportExplicitUseOfReservedAttribute(CSharpAttributeData attribute, in DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, in AttributeDescription attributeDescription)
Symbols\Symbol_Attributes.cs (26)
122internal virtual void EarlyDecodeWellKnownAttributeType(NamedTypeSymbol attributeType, AttributeSyntax attributeSyntax) 142internal virtual (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 148ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments, 154var syntax = arguments.AttributeSyntax; 216protected void DecodeWellKnownAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 242protected virtual void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 264internal virtual void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData) 309Func<AttributeSyntax, Binder?, bool>? attributeMatchesOpt = null, 310Action<AttributeSyntax>? beforeAttributePartBound = null, 311Action<AttributeSyntax>? afterAttributePartBound = null) 318ImmutableArray<AttributeSyntax> attributesToBind = this.GetAttributesToBind(attributesSyntaxLists, symbolPart, diagnostics, compilation, attributeMatchesOpt, binderOpt, out binders); 447void removeObsoleteDiagnosticsForForwardedTypes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> attributesToBind, ref BindingDiagnosticBag diagnostics) 553foreach (var attributeSyntax in attributeListSyntax.Attributes) 589private ImmutableArray<AttributeSyntax> GetAttributesToBind( 594Func<AttributeSyntax, Binder, bool> attributeMatchesOpt, 600ArrayBuilder<AttributeSyntax> syntaxBuilder = null; 618syntaxBuilder = new ArrayBuilder<AttributeSyntax>(); 630foreach (var attribute in attributesToBind) 664return ImmutableArray<AttributeSyntax>.Empty; 780ImmutableArray<AttributeSyntax> attributesToBind, 792var arguments = new EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation>(); 826private void EarlyDecodeWellKnownAttributeTypes(ImmutableArray<NamedTypeSymbol> attributeTypes, ImmutableArray<AttributeSyntax> attributeSyntaxList) 851ImmutableArray<AttributeSyntax> attributeSyntaxList, 864var arguments = new DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation>(); 872AttributeSyntax attributeSyntax = attributeSyntaxList[i]; 900AttributeSyntax node,
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (3)
144internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 153protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 161internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData)
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (2)
249protected sealed override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 275internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData)
Syntax\SyntaxFacts.cs (3)
47var p = node.Parent as AttributeSyntax; 91return ((AttributeSyntax)parent).Name == node;
Microsoft.CodeAnalysis.CSharp.CodeStyle (13)
src\roslyn\src\Analyzers\CSharp\Analyzers\QualifyMemberAccess\CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (1)
32if (node.GetAncestorOrThis<AttributeSyntax>() != null)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessarySuppressions\CSharpRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.cs (1)
24foreach (var attribute in attributeList.Attributes)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessarySuppressions\UnnecessaryNullableWarningSuppressionsUtilities.cs (1)
208n => n is AttributeSyntax
src\roslyn\src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (3)
52var attribute = (AttributeSyntax)context.Node; 111private static bool MatchesParameterOnContainer(AttributeSyntax attribute, string stringValue)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
81if (arrayCreationOperation.Syntax.Ancestors().OfType<AttributeSyntax>().Any())
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\AttributeArgumentSyntaxExtensions.cs (1)
36if (argumentList.Parent is not AttributeSyntax invocableExpression)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
139case AttributeSyntax attribute:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
1515var attribute = (AttributeSyntax)node;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
33AttributeSyntax, 159semanticModel.TryGetSpeculativeSemanticModel(position, (AttributeSyntax)nodeToSpeculate, out speculativeModel);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (16)
src\roslyn\src\Analyzers\CSharp\CodeFixes\AddExplicitCast\AttributeArgumentFixer.cs (3)
15private sealed class AttributeArgumentFixer : Fixer<AttributeArgumentSyntax, AttributeArgumentListSyntax, AttributeSyntax> 31var newAttribute = (AttributeSyntax)newArgumentList.Parent!;
src\roslyn\src\Analyzers\CSharp\CodeFixes\AddExplicitCast\CSharpAddExplicitCastCodeFixProvider.cs (1)
80&& attributeArgumentList.Parent is AttributeSyntax attributeNode)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (1)
123if (fullName.Parent is AttributeSyntax attribute)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.cs (2)
48=> node is BaseObjectCreationExpressionSyntax or ConstructorInitializerSyntax or AttributeSyntax; 54AttributeSyntax attributeNode => attributeNode.Name,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (5)
50var attributeSyntax = TryGenerateAttribute(attribute, info); 60private static AttributeSyntax? TryGenerateAttribute(AttributeData attribute, CSharpCodeGenerationContextInfo info) 65var reusableSyntax = GetReuseableSyntaxNodeForAttribute<AttributeSyntax>(attribute); 79AttributeData attribute, AttributeSyntax? existingSyntax)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (4)
146AttributeSyntax _ => InferTypeInAttribute(), 383if (argument.Parent.Parent is AttributeSyntax attribute) 551if (attributeArgumentList.Parent is AttributeSyntax attribute) 560private IEnumerable<TypeInferenceInfo> InferTypeInAttribute(AttributeSyntax attribute, int index, AttributeArgumentSyntax argumentOpt = null)
Microsoft.CodeAnalysis.CSharp.Features (40)
ChangeSignature\CSharpChangeSignatureService.cs (3)
488if (updatedNode is AttributeSyntax attribute) 490var symbolInfo = semanticModel.GetSymbolInfo((AttributeSyntax)originalNode, cancellationToken); 609if (node is AttributeSyntax attribute)
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (2)
160var attributes = new SeparatedSyntaxList<AttributeSyntax>() 214if (attribute is AttributeSyntax attributeSyntax)
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (5)
73if (token.Parent!.Parent is not AttributeSyntax attributeSyntax || token.Parent is not AttributeArgumentListSyntax attributeArgumentList) 155SyntaxToken token, AttributeSyntax attributeSyntax, ISet<string> existingNamedParameters) 177CompletionContext context, SemanticModel semanticModel, SyntaxToken token, AttributeSyntax attributeSyntax, ISet<string> existingNamedParameters) 221AttributeSyntax attribute, 237AttributeSyntax attribute,
Completion\CompletionProviders\InternalsVisibleToCompletionProvider.cs (1)
50var arguments = ((AttributeSyntax)internalsVisibleToAttribute).ArgumentList!.Arguments;
Completion\KeywordRecommenders\TypeOfKeywordRecommender.cs (1)
27context.LeftToken.GetAncestor<AttributeSyntax>() != null;
EditAndContinue\SyntaxComparer.cs (3)
922distance = ComputeDistance((AttributeSyntax)leftNode, (AttributeSyntax)rightNode); 1511return ((AttributeSyntax)node).Name;
MetadataAsSource\CSharpMetadataAsSourceService.cs (1)
135return annotatedChildren.Any(n => n.GetAncestorOrThis<AttributeSyntax>() == null);
QuickInfo\CSharpDiagnosticAnalyzerQuickInfoProvider.cs (1)
96Parent: AttributeSyntax
SignatureHelp\AttributeSignatureHelpProvider.cs (6)
45[NotNullWhen(true)] out AttributeSyntax? attribute) 62token.Parent.Parent is AttributeSyntax; 65private static bool IsArgumentListToken(AttributeSyntax expression, SyntaxToken token) 75if (!TryGetAttributeExpression(root, position, document.GetRequiredLanguageService<ISyntaxFactsService>(), triggerInfo.TriggerReason, cancellationToken, out var attribute)) 117if (TryGetAttributeExpression(root, position, syntaxFacts, SignatureHelpTriggerReason.InvokeSignatureHelpCommand, cancellationToken, out var expression) && 129AttributeSyntax attribute,
src\roslyn\src\Analyzers\CSharp\Analyzers\QualifyMemberAccess\CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (1)
32if (node.GetAncestorOrThis<AttributeSyntax>() != null)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessarySuppressions\CSharpRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.cs (1)
24foreach (var attribute in attributeList.Attributes)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessarySuppressions\UnnecessaryNullableWarningSuppressionsUtilities.cs (1)
208n => n is AttributeSyntax
src\roslyn\src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (3)
52var attribute = (AttributeSyntax)context.Node; 111private static bool MatchesParameterOnContainer(AttributeSyntax attribute, string stringValue)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
81if (arrayCreationOperation.Syntax.Ancestors().OfType<AttributeSyntax>().Any())
src\roslyn\src\Analyzers\CSharp\CodeFixes\AddExplicitCast\AttributeArgumentFixer.cs (3)
15private sealed class AttributeArgumentFixer : Fixer<AttributeArgumentSyntax, AttributeArgumentListSyntax, AttributeSyntax> 31var newAttribute = (AttributeSyntax)newArgumentList.Parent!;
src\roslyn\src\Analyzers\CSharp\CodeFixes\AddExplicitCast\CSharpAddExplicitCastCodeFixProvider.cs (1)
80&& attributeArgumentList.Parent is AttributeSyntax attributeNode)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (1)
123if (fullName.Parent is AttributeSyntax attribute)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.cs (2)
48=> node is BaseObjectCreationExpressionSyntax or ConstructorInitializerSyntax or AttributeSyntax; 54AttributeSyntax attributeNode => attributeNode.Name,
src\roslyn\src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
376foreach (var attribute in attributeList.Attributes)
Testing\CSharpTestMethodFinder.cs (2)
31foreach (var attribute in attributeList.Attributes) 44private bool IsTestAttribute(AttributeSyntax attribute)
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (8)
Microsoft.NetCore.Analyzers\Performance\CSharpConstantExpectedAnalyzer.cs (4)
29var attributeSyntax = (AttributeSyntax)context.Node; 54var attributeSyntax = (AttributeSyntax)attributeNode;
Microsoft.NetCore.Analyzers\Resources\CSharpMarkAssembliesWithNeutralResourcesLanguage.cs (3)
28var attributeSyntax = (AttributeSyntax)context.Node; 43private static bool CheckAttribute(AttributeSyntax attribute)
Microsoft.NetCore.Analyzers\Runtime\CSharpAvoidZeroLengthArrayAllocations.cs (1)
20return node is AttributeSyntax;
Microsoft.CodeAnalysis.CSharp.Workspaces (33)
CodeGeneration\CSharpSyntaxGenerator.cs (13)
989return node is AttributeSyntax attr ? SyntaxFactory.AttributeList([attr]) : (AttributeListSyntax)node; 1114var attr = (AttributeSyntax)attributeDeclaration; 1162var attr = (AttributeSyntax)declaration; 1182var attr = (AttributeSyntax)declaration; 2063AttributeSyntax attribute => attribute.Name.ToString(), 2097AttributeSyntax attribute => ReplaceWithTrivia(declaration, attribute.Name, this.DottedName(name)), 2191var attr = (AttributeSyntax)declaration; 3145var attr = (AttributeSyntax)declaration;
Rename\CSharpRenameRewriterLanguageService.cs (3)
196(node is AttributeSyntax || 1146var attributeSyntax = token.GetAncestor<AttributeSyntax>();
Simplification\CSharpSimplificationService.cs (1)
56if (node is AttributeSyntax or
Simplification\CSharpSimplificationService.Expander.cs (1)
584if (originalSimpleName.GetAncestor<AttributeSyntax>() != null)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\AttributeArgumentSyntaxExtensions.cs (1)
36if (argumentList.Parent is not AttributeSyntax invocableExpression)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
139case AttributeSyntax attribute:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
1515var attribute = (AttributeSyntax)node;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
33AttributeSyntax, 159semanticModel.TryGetSpeculativeSemanticModel(position, (AttributeSyntax)nodeToSpeculate, out speculativeModel);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (5)
50var attributeSyntax = TryGenerateAttribute(attribute, info); 60private static AttributeSyntax? TryGenerateAttribute(AttributeData attribute, CSharpCodeGenerationContextInfo info) 65var reusableSyntax = GetReuseableSyntaxNodeForAttribute<AttributeSyntax>(attribute); 79AttributeData attribute, AttributeSyntax? existingSyntax)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (4)
146AttributeSyntax _ => InferTypeInAttribute(), 383if (argument.Parent.Parent is AttributeSyntax attribute) 551if (attributeArgumentList.Parent is AttributeSyntax attribute) 560private IEnumerable<TypeInferenceInfo> InferTypeInAttribute(AttributeSyntax attribute, int index, AttributeArgumentSyntax argumentOpt = null)
Microsoft.DotNet.GenFacades (1)
TypeParser.cs (1)
43foreach (var item in attribute.Attributes)
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
108foreach (AttributeSyntax ma in mal.Attributes)
Microsoft.Gen.BuildMetadata (4)
src\Generators\Shared\GeneratorUtilities.cs (4)
89var attr = (AttributeSyntax)node; 106var attributeSyntax = (AttributeSyntax)context.Node;
Microsoft.Gen.ComplianceReports (4)
src\Generators\Shared\GeneratorUtilities.cs (4)
89var attr = (AttributeSyntax)node; 106var attributeSyntax = (AttributeSyntax)context.Node;
Microsoft.Gen.ContextualOptions (4)
src\Generators\Shared\GeneratorUtilities.cs (4)
89var attr = (AttributeSyntax)node; 106var attributeSyntax = (AttributeSyntax)context.Node;
Microsoft.Gen.Logging (5)
Parsing\Parser.cs (1)
607foreach (var methodAttr in mal.Attributes)
src\Generators\Shared\GeneratorUtilities.cs (4)
89var attr = (AttributeSyntax)node; 106var attributeSyntax = (AttributeSyntax)context.Node;
Microsoft.Gen.MetadataExtractor (5)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
334attribute.ApplicationSyntaxReference.GetSyntax(_cancellationToken) is AttributeSyntax syntax &&
src\Generators\Shared\GeneratorUtilities.cs (4)
89var attr = (AttributeSyntax)node; 106var attributeSyntax = (AttributeSyntax)context.Node;
Microsoft.Gen.Metrics (5)
Parser.cs (1)
334attribute.ApplicationSyntaxReference.GetSyntax(_cancellationToken) is AttributeSyntax syntax &&
src\Generators\Shared\GeneratorUtilities.cs (4)
89var attr = (AttributeSyntax)node; 106var attributeSyntax = (AttributeSyntax)context.Node;
Microsoft.Gen.MetricsReports (5)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
334attribute.ApplicationSyntaxReference.GetSyntax(_cancellationToken) is AttributeSyntax syntax &&
src\Generators\Shared\GeneratorUtilities.cs (4)
89var attr = (AttributeSyntax)node; 106var attributeSyntax = (AttributeSyntax)context.Node;
Microsoft.Interop.ComInterfaceGenerator (1)
VirtualMethodPointerStubGenerator.cs (1)
151AttributeSyntax unmanagedCallersOnlyAttribute = Attribute(
Microsoft.Interop.JavaScript.JSImportGenerator (1)
JSExportGenerator.cs (1)
225SeparatedList<AttributeSyntax>(
Microsoft.Interop.LibraryImportGenerator (13)
Analyzers\ConvertToLibraryImportFixer.cs (5)
228var dllImportSyntax = (AttributeSyntax)await dllImportAttr!.ApplicationSyntaxReference!.GetSyntaxAsync(cancellationToken).ConfigureAwait(false); 426AttributeSyntax dllImportSyntax, 561return SortDllImportAttributeArguments((AttributeSyntax)libraryImportSyntax, generator); 564private static SyntaxNode SortDllImportAttributeArguments(AttributeSyntax attribute, SyntaxGenerator generator)
LibraryImportGenerator.cs (8)
28SequenceEqualImmutableArray<AttributeSyntax> ForwardedAttributes, 84private static List<AttributeSyntax> GenerateSyntaxForForwardedAttributes(AttributeData? suppressGCTransitionAttribute, AttributeData? unmanagedCallConvAttribute, AttributeData? defaultDllImportSearchPathsAttribute, AttributeData? wasmImportLinkageAttribute, AttributeData? stackTraceHiddenAttribute) 88List<AttributeSyntax> attributes = new(); 102AttributeSyntax unmanagedCallConvSyntax = Attribute(NameSyntaxes.UnmanagedCallConvAttribute); 270List<AttributeSyntax> additionalAttributes = GenerateSyntaxForForwardedAttributes(suppressGCTransitionAttribute, unmanagedCallConvAttribute, defaultDllImportSearchPathsAttribute, wasmImportLinkageAttribute, stackTraceHiddenAttribute); 276new SequenceEqualImmutableArray<AttributeSyntax>(additionalAttributes.ToImmutableArray(), SyntaxEquivalentComparer.Instance), 312ImmutableArray<AttributeSyntax> forwardedAttributes = pinvokeStub.ForwardedAttributes.Array; 429private static AttributeSyntax CreateForwarderDllImport(LibraryImportData target)
Microsoft.Interop.LibraryImportGenerator.Downlevel (7)
DownlevelLibraryImportGenerator.cs (7)
28SequenceEqualImmutableArray<AttributeSyntax> ForwardedAttributes, 110private static List<AttributeSyntax> GenerateSyntaxForForwardedAttributes(AttributeData? defaultDllImportSearchPathsAttribute) 113List<AttributeSyntax> attributes = []; 231List<AttributeSyntax> additionalAttributes = GenerateSyntaxForForwardedAttributes(defaultDllImportSearchPathsAttribute); 237new SequenceEqualImmutableArray<AttributeSyntax>(additionalAttributes.ToImmutableArray(), SyntaxEquivalentComparer.Instance), 266ImmutableArray<AttributeSyntax> forwardedAttributes = pinvokeStub.ForwardedAttributes.Array; 374private static AttributeSyntax CreateForwarderDllImport(LibraryImportData target)
Microsoft.Interop.SourceGeneration (10)
MarshalAsParser.cs (6)
27private protected abstract bool TryCreateAttributeSyntax([NotNullWhen(true)] out AttributeSyntax? attribute); 29bool IForwardedMarshallingInfo.TryCreateAttributeSyntax([NotNullWhen(true)] out AttributeSyntax? attribute) => TryCreateAttributeSyntax(out attribute); 36private protected override bool TryCreateAttributeSyntax([NotNullWhen(true)] out AttributeSyntax? attribute) 67private protected override bool TryCreateAttributeSyntax([NotNullWhen(true)] out AttributeSyntax? attribute) 98private protected override bool TryCreateAttributeSyntax([NotNullWhen(true)] out AttributeSyntax? attribute) 300=> attributeData.ApplicationSyntaxReference?.GetSyntax() is AttributeSyntax
Marshalling\IForwardedMarshallingInfo.cs (1)
11bool TryCreateAttributeSyntax([NotNullWhen(true)] out AttributeSyntax? attribute);
Marshalling\MarshallingGeneratorExtensions.cs (3)
44&& forwarded.TryCreateAttributeSyntax(out AttributeSyntax forwardedAttribute)) 110List<AttributeSyntax> rehydratedAttributes = new(); 112&& forwardedMarshallingInfo.TryCreateAttributeSyntax(out AttributeSyntax forwardedAttribute))
QuarantineTools.Tests (5)
ActiveIssueTests.cs (2)
374private static bool IsActiveIssueAttribute(AttributeSyntax attr) 433var attr = SyntaxFactory.Attribute(attrName, attrArgs);
QuarantineScriptTests.cs (3)
146bool anyQuarantinedLeft = newRoot.DescendantNodes().OfType<AttributeSyntax>().Any(IsQuarantinedAttribute); 318private static bool IsQuarantinedAttribute(AttributeSyntax attr) 377var attr = SyntaxFactory.Attribute(attrName, attrArgs);
Roslyn.Diagnostics.CSharp.Analyzers (16)
CSharpApplyTraitToClass.cs (1)
20public sealed class CSharpApplyTraitToClass() : AbstractApplyTraitToClass<AttributeSyntax>
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\AttributeArgumentSyntaxExtensions.cs (1)
36if (argumentList.Parent is not AttributeSyntax invocableExpression)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
139case AttributeSyntax attribute:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
1515var attribute = (AttributeSyntax)node;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
33AttributeSyntax, 159semanticModel.TryGetSpeculativeSemanticModel(position, (AttributeSyntax)nodeToSpeculate, out speculativeModel);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (5)
50var attributeSyntax = TryGenerateAttribute(attribute, info); 60private static AttributeSyntax? TryGenerateAttribute(AttributeData attribute, CSharpCodeGenerationContextInfo info) 65var reusableSyntax = GetReuseableSyntaxNodeForAttribute<AttributeSyntax>(attribute); 79AttributeData attribute, AttributeSyntax? existingSyntax)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (4)
146AttributeSyntax _ => InferTypeInAttribute(), 383if (argument.Parent.Parent is AttributeSyntax attribute) 551if (attributeArgumentList.Parent is AttributeSyntax attribute) 560private IEnumerable<TypeInferenceInfo> InferTypeInAttribute(AttributeSyntax attribute, int index, AttributeArgumentSyntax argumentOpt = null)
System.Windows.Forms.Analyzers.CodeFixes.CSharp (1)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (1)
81AttributeSyntax designerSerializationVisibilityAttribute = SyntaxFactory.Attribute(