Skip to content

DAP support F#

Zeioth edited this page Aug 24, 2023 · 4 revisions

In order to debug your programs, you have to compile them as described next

The easy way: Using dotnet

This is only available if your project has a .fsproj file. Compiling with the options Build and run dotnet or Build dotnet will automatically generate the necessary runtimeconfig.json file. So the only thing you have to do is to insert a breakpoint on neovim, open DAP, and select the .dll file that has been generated along with your .exe.

For more info read DAP wiki.

How to setup DAP to debug with F#

Please note that this section has nothing to do with compiler.nvim. I'm documenting this to make your life easier. To debug F# with DAP you have to:

How to check if everything works

Compile your program with Build dotnet, add a break point to your code, and then run DAP. You will see something like this.

screenshot_2023-08-24_07-15-09_302654364

Congratulations, now you can compile and debug F#.

Important for you to know

  • Note that mason installs the debugger for you. You don't need to install any system dependency.
  • If you find any issue while configuring DAP, run :DapSetLogLevel trace and :DapShowLog to find the reason.