PowerShell / vscode-powershell

Provides PowerShell language and debugging support for Visual Studio Code
https://marketplace.visualstudio.com/items/ms-vscode.PowerShell
MIT License
1.7k stars 489 forks source link

Cannot Set Breakpoints When Remote Debugging PowerShell #4531

Open prpercival opened 1 year ago

prpercival commented 1 year ago

Prerequisites

Summary

I am attempting to use VSCode for remote editing and debugging PowerShell files following this guide. I am able to run and attempt to debug my remote file after opening with psedit <filename>, but it appears breakpoints do not work as expected. It appears VSCode opens a file on my host machine with the path of the remote file (which does not exist on the host) and tries to attach the debugger to that. It will respect the original breakpoint set before it ran initially and I can even see variables on the left side, but I do not have the ability to alter breakpoints on the file or inspect variable values by hovering over them.

PowerShell Version

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      22621  963

Visual Studio Code Version

1.77.3
704ed70d4fd1c6bd6342c436f1ede30d1cff4710
x64

Extension Version

ms-vscode.powershell@2023.4.0

Steps to Reproduce

Visuals

image

Logs

Logs.zip

SydneyhSmith commented 1 year ago

Thanks @prpercival for opening this issue, sorry to hear that you are hitting a bug, in the next month or so we have a big PR coming in to make some fixes to debugging that may or may not fix this issue, we will let you know when that is in and you can test it out...in the meantime feel free to try and see if this repros in PowerShell 7

prpercival commented 1 year ago

I appreciate the response and look forward to testing out the fixes!

kornflex commented 10 months ago

Same problem for me :/

elmidwill commented 10 months ago

Was there ever a solution for this.

prpercival commented 10 months ago

I believe this issue does not occur in v2023.6.0 (current is v2023.8.0). You could try downgrading the extension and see if that works for you.

rosskouk commented 5 months ago

This issue still exists in v2024.2.2, are there any plans to fix the issue? This feature would be a big selling point in trying to migrate users from ISE.

Downgrading to version v2023.6.0 does result in some of the variable data being available, but it isn't usable as the file disappears from the screen when a breakpoint is reached.