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

Looking for a maintainer #244

Closed
Calinou opened this issue Oct 27, 2020 · 8 comments
Closed

Looking for a maintainer #244

Calinou opened this issue Oct 27, 2020 · 8 comments

Comments

@Calinou
Copy link
Member

Calinou commented Oct 27, 2020

The original maintainer of this add-on (@Geequlim) no longer has time to dedicate to this extension's maintenance. As you can see in this repository's issue tracker, bugs have been piling up and it seems nobody knows how to fix them.

We would like to find a new maintainer, but none of the Godot core developers have experience maintaining Visual Studio Code extensions. This requires TypeScript programming knowledge. On top of that, the maintainer should ideally also have C++ knowledge to fix bugs and improve the language server on the editor side (but this is not required).

If you're interested in becoming a maintainer, open a few pull requests to fix the existing bugs and we can consider giving you write access to this repository.

@Calinou Calinou pinned this issue Oct 27, 2020
@kevin-holbrook-epicor
Copy link

It's unfortunate, but this extension has become almost unusable.
As of Godot 3.3 RC7 it causes numerous problems with the language server.
You will get lots of "Cannot open file", "Failed to parse script", "Can't preload resource", or "Failed loading resource" errors.
In some cases it will start to trigger recursive resource load warnings.
It also does not work properly with signal function generation from Godot editor.

Debugging with VS Code was nice while it lasted.

@oleg-butko
Copy link

I have tried this extension with Godot 4.0 and at least some basic functions work, like running current project (like F5 in Godot) and watching console output in vscode console. Had to look at Godot's source code to find new port number (6005). Also there is an issue that F5 causes disconnect from language server. Htre is some code which shows how to fix it (new param "name" in open_workspace_with_editor):

