glslx is a GLSL language server based on the official Khronos Group glslang compiler library, providing comprehensive and accurate language support for GLSL shader development. 🚀
- Smart Code Completion
- User-defined variables, structs, and functions
- Built-in variables, functions, and data types
- Language keywords and extension directives
- Struct member
- Precise Code Navigation
- Go to Definition
- Document Outline View
- Real-time Error Diagnostics
- Syntax and semantic checking via glslang
- Header File Support
- Full handling of
#includedirectives
- Full handling of
- Conditional Compilation Support
- Grey out code in inactive preprocessor branches
- Semantic Tokens
- Hover Documentation
- Find References
- CMake 3.26+
- C++17-compatible compiler
-
Clone the repository (including submodules):
git clone --recursive https://github.com/ComingToy/glslx.git cd glslx -
Configure and build the project:
cmake -DENABLE_OPT=OFF -B build -S . cmake --build build --parallel -
Install (optional):
sudo cp build/src/glslx /usr/local/bin/
-
Edit the coc.nvim configuration file
~/.config/nvim/coc-settings.json:{ "languageserver": { "glslang": { "command": "/usr/local/bin/glslx", "filetypes": ["glslx"] } } } -
Compilation Command Configuration:
Create acompile_commands_glslx.jsonfile in the project root, following the Compilation Database Specification. Example:[ { "directory": "/path/to/project", "command": "glslc --target-env=vulkan1.3 -DInputType=float16_t -o output.spv -I /path/to/includes source.comp", "file": "/path/to/project/source.comp", "output": "output.spv" } ]
| Feature | Demo |
|---|---|
| Code Diagnostics | |
| Extension Completion | |
| Function Completion | |
| Struct Member Completion | |
| Goto Definition | |
| Conditional Compilation Support |
This project is licensed under the MIT License. See the LICENSE file for details.