@@ -8,26 +8,19 @@ namespace Rubberduck.Parsing.Annotations
8
8
{
9
9
public abstract class FlexibleAttributeValueAnnotationBase : AnnotationBase , IAttributeAnnotation
10
10
{
11
- protected FlexibleAttributeValueAnnotationBase ( AnnotationType annotationType , QualifiedSelection qualifiedSelection , VBAParser . AnnotationContext context , IEnumerable < string > parameters )
11
+ public string Attribute { get ; }
12
+ public IReadOnlyList < string > AttributeValues { get ; }
13
+
14
+ protected FlexibleAttributeValueAnnotationBase ( AnnotationType annotationType , QualifiedSelection qualifiedSelection , VBAParser . AnnotationContext context , IEnumerable < string > attributeValues )
12
15
: base ( annotationType , qualifiedSelection , context )
13
16
{
14
17
var flexibleAttributeValueInfo = FlexibleAttributeValueInfo ( annotationType ) ;
15
18
16
- if ( flexibleAttributeValueInfo == null )
17
- {
18
- Attribute = string . Empty ;
19
- AttributeValues = new List < string > ( ) ;
20
- return ;
21
- }
22
-
23
- Attribute = flexibleAttributeValueInfo . Value . attribute ;
24
- AttributeValues = parameters ? . Take ( flexibleAttributeValueInfo . Value . numberOfValues ) . ToList ( ) ?? new List < string > ( ) ;
19
+ Attribute = flexibleAttributeValueInfo . attribute ;
20
+ AttributeValues = attributeValues ? . Take ( flexibleAttributeValueInfo . numberOfValues ) . ToList ( ) ?? new List < string > ( ) ;
25
21
}
26
22
27
- public string Attribute { get ; }
28
- public IReadOnlyList < string > AttributeValues { get ; }
29
-
30
- private static ( string attribute , int numberOfValues ) ? FlexibleAttributeValueInfo ( AnnotationType annotationType )
23
+ private static ( string attribute , int numberOfValues ) FlexibleAttributeValueInfo ( AnnotationType annotationType )
31
24
{
32
25
var type = annotationType . GetType ( ) ;
33
26
var name = Enum . GetName ( type , annotationType ) ;
@@ -38,7 +31,7 @@ private static (string attribute, int numberOfValues)? FlexibleAttributeValueInf
38
31
39
32
if ( attribute == null )
40
33
{
41
- return null ;
34
+ return ( "" , 0 ) ;
42
35
}
43
36
44
37
return ( attribute . AttributeName , attribute . NumberOfParameters ) ;
0 commit comments