Skip to content

Commit 73a3ffd

Browse files
committed
Add special case for ExcelHotkeyAnnotation in the AttributeAnnotationProvider
1 parent 9a094fa commit 73a3ffd

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Rubberduck.Parsing/Annotations/AttributeAnnotationProvider.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ public class AttributeAnnotationProvider : IAttributeAnnotationProvider
3333
var flexibleValueAttributeAnnotation = FirstMatchingFlexibleAttributeValueAnnotation(annotationTypes, attributeName, attributeValues.Count);
3434
if (flexibleValueAttributeAnnotation != default)
3535
{
36+
// FIXME special cased bodge for ExcelHotKeyAnnotation to deal with the value transformation:
37+
if (flexibleValueAttributeAnnotation == AnnotationType.ExcelHotKey)
38+
{
39+
return (flexibleValueAttributeAnnotation, attributeValues.Select(keySpec => keySpec.Substring(0, 1)).ToList());
40+
}
3641
return (flexibleValueAttributeAnnotation, attributeValues);
3742
}
3843

Rubberduck.Parsing/Annotations/VBAParserAnnotationFactory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public VBAParserAnnotationFactory()
3333
_creators.Add(AnnotationType.ModuleAttribute.ToString().ToUpperInvariant(), typeof(ModuleAttributeAnnotation));
3434
_creators.Add(AnnotationType.MemberAttribute.ToString().ToUpperInvariant(), typeof(MemberAttributeAnnotation));
3535
_creators.Add(AnnotationType.ModuleDescription.ToString().ToUpperInvariant(), typeof(ModuleDescriptionAnnotation));
36+
_creators.Add(AnnotationType.ExcelHotKey.ToString().ToUpperInvariant(), typeof(ExcelHotKeyAnnotation));
3637
}
3738

3839
public IAnnotation Create(VBAParser.AnnotationContext context, QualifiedSelection qualifiedSelection)

0 commit comments

Comments
 (0)