Closed vexx32 closed 1 year ago
Thanks @vexx32 really appreciate you opening this issue and being do detailed, unfortunately we were not able to reproduce interactive debugging not functioning properly so as you mentioned logs would be very helpful--instructions for how to do that are here
Did a bit of poking around and realized what the underlying issue is here. These two settings don't work together:
PowerShell > Debugging: Create Temporary Integrated Console
(ON)PowerShell > Integrated Console: Show on Startup
(OFF)If you have this configuration, whenever you try to start a debugging session, the wrong console is exposed and focused -- the main integrated console is shown instead of the new temporary console. As a result, nothing seems to work, because the extension is still managing the debug session from the temporary session instead of the one it's actually showing.
This... explains a lot. 😂
Hmmm, I think we've discussed both the settings and the implementation for the temp console, and I'd personally be happy to improve how it all works once other work is out of the way
Thanks, that'd be awesome! 💖
If it helps, logs from a quick run through of the problem are attached. 😁 1594159755-2a72e192-4b06-449d-821a-1f1042b763891594158464672.zip
EDIT: Updated the original issue post with the above info & logs as well so it's all in one place.
Hello! The latest code is available in the PowerShell Preview for VS Code, and includes a myriad of fixes. Could you verify if this issue still reproduces using the preview extension? Please note that this preview is likely to include other bugs, and you should feel free to file new issues for those so we can work through them. Thanks again!
Going to assume it's no longer an issue, thanks!
System Details
System Details Output
Issue Description
The interactive debugging experience appears to be completely broken. These probably could be separate issues, so feel free to split them out, but they're all ultimately related and I really just want to fix the issue I'm currently trying to debug more than I really wanna spend hours debugging the issues in the extension I'm currently butting heads with.
Sincere apologies in advance in case my current frustration colours any of this, I've tried to be as detailed as I can manage at the moment, but ultimately I'm trying to debug an issue in my own code, so it's been a bit frustrating running into issues with the extension at the same time, especially for configurations that previously worked very intuitively and now don't seem to work at all.
Update:
/cc @rjmholt @TylerLeonhardt
Things I have tried:
Using the
PowerShell Interactive Session
orPowerShell Attach Interactive Session Runspace
default debug configurationsThe issue here seems to be that breakpoints are completely ignored. I can run commands in the interactive console, but no breakpoints I set in the VS Code UI are ever hit. For full clarity, I'm setting breakpoints in the files for my module functions, then importing the module in the interactive console and trying to run commands and hit the breakpoints from there.
To my memory, this did used to work somewhere around a few months back without an issue.
Using the
PowerShell Attach to Host Process
to attach to another Pwsh console and running commands in thereThis is so far the best experience I've had recently and it's still very broken. Breakpoints are hit and I can step through easily, this is nice. However, in the Variable view pane in the sidebar, complex objects other than dictionary types like hashtables are apparently serialized to string, so all I can see is the type name and none of the property information, so I have very limited visibility as to what's actually going on.
Using the
PowerShell Launch Current File
/PowerShell Launch Script
configurationsThis seems to work most consistently and works fairly well, but in a lot of cases I want to be debugging my module functions, so I need to put all the commands I want to try out in a new file, which makes for (imo) a very clunky debugging experience, as I need to restart the debug session every time I want to try something else.
To remedy this, I tried to add a
$host.EnterNestedPrompt()
to the script to let me drop into the interactive console and work from there, running module commands myself so I can debug from there. The extension seems to be running all debugging in a background runspace rather than the "Integrated" console (so... it's not Integrated to a useful degree at all anymore, apparently!) and so the EnterNestedPrompt() call simply pauses execution with no possible way to resume it. No prompt is shown in the interactive console, so I can only conclude it's not running in the main integrated console runspace, which makes things very unintuitive.Additionally, in this mode I don't get any output in the Integrated Console, which is usually still useful even when debugging. Not sure when that changed but it makes the debugging experience feel significantly more "flying blind" than I would like, it's more obtuse than littering my code with Write-Host (which I really hate to do, but would feel more intuitive than this experience currently does).
Attached Logs
Logs
Launch.json