You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because we use AddScript, that adds another scope not associated with any filename. That resulted in a StackFrame ScriptPath with a null value. Later, VSCode sent us a request for soruce with a sourceReference value of null. That caused the JSON deserialization of that message to throw and that crashed the debug host. I made two changes. First, when we construct the StackFrameDetails, if the PowerShell CallStackFrame.ScriptName is null, we use the string "<No File>" instead for ScriptPath. The second change was to ExecuteScriptAtPath. Essentially, if you do not pass args we now use AddCommand(scriptPath) which does not add the extra stack frame. If you do use args then we still use AddScript. You will see the extra outermost stack frame of "<ScriptBlock>, <NoFile>". What is somewhat useful about this is that you can open Script variables to look at $MyInvocation.Line to see how the script was invoked with the args.
0 commit comments