ionide / ionide-vscode-fsharp

VS Code plugin for F# development
http://ionide.io
MIT License
850 stars 276 forks source link

Test debugging #1927

Closed farlee2121 closed 9 months ago

farlee2121 commented 9 months ago

WHAT

Add ability to debug unit tests from the Ionide Test Explorer.

https://github.com/ionide/ionide-vscode-fsharp/assets/2847259/7a9bbff8-56a0-4edb-b480-0a7276d30a79

Debug is also available from the gutter decoration image

HOW

Add a new test run profile for debugging. When the debugging profile is selected,

  1. set the right environment variable for vstest to return the processId (and wait for a debugger to attach)
  2. parse the processId out of the output
  3. attach to that process with a vscode attach profile
  4. workbench.action.debug.continue to get past the stop on entry that can be confusing

I tested to make sure it works across frameworks (Expecto, XUnit, etc) and when multiple projects are run.