Shader Language Server
Shader validation, diagnostics and language features for HLSL, GLSL and WGSL, powered by shader-language-server (antaalt/shader-sense).
How to install
With Forge Super installed, the button above opens the app on this extension, where you press Install. Nothing is installed until you do.
You can also open the Extensions panel in the app and search for Shader Language Server. The extension's id is shader-ls.
Don't have Forge Super yet? Download it here.
README
From the extension's repository, written by its authors and not by Mentenaz. See the source.
Shader Language Server for Zed
A Zed extension providing shader validation and language
features for HLSL, GLSL and WGSL, powered by
shader-language-server (antaalt/shader-sense).
Features
- Real-time diagnostics (
dxcfor HLSL,glslangfor GLSL,nagafor WGSL) - Completion, hover, goto definition and document/workspace symbols
- Document formatting (clang-format)
- Preprocessor-aware analysis with custom includes, defines, and per-stage defines
Supported Languages & File Types
| Language | Extensions |
|---|---|
| HLSL | .hlsl .hlsli .fx .fxh .ush .usf |
| GLSL | .glsl .vert .frag .comp .geom .tesc .tese .mesh .task |
| WGSL | .wgsl |
Installation
Search for Shader Language Server on the Zed extension registry.
Language Server Binary
The extension resolves the server binary in this order:
- An explicit path in
lsp.shader-language-server.binary.path. - A
shader-language-serverexecutable found on$PATH. - A previously downloaded copy cached by the extension.
- A fresh download of the latest antaalt/shader-sense release.
Prebuilt binaries are available for Windows x86_64, Windows aarch64, and Linux x86_64.
On other platforms, build the server from source and place it on your $PATH or set
lsp.shader-language-server.binary.path.
Configuration
All settings live under lsp.shader-language-server.settings in your Zed settings.json.
The full settings blob is passed to the server at startup via --config and also
forwarded in response to workspace/configuration requests.
{
"lsp": {
"shader-language-server": {
"settings": {
// --- Common ---
"validate": true,
"symbols": true,
"symbolDiagnostics": false,
"severity": "info", // "none" | "error" | "warning" | "info" | "hint"
"includes": [], // additional include search paths
"defines": {}, // preprocessor defines: { "MY_MACRO": "1" }
"stageDefine": { // per-stage preprocessor defines
"vertex": {},
"fragment": {},
"compute": {}
// geometry | tesselationControl | tesselationEvaluation | mesh | task
// rayGeneration | closestHit | anyHit | callable | miss | intersect
},
"pathRemapping": {},
"configOverride": "",
// --- HLSL ---
"hlsl": {
"enabled": true,
"shaderModel": "ShaderModel6_8",
"version": "V2021",
"enable16bitTypes": false,
"spirv": false
},
// --- GLSL ---
"glsl": {
"enabled": true,
"targetClient": "Vulkan1_3",
"spirvVersion": "SPIRV1_6",
"preamble": ""
},
// --- WGSL ---
"wgsl": {
"enabled": true
}
}
}
}
}
The full list of accepted keys and values is in
package.jsonof the upstream VS Code extension.
Disabling individual languages
Setting hlsl.enabled, glsl.enabled, or wgsl.enabled to false omits the
corresponding --hlsl / --glsl / --wgsl flag from the server invocation:
"settings": { "wgsl": { "enabled": false } }
Binary overrides
Use the binary block to override the executable, arguments, or environment:
"lsp": {
"shader-language-server": {
"binary": {
"path": "/path/to/shader-language-server",
"arguments": ["--stdio", "--hlsl", "--glsl"],
"env": { "RUST_LOG": "shader_language_server=debug" }
}
}
}
When arguments is set the extension uses it verbatim, skipping the automatic
--config and language flags.
Credits
- Original extension: Christian Howe
- Language server: antaalt — shader-sense, shader-validator.
License
MIT