Permalink
Browse files

Corrected parsing TagsAttributes with > 1 tag

  • Loading branch information...
1 parent 35a371b commit 44343e6bd9e00ca2a28c7619edf916a67fccfc2a @agross agross committed Mar 24, 2012
Showing with 11 additions and 1 deletion.
  1. +11 −1 Source/Machine.Specifications.ReSharperRunner.4.1/PsiExtensions.cs
@@ -190,7 +190,17 @@ public static string GetSubjectString(this IAttributesOwner type)
public static ICollection<string> GetTags(this IAttributesOwner type)
{
return type.GetAttributeInstances(new CLRTypeName(typeof(TagsAttribute).FullName), true)
- .SelectMany(x => x.PositionParameters(), (x, v) => v.ConstantValue.Value.ToString())
+ .SelectMany(x => x.PositionParameters())
+ .SelectMany(x =>
+ {
+ if (x.IsArray)
+ {
+ return x.ArrayValue.Select(av => av.ConstantValue);
+ }
+
+ return new[] {x.ConstantValue};
+ })
+ .Select(v => v.Value.ToString())
.Distinct()
.ToList();
}

0 comments on commit 44343e6

Please sign in to comment.