Skip to content

Commit ca11030

Browse files
committed
Fix for #87, enums display as expandable when they have no properties. VS also doesn't show enum values as expandable. Note that this is a specific fix for enums but I think we need a more general fix were we don't show any variable as expandable *if* it has no properties to show.
1 parent 2fafc3a commit ca11030

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/PowerShellEditorServices/Debugging/VariableDetails.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,10 @@ private static bool GetIsExpandable(object valueObject)
130130
return
131131
valueObject != null &&
132132
!valueType.IsPrimitive &&
133+
!valueType.IsEnum && // Enums don't have any properties
134+
!(valueObject is string) && // Strings get treated as IEnumerables
133135
!(valueObject is decimal) &&
134-
!(valueObject is UnableToRetrievePropertyMessage) &&
135-
!(valueObject is string); // Strings get treated as IEnumerables
136+
!(valueObject is UnableToRetrievePropertyMessage);
136137
}
137138

138139
private static string GetValueString(object value, bool isExpandable)

0 commit comments

Comments
 (0)