Skip to content

Commit 1eba08e

Browse files
JustinGroteSeeminglyScienceandyleejordan
committed
Improve properties selection for variables
Co-authored-by: Patrick Meinecke <SeeminglyScience@users.noreply.github.com> Co-authored-by: Andy Schwartzmeyer <andrew@schwartzmeyer.com>
1 parent 171242d commit 1eba08e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation.
1+
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

44
using System;
@@ -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)