Skip to content

Commit

Permalink
concrete ctor now feeds specific AnnotationType to base
Browse files Browse the repository at this point in the history
  • Loading branch information
beachasaurus-rex committed May 20, 2019
1 parent 89364e4 commit a412221
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Rubberduck.Parsing/Annotations/ExcelHotKeyAnnotation.cs
Expand Up @@ -8,12 +8,12 @@ namespace Rubberduck.Parsing.Annotations
{
public sealed class ExcelHotKeyAnnotation : FlexibleAttributeValueAnnotationBase
{
public ExcelHotKeyAnnotation(AnnotationType annotationType, QualifiedSelection qualifiedSelection, VBAParser.AnnotationContext context, IEnumerable<string> attributeValues) :
base(annotationType, qualifiedSelection, context, GetHotKeyAttributeValue(attributeValues))
public ExcelHotKeyAnnotation(QualifiedSelection qualifiedSelection, VBAParser.AnnotationContext context, IEnumerable<string> parameters) :
base(AnnotationType.ExcelHotKey, qualifiedSelection, context, GetHotKeyAttributeValue(parameters))
{ }

private static IEnumerable<string> GetHotKeyAttributeValue(IEnumerable<string> attributeValues) =>
attributeValues.Take(1).Select(StripStringLiteralQuotes).Select(v => v[0] + @"\n14").ToList();
private static IEnumerable<string> GetHotKeyAttributeValue(IEnumerable<string> parameters) =>
parameters.Take(1).Select(StripStringLiteralQuotes).Select(v => v[0] + @"\n14").ToList();

private static string StripStringLiteralQuotes(string value) =>
value.StartsWith("\"") && value.EndsWith("\"") && value.Length > 2
Expand Down

0 comments on commit a412221

Please sign in to comment.