Shaders
Diagnostics, completion and hover for .gdshader files with the GDShader language server.
.gdshader and .gdshaderinc files are highlighted and outlined without further setup. The
outline lists functions, uniform, const and struct declarations.
For diagnostics, completion, hover and go to definition in shaders, the extension starts gdshader-lsp, a standalone GDShader language server by Dead-Shrimp-Studio. The extension does not download it; install it once.
Install gdshader-lsp
- Download the binary for your system from the releases. Releases are tied to Godot versions: v0.3.x for Godot 4.7, v0.2.x for Godot 4.5 and 4.6.
- Rename it to
gdshader-lspand put it in a folder onPATH, for example~/.local/bin. - On macOS and Linux, make it executable:
chmod +x ~/.local/bin/gdshader-lsp.
Open a .gdshader file; Zed starts the server with --stdio. Without the binary, shaders keep
highlighting and the outline, and the status bar shows Failed to run gdshader; clicking it
shows where to download gdshader-lsp.
Settings
To keep the binary somewhere else, or to pass other arguments, set it in
~/.config/zed/settings.json:
{
"lsp": {
"gdshader": {
"binary": {
"path": "/path/to/gdshader_lsp_release_macos_arm64",
"arguments": ["--stdio"]
}
}
}
}
arguments replaces the default ["--stdio"], so keep --stdio in the list.
gdshader-lsp writes gdshader_lsp_log.txt into the project folder. To turn that off (v0.2.6 and
v0.3.2 or later), pass --log-path none:
{
"lsp": {
"gdshader": {
"binary": {
"arguments": ["--stdio", "--log-path", "none"]
}
}
}
}