godot-docs icon indicating copy to clipboard operation
godot-docs copied to clipboard

Open editor with a script

Open antonWetzel opened this issue 3 years ago • 5 comments

Closed Related Proposal #4476

Use a scripting language to start the external editor (or anything else).

The script (and shebang behavior) is not tested on linux and macOS.

antonWetzel avatar May 03 '22 20:05 antonWetzel

I think it'd be better to use a Python script for this, rather than GDScript. This way, it doesn't rely on the current Godot version installed on the system (and suffer from any bugs it may have). This will probably be a bit faster as well, and it won't require hacks related to the window size.

Calinou avatar May 03 '22 22:05 Calinou

@Calinou I don't know how many users have python avaible; For Windows it is not avaible by default. I could change the code block to have different tabs for Python, GDScript, (Node JS?, Deno TS?), so everyone can choose the preferred langauge.

antonWetzel avatar May 04 '22 07:05 antonWetzel

@Calinou I don't know how many users have python avaible; For Windows it is not avaible by default. I could change the code block to have different tabs for Python, GDScript, (Node JS?, Deno TS?), so everyone can choose the preferred langauge.

We shouldn't spend too much time maintaining this kind of script, so I'd vouch for including only a Python script. Installing Python on Windows is relatively straightforward by now, as long as the script only uses packages available within the standard library (no pip packages).

Calinou avatar May 04 '22 15:05 Calinou

I wrote the scripts for Python, Javascript (Node) and Typescript (Deno); They all only use the standard library. One of the languages should always be avaible.

antonWetzel avatar May 04 '22 16:05 antonWetzel

FYI, I made a script similar to @antonWetzel (in Python) back on https://github.com/godotengine/godot-proposals/issues/4476 and I just published a blog about it: https://www.snopekgames.com/tutorial/2022/how-make-godot-open-vs-code-workspace-if-project-has-one

Given how much personal preference is connected with the scripting language used AND the rules for deciding what workspace to open (I use slightly different rules than @antonWetzel because I sometimes put my *.code-workspace files in the .vscode directory to keep things tidy), I'm a little skeptical of trying to put the actual script in the official docs. This might be better in a place where folks can post comments and discuss?

dsnopek avatar May 11 '22 14:05 dsnopek

Closed because low interrest. See https://www.snopekgames.com/tutorial/2022/how-make-godot-open-vs-code-workspace-if-project-has-one for solution

antonWetzel avatar Aug 15 '22 17:08 antonWetzel