File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -563,9 +563,18 @@ private string GetPrefsPrefix(INamedTypeSymbol classSymbol)
563563
564564 private object GetAttributePropertyValue ( AttributeData attribute , string propertyName )
565565 {
566- var namedArg = attribute . NamedArguments . FirstOrDefault ( na => na . Key == propertyName ) ;
567- if ( namedArg . Key != null )
568- return namedArg . Value . Value ;
566+ // Check named arguments (e.g., Key = "value")
567+ foreach ( var namedArg in attribute . NamedArguments )
568+ {
569+ if ( namedArg . Key == propertyName )
570+ return namedArg . Value . Value ;
571+ }
572+
573+ // Check constructor arguments for "Key" property specifically
574+ if ( propertyName == "Key" && attribute . ConstructorArguments . Length > 0 )
575+ {
576+ return attribute . ConstructorArguments [ 0 ] . Value ;
577+ }
569578
570579 return null ;
571580 }
You can’t perform that action at this time.
0 commit comments