Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to debug F# unit test projects? #1528

Closed
OnurGumus opened this issue May 30, 2017 · 8 comments
Closed

Question: How to debug F# unit test projects? #1528

OnurGumus opened this issue May 30, 2017 · 8 comments

Comments

@OnurGumus
Copy link

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

@bernardbr
Copy link

bernardbr commented May 30, 2017

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

@OnurGumus
Copy link
Author

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

@bernardbr
Copy link

Oh! I don't know if it works with F#. Sorry!
But you can try to do something like this: #1100 (comment)

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

@gregg-miskelly
Copy link
Contributor

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.

@gregg-miskelly gregg-miskelly changed the title Question: How to debug unit test projects? Question: How to debug F# unit test projects? May 30, 2017
@DustinCampbell
Copy link
Member

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

@OnurGumus
Copy link
Author

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

@DustinCampbell
Copy link
Member

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

@DustinCampbell
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants