ionide / ionide-vscode-fsharp

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

No default debug configuration #2009

Open Eliemer opened 2 months ago

Eliemer commented 2 months ago

Describe the bug

when starting a fresh project and going to the "debug and run" pane, there's no longer any Ionide automatic configurations in the dropdowns.

Steps to reproduce

  1. New dotnet project
  2. Open "Run and Debug" pane
  3. click "Show all automatic debug configurations"

Expected behaviour

There should be Ionide configs in that dropdown.

Screenshots

image

Machine info

TheAngryByrd commented 2 months ago

@baronfel is this something we have to pester the C# plugin about?

baronfel commented 2 months ago

Ours should be under the .NET Core drop-down selection there, IIRC?

Eliemer commented 2 months ago

When i click the .NET Core dropdown i get an empty search bar i think? image

That said, when i manually run F#: Debug default project everything works as intended.

TheAngryByrd commented 1 month ago

So it seems like the C# plugin is just ignoring all fsproj files in any of their pickers.

You'll have to click create a launch.json file

image

It'll still pop up some selection. Just choose something to get the file created. This seems like a VSCode UX problem where it won't just create the file for you.

image

You might have something in the file already configured, otherwise just clear it so it's nice and pristine:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": []
}

You can then type in the configuration array and find some .NET configurations.

image

Selecting something like console and filling in the bits for the dll path should result in something like:

{

    "version": "0.2.0",
    "configurations": [
        {
            "name": ".NET Core Launch (console)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${workspaceFolder}/bin/Debug/net8.0/fsharp-playground",
            "args": [],
            "cwd": "${workspaceFolder}",
            "stopAtEntry": false,
            "console": "internalConsole"
        }
    ]
}

It should then show up in the panel for you click on:

image

Then you should be able to debug.

image


Be sure to use the coreclr type. And of course you can't use dotnet to select an fsproj

image

https://twitter.com/dotnetiscsharp

roboz0r commented 1 month ago

The following works for me as a manual workaround to achieve F5 debugging:

./.vscode/launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": ".NET Core Launch (console)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build FSDebugging.fsproj",
            "program": "${workspaceFolder}/bin/Debug/net8.0/FSDebugging.dll",
            "args": [],
            "cwd": "${workspaceFolder}",
            "stopAtEntry": false,
            "console": "internalConsole"
        }
    ]
}

./.vscode/tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build FSDebugging.fsproj",
            "type": "shell",
            "command": "dotnet build ${workspaceFolder}/FSDebugging.fsproj",
            "problemMatcher": []
        }
    ]
}