modified out/godot-tools.js (it's easier to modify the generated godot-tools.js and then reload vscode window, skipping compilation of godot-tools.ts)

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GodotTools = void 0;
const vscode = require("vscode");
const path = require("path");
const fs = require("fs");
const GDScriptLanguageClient_1 = require("./lsp/GDScriptLanguageClient");
const utils_1 = require("./utils");
const loggger_1 = require("./loggger");
const CONFIG_CONTAINER = "godot_tools";
const TOOL_NAME = "GodotTools";
const TOOL_NAME_RUN = "Godot Run";
class GodotTools {
    constructor(p_context) {
        this.client = null;
        this.workspace_dir = vscode.workspace.rootPath;
        this.project_file = "project.godot";
        this.connection_status = null;
        this.context = p_context;
        this.client = new GDScriptLanguageClient_1.default(p_context);
        this.client.watch_status(this.on_client_status_changed.bind(this));
        this.connection_status = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right);
    }
    activate() {
        vscode.commands.registerCommand("godot-tool.open_editor", () => {
            this.open_workspace_with_editor("-e", TOOL_NAME).catch(err => vscode.window.showErrorMessage(err));
        });
        vscode.commands.registerCommand("godot-tool.run_project", () => {
            this.open_workspace_with_editor("", TOOL_NAME_RUN).catch(err => vscode.window.showErrorMessage(err));
        });
        vscode.commands.registerCommand("godot-tool.check_status", this.check_client_status.bind(this));
        vscode.commands.registerCommand("godot-tool.set_scene_file", this.set_scene_file.bind(this));
        this.connection_status.text = "$(sync) Initializing";
        this.connection_status.command = "godot-tool.check_status";
        this.connection_status.show();
        this.client.connect_to_server();
    }
    deactivate() {
        this.client.stop();
    }
    open_workspace_with_editor(params = "", name) {
        return new Promise((resolve, reject) => {
            let valid = false;
            if (this.workspace_dir) {
                let cfg = path.join(this.workspace_dir, this.project_file);
                valid = (fs.existsSync(cfg) && fs.statSync(cfg).isFile());
            }
            if (valid) {
                this.run_editor(`--path "${this.workspace_dir}" ${params}`, name).then(() => resolve()).catch(err => {
                    reject(err);
                });
            }
            else {
                reject("Current workspace is not a Godot project");
            }
        });
    }
    set_scene_file(uri) {
        let right_clicked_scene_path = uri.fsPath;
        let scene_config = utils_1.get_configuration("scene_file_config");
        if (scene_config == right_clicked_scene_path) {
            scene_config = "";
        }
        else {
            scene_config = right_clicked_scene_path;
        }
        utils_1.set_configuration("scene_file_config", scene_config);
    }
    run_editor(params = "", name) {
        return new Promise((resolve, reject) => {
            const run_godot = (path, params) => {
                const escape_command = (cmd) => {
                    let cmdEsc = `"${cmd}"`;
                    if (process.platform === "win32") {
                        const POWERSHELL = "powershell.exe";
                        const POWERSHELL_CORE = "pwsh.exe";
                        const shell_plugin = vscode.workspace.getConfiguration("terminal.integrated.shell");
                        let shell = (shell_plugin ? shell_plugin.get("windows", POWERSHELL) : POWERSHELL) || POWERSHELL;
                        if (shell.endsWith(POWERSHELL) || shell.endsWith(POWERSHELL_CORE)) {
                            cmdEsc = `&${cmdEsc}`;
                        }
                    }
                    return cmdEsc;
                };
                // let existingTerminal = vscode.window.terminals.find(t => t.name === TOOL_NAME_RUN);
                let existingTerminal = vscode.window.terminals.find(t => t.name === name);
                if (existingTerminal) {
                    existingTerminal.dispose();
                }
                /*
                console.log("testing_output_123");
                console.error("testing_output_123");
                vscode.window.terminals.find(t => {
                  loggger_1.default.log("testing_output_123", t.name);
                  console.error(t.name);
                });
                */

                // let terminal = vscode.window.createTerminal(TOOL_NAME);
                let terminal = vscode.window.createTerminal(name);
                let editorPath = escape_command(path);
                let cmmand = `${editorPath} ${params}`;
                terminal.sendText(cmmand, true);
                terminal.show();
                // macros.returnToEditorAfterGodotRun
                /* "returnToEditorAfterGodotRun": [
                       {"command": "$delay", "args": {"delay": 500}},
                       "workbench.action.focusLastEditorGroup",
                   ], */
                vscode.commands.executeCommand('macros.returnToEditorAfterGodotRun');
                resolve();
            };
            let editorPath = utils_1.get_configuration("editor_path", "");
            editorPath = editorPath.replace("${workspaceRoot}", this.workspace_dir);
            if (!fs.existsSync(editorPath) || !fs.statSync(editorPath).isFile()) {
                vscode.window.showOpenDialog({
                    openLabel: "Run",
                    filters: process.platform === "win32" ? { "Godot Editor Binary": ["exe", "EXE"] } : undefined
                }).then((uris) => {
                    if (!uris) {
                        return;
                    }
                    let path = uris[0].fsPath;
                    if (!fs.existsSync(path) || !fs.statSync(path).isFile()) {
                        reject("Invalid editor path to run the project");
                    }
                    else {
                        run_godot(path, params);
                        utils_1.set_configuration("editor_path", path);
                    }
                });
            }
            else {
                run_godot(editorPath, params);
            }
        });
    }
    check_client_status() {
        switch (this.client.status) {
            case GDScriptLanguageClient_1.ClientStatus.PENDING:
                vscode.window.showInformationMessage("Connecting to the GDScript language server...");
                break;
            case GDScriptLanguageClient_1.ClientStatus.CONNECTED:
                vscode.window.showInformationMessage("Connected to the GDScript language server.");
                break;
            case GDScriptLanguageClient_1.ClientStatus.DISCONNECTED:
                this.retry_connect_client();
                break;
        }
    }
    on_client_status_changed(status) {
        switch (status) {
            case GDScriptLanguageClient_1.ClientStatus.PENDING:
                this.connection_status.text = `$(sync) Connecting`;
                this.connection_status.tooltip = `Connecting to the GDScript language server...`;
                break;
            case GDScriptLanguageClient_1.ClientStatus.CONNECTED:
                this.connection_status.text = `$(check) Connected`;
                this.connection_status.tooltip = `Connected to the GDScript language server.`;
                if (!this.client.started) {
                    this.context.subscriptions.push(this.client.start());
                }
                break;
            case GDScriptLanguageClient_1.ClientStatus.DISCONNECTED:
                this.connection_status.text = `$(x) Disconnected`;
                this.connection_status.tooltip = `Disconnected from the GDScript language server.`;
                // retry
                this.retry_connect_client();
                break;
            default:
                break;
        }
    }
    retry_connect_client() {
        vscode.window.showErrorMessage(`Couldn't connect to the GDScript language server.`, 'Open Godot Editor', 'Retry', 'Ignore').then(item => {
            if (item == 'Retry') {
                this.client.connect_to_server();
            }
            else if (item == 'Open Godot Editor') {
                this.client.status = GDScriptLanguageClient_1.ClientStatus.PENDING;
                this.open_workspace_with_editor("-e").then(() => {
                    setTimeout(() => {
                        this.client.connect_to_server();
                    }, 10 * 1000);
                });
            }
        });
    }
}
exports.GodotTools = GodotTools;
//# sourceMappingURL=godot-tools.js.map

@rakkarage
Copy link
Contributor

Thanks.

Screenshot (4)

Got it working just setting the port to the one mentioned and pointing to the exe...

@DaelonSuzuka
Copy link
Collaborator

I'm willing to adopt this project if you guys are still looking for a maintainer.

@Calinou
Copy link
Member Author

Calinou commented Feb 12, 2022

I'm willing to adopt this project if you guys are still looking for a maintainer.

We are still looking for a maintainer, but you need to be an existing contributor to the plugin already. We can only add someone we trust as a maintainer 🙂

@DaelonSuzuka
Copy link
Collaborator

DaelonSuzuka commented Feb 12, 2022

Yes, I know that. I submitted a PR last night, and I've got about 5 more on the way.

If there's nobody available to review these PRs so I can actually become a contributor, then I guess I'll just publish and maintain my own fork. I'm going to fix this extension either way.

@Torguen
Copy link

Torguen commented Aug 8, 2022

There seems to be a maintainer so why is this message still pinned as important
Captura
?

@Calinou
Copy link
Member Author

Calinou commented Aug 8, 2022

There seems to be a maintainer so why is this message still pinned as important

Indeed, I think this can be closed now. Thanks @DaelonSuzuka for their continued contributions on the extension 🙂

@Calinou Calinou closed this as completed Aug 8, 2022
@DaelonSuzuka DaelonSuzuka unpinned this issue Aug 12, 2022
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

6 participants