#wgsl #glsl #lsp #shader #hlsl #language-server #graphics

app shader_language_server

Language server for HLSL / GLSL / WGSL shaders using LSP protocol

4 releases

0.4.2 Jan 2, 2025
0.4.1 Dec 20, 2024
0.4.0 Nov 23, 2024
0.3.1 Oct 2, 2024

#502 in Development tools

Download history 132/week @ 2024-09-30 19/week @ 2024-10-07 4/week @ 2024-10-14 121/week @ 2024-11-18 22/week @ 2024-11-25 14/week @ 2024-12-02 9/week @ 2024-12-09 112/week @ 2024-12-16 4/week @ 2024-12-23 125/week @ 2024-12-30 14/week @ 2025-01-06

256 downloads per month

Custom license

230KB
5.5K SLoC

Shader language server

shader_language_server

This application is a language server for shaders (HLSL, GLSL, WGSL) that is mainly meant to be used as a server for vscode extension shader-validator. It is following the LSP protocol to communicate with the extension so it could be used with any editor supporting it. It can be built to desktop or WASI. WASI will let the extension run even in web version of vscode, but it suffer from limitations. See below for more informations.

Features

This language server support a few options :

  • Diagnostics: lint the code as you type.
  • Completion: suggest completion values as you type.
  • Signature: view the signatures of the current function.
  • Hover: view the declaration of an element by hovering it.
  • Goto: allow to go to declaration of an element.

The server support HLSL, GLSL, WGSL diagnostics, but symbol requests are not implemented for WGSL yet.

Diagnostics

Diagnostics are generated following language specifics API:

  • GLSL uses glslang-rs as backend. It provide complete linting for GLSL trough glslang API bindings from C.
  • HLSL uses hassle-rs as backend. It provides bindings to directx shader compiler in rust.
  • WGSL uses naga as backend for linting.

Symbols

Symbols are retrieved using queries based on tree-sitter API.

Dependencies

~55MB
~1M SLoC