zed-godot-enhancedv1.2.0

CASOONOpen Source

Write Godot games in Zed: GDScript language server, debugger and scene outlines.

A Zed extension that connects Zed to the language server and debug adapter built into the Godot editor, and adds syntax highlighting and outlines for GDScript, GDShader and Godot resource files. It builds on GDQuest’s zed-gdscript.

git clone https://github.com/casoon/zed-godot-enhanced.git
MITv1.2.0Godot 3.x and 4.xRust → wasm32-wasip1
class_name Player
extends CharacterBody2D

signal died

@export var health: int = 100


func take_damage(amount: int) -> void:
	health -= amount
	if health <= 0:
		died.emit()

tests/fixtures/godot_project/

[gd_scene load_steps=2 format=3]

[ext_resource type="Script" path="res://main.gd" id="1_main"]

[node name="Main" type="Node2D"]
script = ExtResource("1_main")

[node name="Player" type="CharacterBody2D" parent="."]

[node name="StartButton" type="Button" parent="."]
text = "Start"

[connection signal="pressed" from="StartButton" to="." method="_on_start_pressed"]

tests/fixtures/godot_project/

shader_type canvas_item;

uniform vec4 glow_color : source_color = vec4(1.0, 0.8, 0.2, 1.0);
uniform float strength = 0.5;

void fragment() {
	vec4 tex = texture(TEXTURE, UV);
	COLOR = mix(tex, glow_color, strength * tex.a);
}

tests/fixtures/godot_project/

languages: GDScript, GDShader, Godot Resource
3
file extensions, from .gd to .tscn
8
Godot’s LSP port, used by default; the debugger uses 6006
6005
Rust unit tests, run in CI with clippy and the WASM build
28

How it works

Godot stays the source of truth

The extension does not analyse GDScript itself. It forwards Zed’s requests to the Godot editor, which already knows your project, its classes and its autoloads.

  1. Godot editor

    127.0.0.1:6005

    Language server

    Godot runs its GDScript language server while the project is open in the editor.

  2. Bridge

    nc · ncat · socat

    TCP to stdio

    Zed talks to language servers over stdio; the extension starts the first of the three tools it finds on PATH.

  3. Zed

    extension.wasm

    Labels and settings

    The extension passes host, port and workspace settings through and highlights completion and symbol labels.

  4. Editor

    .gd · .tscn · .gdshader

    What you get

    Completion, hover, go to definition, outlines, and debugging from the Zed Debug UI.

What the language server gives you

Debugging

Launch and attach from the Zed Debug UI

Godot’s debug adapter (port 6006) is registered with Zed. A .zed/debug.json entry is all it takes; project defaults to the workspace root.

Launch the project
[
  {
    "adapter": "godot",
    "label": "Godot (Launch)",
    "request": "launch"
  }
]
Starts the main scene, like F5 in Godot.
One scene, with debug drawing
[
  {
    "adapter": "godot",
    "label": "Main scene",
    "request": "launch",
    "scene": "res://main.tscn",
    "debug_collisions": true
  }
]
Godot’s run flags are in the schema, so Zed completes them.
Attach to a running game
[
  {
    "adapter": "godot",
    "label": "Godot (Attach)",
    "request": "attach"
  }
]
Connects to a game that is already running.

Scenes, resources, shaders

Outlines for .tscn, .tres and .gdshader

The outline panel lists the sections of scene and resource files and the functions and uniforms of shaders, so you jump instead of scrolling. With gdshader-lsp installed, shaders also get diagnostics, completion and hover.

main.tscn
[gd_scene load_steps=2 format=3]

[ext_resource type="Script" path="res://main.gd" id="1_main"]

[node name="Main" type="Node2D"]
script = ExtResource("1_main")

[node name="Player" type="CharacterBody2D" parent="."]

[node name="StartButton" type="Button" parent="."]
text = "Start"

[connection signal="pressed" from="StartButton" to="." method="_on_start_pressed"]
Outline panel · main.tscn
ext_resource  "1_main"
node          "Main"
node          "Player"
node          "StartButton"
connection    "pressed"
glow.gdshader
shader_type canvas_item;

uniform vec4 glow_color : source_color = vec4(1.0, 0.8, 0.2, 1.0);
uniform float strength = 0.5;

void fragment() {
	vec4 tex = texture(TEXTURE, UV);
	COLOR = mix(tex, glow_color, strength * tex.a);
}
Outline panel · glow.gdshader
uniform  glow_color
uniform  strength
fragment

What it adds to zed-gdscript

zed-godot-enhanced started as a fork of GDQuest’s extension. The grammars are the same; the differences are in the Zed integration.

FeatureGDQuest/zed-gdscriptzed-godot-enhanced
Highlighted completion and symbol labelsNoYes
Zed Debug UI scenarios and task locatorNoYes
`project` resolved from the workspace or a subfolderNoYes
Outline for `.tscn`, `.tres`, `.godot`NoYes
`class_name` and shader `uniform` in the outlineNoYes
`lsp.gdscript.settings` for host and port, `socat` fallbackNoYes
Headless language server and run buttonsNoYes
GDShader language server (gdshader-lsp)NoYes
In the Zed extension registryYesNo, installed as a dev extension

Highlighted completion and symbol labels

GDQuest/zed-gdscriptNo

zed-godot-enhancedYes

Zed Debug UI scenarios and task locator

GDQuest/zed-gdscriptNo

zed-godot-enhancedYes

`project` resolved from the workspace or a subfolder

GDQuest/zed-gdscriptNo

zed-godot-enhancedYes

Outline for `.tscn`, `.tres`, `.godot`

GDQuest/zed-gdscriptNo

zed-godot-enhancedYes

`class_name` and shader `uniform` in the outline

GDQuest/zed-gdscriptNo

zed-godot-enhancedYes

`lsp.gdscript.settings` for host and port, `socat` fallback

GDQuest/zed-gdscriptNo

zed-godot-enhancedYes

Headless language server and run buttons

GDQuest/zed-gdscriptNo

zed-godot-enhancedYes

GDShader language server (gdshader-lsp)

GDQuest/zed-gdscriptNo

zed-godot-enhancedYes

In the Zed extension registry

GDQuest/zed-gdscriptYes

zed-godot-enhancedNo, installed as a dev extension

Current limits

What to know before installing

  • Not in the Zed extension registry: you build it once and install it as a dev extension.
  • Language features need Godot: an open editor with the language server enabled, or headless mode on macOS and Linux.
  • nc, ncat or socat must be on PATH; the extension does not ship a bridge.
  • Shader diagnostics and completion need gdshader-lsp on PATH; the extension does not download it.
  • Formatting is not part of the extension; Zed runs an external formatter such as gdscript-formatter.

Quickstart

From clone to completion in four steps. The installation guide has the details per platform.

  1. Install Rust with the wasm32-wasip1 target and nc, ncat or socat.
  2. Clone the repository and run cargo build --release --target wasm32-wasip1.
  3. In Zed: Extensions → Install Dev Extension… and pick the folder.
  4. In Godot, enable the language server (Editor Settings → Network → Language Server) and open a .gd file in Zed.
Terminal
git clone https://github.com/casoon/zed-godot-enhanced.git
cd zed-godot-enhanced
rustup target add wasm32-wasip1
cargo build --release --target wasm32-wasip1

New in v1.2.0

Changelog →

Set up Godot in Zed.

Read the installation guide