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:
- Turn on Enable Language Server.
- Host:
127.0.0.1 - 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 whengodotorgodot4is onPATH.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.pathturns 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:
- Turn on Use External Editor.
- Exec Path:
/Applications/Zed.app/Contents/MacOS/zedon macOS, or thezedbinary on Linux. - Exec Flags:
{project} {file}:{line}:{col}