Skip to content

Debugger not enganged when running from another plugin #932

@bitwes

Description

@bitwes

Godot version

4.5

VS Code version

1.104.3

Godot Tools VS Code extension version

2.5.1

System information

MacOS 15.6.1

Issue description

Greetings. I'm the author of the GUT plugin and extension. After spinning my wheels for a couple hours I thought I'd ask for help. As of 4.5 it appears the debugger isn't connecting when I run tests through the debugger (bitwes/gut-extension#43). If a breakpoint or error is encountered the debugger isn't being invoked and Godot appears to hang.

Here's the code I've been using to launch the debugger from https://github.com/bitwes/gut-extension/blob/master/src/gut-tools.ts

...

class GodotDebugConfiguration implements vscode.DebugConfiguration{
    public type = "godot";
    public name = "GUT Debugger";
    public request = "launch";
    public project = "${workspaceFolder}";
    public port = 6007;
    public address = "127.0.0.1";
    public launch_game_instance = true;
    public launch_scene = false;
    public additional_options = "";

    public useGodotExtensionSettings(){
        this.port = utils.getGodotConfigurationValue("lsp.serverPort", this.port);
        this.address = utils.getGodotConfigurationValue("lsp.serverHost", this.address);
    }
}

...

    private async runGutDebugger(options:string = "") {
        var debuggerSearch : vscode.Uri[] = await vscode.workspace.findFiles("**/addons/gut/gut_vscode_debugger.gd");
        var gutScript = "gut_cmdln.gd";
        if(debuggerSearch.length === 1){
            gutScript = "gut_vscode_debugger.gd";
        }

        let config = new GodotDebugConfiguration();
        config.useGodotExtensionSettings();
        config.additional_options = ` -s \"res://addons/gut/${gutScript}\" `;
        config.additional_options += options;
        vscode.debug.startDebugging(undefined, config);
    }

Any pointers would be greatly appreciated. I barely remember how my code works and I got lost quickly since the last time I was poking around this project.

Great job btw.

Steps to reproduce

Godot Setup

VSCode

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions