Omnisharp-vscode: Question: How to debug F# unit test projects?

Created on 30 May 2017  路  8Comments  路  Source: OmniSharp/omnisharp-vscode

I would appreciate a tutorial regarding how to debug the unit tests.

Debugger Question

All 8 comments

Nowadays you can debug only one test per time (using code lens). I have a repository with a little example of unit tests and NUnit.

You will only need:

  • Last vscode version
  • Last omnisharp version
  • Netcore 1.1

Forgot to mention, I use F#. And there is no code lens there for debugging :(
Any manual ways?

Oh! I don't know if it works with F#. Sorry!
But you can try to do something like this: https://github.com/OmniSharp/omnisharp-vscode/issues/1100#issuecomment-285437481

Surely @DustinCampbell knows if debug unit test is supported with F#.

If F# doesn't have code lens support - there isn't any nice way to debug unit tests. The best that can be done would be to add the equivalent of while (!Debugger.IsAttached) Thread.Sleep(100); to the start of the test and then attach.

C# for VS Code does not support F#. This question is probably better asked in https://github.com/ionide/ionide-vscode-fsharp.

Actually omnisharp works great to debug f# apps. It's just the testing is missing.

Terminology clarification: "OmniSharp" does not work with F# at all. OmniSharp is a language server for providing language service information (e.g. completion list, signature help, etc.) for C# editors _only_. This repo is not "OmniSharp", it is "C# for VS Code", which is part of the OmniSharp organization on GitHub.

The fact that debugger included in C# for VS Code works for F# is because it is a proper .NET Core debugger. However, we don't have any special code here to make it work for F# and unit test debugging is heavily dependent on OmniSharp, which doesn't have support for F# at all. cc @enricosada

Closing this issue. There really isn't anything we can do here except add full F# support, which is really what Ionide is for. However, Ionide could add support.

Was this page helpful?
0 / 5 - 0 ratings