zed-godot-enhancedv1.2.0

Configuration

Enable Godot's language server, set host and port in Zed, and open files in Zed from Godot.

Enable the language server in Godot

In the Godot editor, open Editor → Editor Settings → Network → Language Server:

  1. Turn on Enable Language Server.
  2. Host: 127.0.0.1
  3. Port: 6005 (default)

Keep the project open in Godot while you work in Zed. Completion, hover and go to definition come from this server.

Zed settings

Without settings the extension connects to 127.0.0.1:6005. To change that, add to ~/.config/zed/settings.json:

{
  "lsp": {
    "gdscript": {
      "settings": {
        "host": "127.0.0.1",
        "port": 6005
      }
    }
  }
}

The host must be an IPv4 address or localhost, the port between 1 and 65535. The extension also sends settings to Godot as workspace configuration, and initialization_options as initialization options.

To run your own bridge command, set lsp.gdscript.binary (path, arguments, env); the extension then uses it instead of searching for nc, ncat or socat.

Without the Godot editor (headless)

With headless on, the extension starts Godot itself as a language server without a window (godot --headless --editor --lsp-port <port>) when nothing listens on the port yet, and stops it when Zed shuts the server down. If a Godot editor already runs on that port, the extension connects to it as usual.

{
  "lsp": {
    "gdscript": {
      "settings": {
        "headless": true,
        "godot_path": "/Applications/Godot.app/Contents/MacOS/Godot",
        "project": "."
      }
    }
  }
}
  • godot_path: optional when godot or godot4 is on PATH.
  • project: the Godot project folder, absolute or relative to the workspace root (default: the root).
  • The first start of a project imports it, which can take a few seconds.
  • macOS and Linux only; binary.path turns headless mode off.

GDScript indentation goes under languages:

{
  "languages": {
    "GDScript": {
      "tab_size": 4,
      "hard_tabs": false
    }
  }
}

Engine documentation

In Godot, turn on Editor Settings → Network → Language Server → Show Native Symbols in Editor. Run editor: go to declaration on an engine symbol such as Node2D in Zed, and Godot opens its documentation page. editor: go to definition does not open engine docs.

Open files in Zed from Godot

In Editor → Editor Settings → Text Editor → External:

  1. Turn on Use External Editor.
  2. Exec Path: /Applications/Zed.app/Contents/MacOS/zed on macOS, or the zed binary on Linux.
  3. Exec Flags: {project} {file}:{line}:{col}

Edit this page on GitHub · Docs for v1.2.0