Skip to content

Commit

Permalink
Add special case for ExcelHotkeyAnnotation in the AttributeAnnotation…
Browse files Browse the repository at this point in the history
…Provider
  • Loading branch information
Vogel612 committed Aug 22, 2019
1 parent 9a094fa commit 73a3ffd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Rubberduck.Parsing/Annotations/AttributeAnnotationProvider.cs
Expand Up @@ -33,6 +33,11 @@ public class AttributeAnnotationProvider : IAttributeAnnotationProvider
var flexibleValueAttributeAnnotation = FirstMatchingFlexibleAttributeValueAnnotation(annotationTypes, attributeName, attributeValues.Count);
if (flexibleValueAttributeAnnotation != default)
{
// FIXME special cased bodge for ExcelHotKeyAnnotation to deal with the value transformation:
if (flexibleValueAttributeAnnotation == AnnotationType.ExcelHotKey)
{
return (flexibleValueAttributeAnnotation, attributeValues.Select(keySpec => keySpec.Substring(0, 1)).ToList());
}
return (flexibleValueAttributeAnnotation, attributeValues);
}

Expand Down
Expand Up @@ -33,6 +33,7 @@ public VBAParserAnnotationFactory()
_creators.Add(AnnotationType.ModuleAttribute.ToString().ToUpperInvariant(), typeof(ModuleAttributeAnnotation));
_creators.Add(AnnotationType.MemberAttribute.ToString().ToUpperInvariant(), typeof(MemberAttributeAnnotation));
_creators.Add(AnnotationType.ModuleDescription.ToString().ToUpperInvariant(), typeof(ModuleDescriptionAnnotation));
_creators.Add(AnnotationType.ExcelHotKey.ToString().ToUpperInvariant(), typeof(ExcelHotKeyAnnotation));
}

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

0 comments on commit 73a3ffd

Please sign in to comment.