plugin providing syntax highlighting and DXC validation for HLSL (High Level Shading Language) files.
- Syntax highlighting for keywords, types, built-in functions, semantics, preprocessor directives, numbers, strings, operators, and comments
- Struct/class name highlighting — struct, cbuffer, tbuffer, class, interface, enum names and typedef aliases are highlighted at declaration and every usage site, including names declared in transitively
#included files - Go to declaration (
Ctrl+Click/Ctrl+B) — jump to function, variable, and type declarations in the current file or any included file - Code completion — keywords, types, built-in functions (with auto-inserted parentheses), semantics (suggested after
:), local identifiers, and symbols pulled from included files (functions, struct-like names,#definemacros, and top-levelconstglobals) - Code folding — collapse any multi-line
{ ... }block (functions, structs, cbuffers, control-flow blocks) and block comments, each region independent - clang-format integration — Reformat Code routes HLSL files through a user-configured
clang-formatbinary that picks up your.clang-formatfile (walks up from the file's directory) - DXC compiler validation — real-time error and warning annotations powered by the DirectX Shader Compiler
- "Add DXC pragmas" intention — inserts
#pragma hlsl profile/entry/hvskeleton at the top of the file - Line and block commenting (
Ctrl+/,Ctrl+Shift+/) - Brace matching for
(),{},[] - Color settings page — customize all highlight colors under Settings → Editor → Color Scheme → HLSL
hlsl, hlsli, fx, fxh
Additional extensions can be added via Settings → Editor → File Types → HLSL.
The plugin can run the DirectX Shader Compiler (dxc) in the background to show compilation errors and warnings inline.
- Go to Settings → Tools → HLSL / DXC
- The plugin auto-detects
dxc.exefrom your PATH, Windows SDK, or Vulkan SDK - Optionally set the path manually, default shader profile (default:
ps_6_6), entry point (default:main), and HLSL version (default:2021)
Use pragma comments at the top of your shader files:
// #pragma hlsl profile vs_6_6
// #pragma hlsl entry VSMainBecause HLSL isn't a language clang-format recognizes by extension, the built-in JetBrains ClangFormat integration does not engage on .hlsl files. This plugin adds its own integration that transparently routes the Reformat Code action through clang-format.
- Go to Settings → Tools → HLSL / clang-format
- The plugin auto-detects
clang-formatfrom your PATH. Optionally set the path manually - Set a fallback style (LLVM, Google, Chromium, Mozilla, WebKit, Microsoft) for files not covered by a
.clang-format - Use Reformat Code (
Ctrl+Alt+L, or whatever you've mapped it to — e.g.Alt+Shift+F) on an.hlslfile
Your .clang-format is discovered automatically by walking up from the file's directory. Range formatting (reformat selection) is supported.
Requires JDK 21.
.\gradlew.bat buildPlugin
The plugin zip will be in build/distributions/.
- Download the latest
.zipfrom the Releases page, or build it yourself (see above) - In CLion/IntelliJ, go to Settings → Plugins → ⚙ → Install Plugin from Disk...
- Select the
.zipfile - Restart the IDE
- IntelliJ Platform 2024.1 – 2026.1
- Works alongside the C/C++ plugin without conflicts
This project is licensed under the MIT License.
