Skip to content

Commit d40bf7e

Browse files
JustinGroteSeeminglyScienceandyleejordan
committed
Improve properties selection for variables
Co-authored-by: Patrick Meinecke <[email protected]> Co-authored-by: Andy Schwartzmeyer <[email protected]>
1 parent 581a67c commit d40bf7e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/PowerShellEditorServices/Services/DebugAdapter/Debugging/VariableDetails.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,10 @@ private VariableDetails[] GetChildren(object obj, ILogger logger)
290290
childVariables.AddRange(
291291
psObject
292292
.Properties
293-
.Where(p => p.MemberType == PSMemberTypes.NoteProperty)
293+
// Here we check the object's MemberType against the `Properties`
294+
// bit-mask to determine if this is a property. Hence the selection
295+
// will only include properties.
296+
.Where(p => (PSMemberTypes.Properties & p.MemberType) is not 0)
294297
.Select(p => new VariableDetails(p)));
295298

296299
obj = psObject.BaseObject;

0 commit comments

Comments
 (0)