Skip to content

Commit 9a9e2b8

Browse files
rkeithhilldaviwil
authored andcommitted
Not ready to implement ModuleId yet. Need to understand this feature area better.
Handle possibilty of there not being a InvocationInfo property on a PSObject.
1 parent a914690 commit 9a9e2b8

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/PowerShellEditorServices.Protocol/DebugAdapter/StackFrame.cs

-5
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ public class StackFrame
4646
/// </summary>
4747
public int? EndColumn { get; set; }
4848

49-
/// <summary>
50-
/// Gets the module associated with this frame, if any.
51-
/// </summary>
52-
public object ModuleId { get; set; }
53-
5449
/// <summary>
5550
/// Gets an optional hint for how to present this frame in the UI. A value of 'label'
5651
/// can be used to indicate that the frame is an artificial frame that is used as a

src/PowerShellEditorServices/Debugging/StackFrameDetails.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
namespace Microsoft.PowerShell.EditorServices
1010
{
11+
/// <summary>
12+
/// An optional hint for how to present a stack frame in the UI.
13+
/// </summary>
1114
public enum StackFramePresentationHint
1215
{
1316
/// <summary>
@@ -107,6 +110,10 @@ public class StackFrameDetails
107110
/// <param name="localVariables">
108111
/// A variable container with all the local variables for this stack frame.
109112
/// </param>
113+
/// <param name="workspaceRootPath">
114+
/// Specifies the path to the root of an open workspace, if one is open. This path is used to
115+
/// determine whether individua stack frames are external to the workspace.
116+
/// </param>
110117
/// <returns>A new instance of the StackFrameDetails class.</returns>
111118
static internal StackFrameDetails Create(
112119
PSObject callStackFrameObject,
@@ -117,7 +124,7 @@ static internal StackFrameDetails Create(
117124
string moduleId = string.Empty;
118125
var presentationHint = StackFramePresentationHint.Normal;
119126

120-
var invocationInfo = callStackFrameObject.Properties["InvocationInfo"].Value as InvocationInfo;
127+
var invocationInfo = callStackFrameObject.Properties["InvocationInfo"]?.Value as InvocationInfo;
121128
string scriptPath = (callStackFrameObject.Properties["ScriptName"].Value as string) ?? NoFileScriptPath;
122129
int startLineNumber = (int)(callStackFrameObject.Properties["ScriptLineNumber"].Value ?? 0);
123130

0 commit comments

Comments
 (0)