microsoft / vscode-mono-debug

A simple VS Code debug adapter for mono
Other
159 stars 173 forks source link

Add .cake extension to supported debug file types #39

Closed Redth closed 7 years ago

Redth commented 7 years ago

Currently, trying to debug Cake.exe while executing .cake script files will not hit any breakpoints set inside of VS Code since the file type is not supported.

Adding the file extension .cake to this list of supported extensions allows us to launch Cake.exe with the mono soft debugger, and subsequently attach to it with this extension to debug our cake scripts.

Here's a screenshot of a cake script with breakpoints working after this change: image

Finally, here's how we're launching and attaching via cake if anyone's interested in seeing it:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "StartCake",
            "type": "mono",
            "request": "launch",
            "program": "${workspaceRoot}/tools/Cake/Cake.exe",
            "runtimeArgs": [
                "--debug",
                "--debugger-agent=transport=dt_socket,server=y,address=127.0.0.1:55556"
            ],
            "args": [
                "${workspaceRoot}/build.cake",
                "--verbosity=diagnostic",
                "--debug"
            ],
            "cwd": "${workspaceRoot}",
            "console":"internalConsole",
            "noDebug": true
        },
       {
            "name": "AttachCake",
            "type": "mono",
            "request": "attach",
            "address": "localhost",
            "port": 55556
        }
    ],
     "compounds": [
        {
            "name": "DebugCake",
            "configurations": ["StartCake", "AttachCake"]
        }
    ]
}
weinand commented 7 years ago

Thanks a lot for the PR!