zed-gdscript icon indicating copy to clipboard operation
zed-gdscript copied to clipboard

Run game from editor

Open kraftwer1 opened this issue 1 year ago • 4 comments

I love your work, thanks a lot! It brings a lot of efficiency and joy into my everyday life.

I'm submitting a...

  • [ ] Bug report.
  • [x] Feature request.

Feature request

Describe the problem you're trying to solve.

Improve the development workflow.

Tell us which solutions you've explored, the solution you would pick, and why you think it would be the best for everyone.

It'd be really great if the game can be launched, restarted or stopped from within Zed. I find myself constantly switching between Zed and Godot only to run the game.

I don't know what's possible in terms of communicating or if Godot even offers an API for that. My inspiration was the editor: restart language server command that seems to be able to tell Godot to restart the LSP. Maybe it could tell it other things, too! ;-)

BONUS if it'd also work for EditorScripts.

Other

Other information

kraftwer1 avatar Nov 26 '24 05:11 kraftwer1

That'll be good to have, definitely! Currently I don't think Zed offers too many tools for plugin developers. For this, you need an API on Zed's side to run a command in the terminal, keep track of if the program stays alive, and kill the running program from Zed. It's all technically possible in Godot but as far as I know not possible yet on Zed's side.

NathanLovato avatar Nov 26 '24 14:11 NathanLovato

You could run godot from zed by specifying it as a task in tasks.json https://zed.dev/docs/tasks. Same as if you'd run it from command line. Like "command": "godot ." And once its run its alt+t to re-run a task in zed.

kyle-wannacott avatar Apr 03 '25 18:04 kyle-wannacott

It's a good point, it's true we could do some useful things with tasks already. Here are two that I'd use personally:

  1. Open the project in the editor (regardless of the file you're looking at)
  2. Run the game (again, regardless of the file you're looking at)

Restarting or stopping the running game from Zed through tasks, that's possible but would probably take a little external program to find and kill a process that corresponds to the currently edited Godot project in zed.

Are there other specific commands you'd like to have ideally?

NathanLovato avatar Apr 05 '25 12:04 NathanLovato

Just putting this here for later reference: We can add a tasks.json file directly in the extension/language definition to add tasks available from any gdscript or tscn file: https://zed.dev/blog/zed-decoded-tasks

NathanLovato avatar Jul 02 '25 07:07 NathanLovato