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

Make it easier to run and debug the project entirely from VSCode #163

Closed
G-Fuchter opened this issue Apr 10, 2020 · 1 comment
Closed

Make it easier to run and debug the project entirely from VSCode #163

G-Fuchter opened this issue Apr 10, 2020 · 1 comment

Comments

@G-Fuchter
Copy link

I always disliked the idea of having to switch constantly between godot and vscode to be able to debug a project. Because of this slight annoyance, I took it upon myself of finding a way to be able to write my C# scripts from vscode and debug them with the touch of a single button. Without having to configure the "Wait for debugger" nor have to switch to the godot window to build it.

Thanks to this article I managed to create my simple task.json and settings.json in order to build and debug my C# project from VSCode. Would it be possible for the extension to create (or at least make it easier to create) the json files necessary in the project's folder?

Here are my JSON files:
launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Run",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "[insert path to godot executable here]",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "console": "internalConsole",
            "internalConsoleOptions": "openOnSessionStart"
        },
        {
            "name": "Attach",
            "type": "mono",
            "request": "attach",
            "address": "localhost",
            "port": "[insert port given by godot here]",
            "internalConsoleOptions": "neverOpen",
        }
    ],
    "compounds": [
        {
            "name": "Run and attach",
            "configurations": [
                "Attach",
                "Run",
            ]
        }
    ]
}

task.json

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build",
            "type": "shell",
            "command": "[Insert path to msbuild.exe or mono-build]",
            "args": [
                // Ask msbuild to generate full paths for file names.
                "/p:Configuration=Tools;Platform=Any CPU;GenerateFullPaths=true",
                "/t:Build;"
                // Do not generate summary otherwise it leads to duplicate errors in Problems panel
                //"/consoleloggerparameters:NoSummary"
            ],
            "group": "build",
            "presentation": {
                // Reveal the output only if unrecognized errors occur.
                "reveal": "silent"
            },
            // Use the standard MS compiler pattern to detect errors, warnings and infos
            "problemMatcher": "$msCompile"
        }
    ]
}

These json files should be inside the .vscode folder inside of the project's folder.

@Calinou Calinou changed the title Feature Request: Make it easier to run and debug the project entirely from VSCode Make it easier to run and debug the project entirely from VSCode Apr 10, 2020
@DaelonSuzuka
Copy link
Collaborator

This extension doesn't support the development or debugging of C#/mono. It's only for GDScript.

That said, extension version 2.0.0 overhauls the GDScript debugger, making it significantly easier to configure and use.

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

3 participants