Shader Clippy — VS Code extensionIn-editor diagnostics, hover docs, and quick-fix code actions for HLSL —
powered by the How it works (in 30 seconds)
If the status-bar badge shows "$(error) Shader Clippy" — click it to open the Shader Clippy Output channel and see the failure reason (usually a missing binary or a permissions error). See the Troubleshooting section below for the common cases. Features
The diagnostics surfaced in VS Code's Problems panel are byte-for-byte the same as the diagnostics the CLI emits in CI logs (modulo formatting). Requirements
The Power-user overrides (only set these if you need them):
InstallationFrom the MarketplaceSearch for "Shader Clippy" by
The Marketplace serves the matching From a
|
| Setting | Type | Default | Purpose |
|---|---|---|---|
shaderClippy.serverPath |
string |
"" |
Explicit path to a custom shader-clippy-lsp binary. Empty = use the binary bundled with the extension (or shader-clippy-lsp on PATH). |
shaderClippy.targetProfile |
string |
"" |
Slang target profile (e.g. sm_6_6, vs_6_7, ps_6_8). Empty = server default per stage. Forwarded to LintOptions::target_profile. |
shaderClippy.enableReflection |
boolean |
true |
Enable Phase 3 reflection-aware rules. Disable on slow machines to keep AST-only latency. |
shaderClippy.enableControlFlow |
boolean |
true |
Enable Phase 4 CFG-aware rules. |
shaderClippy.trace.server |
string |
"off" |
Trace LSP communication (off / messages / verbose). |
shaderClippy.inlineDiagnostics |
string |
"off" |
Render the diagnostic message inline at end of line (Error Lens style). off / errors-only / all. |
shaderClippy.showStatusBar |
boolean |
true |
Show the Shader Clippy badge in the status bar. Disable if your status bar is crowded. |
Auto-fix on save
Add this to your settings.json to apply every machine-applicable fix
each time you save an HLSL file:
"editor.codeActionsOnSave": {
"source.fixAll.shaderClippy": "always"
}
You can also trigger it manually via Shader Clippy: Fix All in Document
(Ctrl+Shift+P).
Commands
| Command | Default keybinding (HLSL files) | Description |
|---|---|---|
Shader Clippy: Restart Server |
— | Stop and re-spawn the LSP server (useful after a binary update). |
Shader Clippy: Show Output Channel |
— | Reveal the extension's output panel. |
Shader Clippy: Re-lint Active Document |
Ctrl+Alt+L (Cmd+Alt+L on macOS) |
Force a re-lint via a save round-trip; useful after editing .shader-clippy.toml. |
Shader Clippy: Open Rule Docs |
Ctrl+Alt+D (Cmd+Alt+D on macOS) |
Open the per-rule docs page on github.com for the diagnostic at the cursor. |
Right-click anywhere inside an HLSL file for an Shader Clippy submenu that surfaces the four commands above. Keybindings only fire when the active editor language is HLSL.
Rule documentation
Every diagnostic includes a hover link to the rule's docs page. Browse the
full catalog at
docs/rules/.
License
Apache-2.0. See LICENSE
in the repo root.
This extension bundles vscode-languageclient (MIT, Microsoft Corp.) and
@types/vscode (MIT). Third-party license texts are reproduced in
THIRD_PARTY_LICENSES.md.
Troubleshooting
No diagnostics when opening a .hlsl file? Three checks:
Status-bar badge. Look at the bottom-right corner of the VS Code window. You should see one of:
- $(check) Shader Clippy → server running. If you still see no
diagnostics, the file may not contain anything the rule pack
flags. Try a known-bad pattern like
pow(x, 2.0);. - $(sync~spin) Shader Clippy → still starting. Wait 1–2 seconds.
- $(error) Shader Clippy → activation failed. Click the badge to open the Output channel; the failure reason is at the top.
- No badge at all → the extension didn't activate. Check the editor's bottom-right language indicator: it must say "HLSL". Click it and pick "HLSL" if it says "Plain Text".
- $(check) Shader Clippy → server running. If you still see no
diagnostics, the file may not contain anything the rule pack
flags. Try a known-bad pattern like
Output channel.
Ctrl+Shift+P→ "Shader Clippy: Show Output Channel". The first lines tell you which binary the resolver picked and whether the LSP started cleanly.Manual
serverPath. If the bundled binary is missing or broken on your platform, downloadshader-clippy-lspfrom the matching GitHub Release, extract it (Windows: keep all 7 sibling.dllfiles in the same directory!), and setshaderClippy.serverPathto its absolute path.
Contributing / local testing
See DEVELOPMENT.md
for the F5 dev loop and tools/build-vsix-local.{ps1,sh} workflow
that lets contributors verify changes BEFORE tagging a release. The
local workflow uses the exact same packaging steps as
release-vscode.yml.
Reporting issues
File bugs at https://github.com/NelCit/shader-clippy/issues. Please include:
- The output of
Shader Clippy: Show Output Channel. - Your
shaderClippy.*settings. - A minimal reproducer shader.