Vscode-powershell: Add support for module debugging

Created on 28 Nov 2016  路  4Comments  路  Source: PowerShell/vscode-powershell

We should add support for module debugging by allowing the user to easily set the .psd1 file in their launch.json without having to edit it manually. If we add a new VS Code command like "Select module (.psd1) to be debugged", we could display a quick pick dialog that lists all of the .psd1 files found in the workspace. The user can select one of those and their launch.json will be updated automatically. The next time they hit F5, the debugger will load their module and then allow them to type commands in the debug console (or integrated terminal once that's ready) to exercise their module code.

This corresponds to https://github.com/PowerShell/PowerShellEditorServices/issues/305.

Issue-Enhancement

Most helpful comment

Yep, ultimately we will stop using the "Debug Console" and start using the integrated terminal for the PowerShell debugging experience. Work on that is starting soon.

In the meantime, an update later this week (0.9.0) will provide an "interactive" debugging mode which uses the existing Debug Console interface, basically just allowing you to start a new PowerShell session without running a specific script. From there you can import a module and debug it however you wish.

All 4 comments

After discussing this with @rkeithhill, we decided this might not be necessary once the interactive console is back. Holding off until we have an interactive console and can try it out.

I am quite interested to see this functionality added, and how it would work. When you refer to access to the interactive console do you mean supporting the "console" setting in the launch.json file as noted in VS Code docs?

console - what kind of console to use, e.g. internalConsole, integratedTerminal, externalTerminal.

Yep, ultimately we will stop using the "Debug Console" and start using the integrated terminal for the PowerShell debugging experience. Work on that is starting soon.

In the meantime, an update later this week (0.9.0) will provide an "interactive" debugging mode which uses the existing Debug Console interface, basically just allowing you to start a new PowerShell session without running a specific script. From there you can import a module and debug it however you wish.

This has been fixed with the addition of the Interactive Console and the launch.json "PowerShell Interactive Session" debugging config:

        {
            "type": "PowerShell",
            "request": "launch",
            "name": "PowerShell Interactive Session",
            "cwd": "${workspaceRoot}"
        }

Please open a new issue if you see any trouble with this.

Was this page helpful?
0 / 5 - 0 ratings