Skip to content

About

A language server implementation for WGSL and WESL

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

1,342 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wgsl-analyzer

wgsl-analyzer logo

Discord

codecov

wgsl-analyzer is a language server plugin for the WebGPU Shading language (WGSL). It also supports WGSL Extended Shader Language (WESL). Note: (support for WESL is experimental and in-progress)

You can use it with any editor that supports the Language Server Protocol (for example, VS Code, Vim, Emacs, Zed).

wgsl-analyzer's features include go-to-definition, type checking, code completion, and much more is planned. wgsl-analyzer also supports integrated diagnostics (with naga).

Internally, wgsl-analyzer is structured as a set of libraries for analyzing Rust code. See Architecture in the manual.

It comes with a VS Code extension located in ./editors/code. Due to the nature of the language server protocol, it should be possible to create plugins for other editors as well.

Quick Start

See the installation guide in the manual.

wgsl-analyzer does not yet support automatically inferring dependencies from package managers such as Cargo.

Relevant issues:

It works if you "vendor" Bevy and create a WESL package manifest with the explicit configuration.

  1. Clone the bevyengine/bevy repository locally.
  2. Set up a wesl.toml in your crate with shaders (next to Cargo.toml).

Example wesl.toml for use with Bevy

# wesl.toml
edition = "2026_pre"

# if you do not put your shaders in the default `./shaders` folder, specify the correct value here
# root = "assets/shaders"

# it does not hurt to have all of these listed even if you do not use them, but you can trim it to your needs
[dependencies]
bevy_anti_alias = { path = "../bevy/crates/bevy_anti_alias" }
bevy_core_pipeline = { path = "../bevy/crates/bevy_core_pipeline" }
bevy_dev_tools = { path = "../bevy/crates/bevy_dev_tools" }
bevy_feathers = { path = "../bevy/crates/bevy_feathers" }
bevy_gizmos_render = { path = "../bevy/crates/bevy_gizmos_render" }
bevy_pbr = { path = "../bevy/crates/bevy_pbr" }
bevy_post_process = { path = "../bevy/crates/bevy_post_process" }
bevy_render = { path = "../bevy/crates/bevy_render" }
bevy_solari = { path = "../bevy/crates/bevy_solari" }
bevy_sprite_render = { path = "../bevy/crates/bevy_sprite_render" }
bevy_ui_render = { path = "../bevy/crates/bevy_ui_render" }
constants = { path = "../bevy/constants" } # temporary bevy hack

See wgsl-analyzer: Project Discovery for more information.

Building from source

The easiest way to build the language server and extension and install it all in one command:

cargo xtask install

The following instructions describe the manual steps:

The LSP server can be built using cargo build --release -p wgsl-analyzer.

The VS Code extension can either be built as a platform-specific extension which bundles the language server binary, or as a platform-independent one.

1. Install node modules:

pnpm --dir editors/code install

2. Package extension: (choose one)

Platform independent extension:

pnpm --dir editors/code run package

Platform-specific extension:

Copy the server binary (either wgsl-analyzer or wgsl-analyzer.exe) into ./editors/code/server/:

mkdir editors/code/server
cp target/release/wgsl-analyzer editors/code/server/wgsl-analyzer

Next, run:

pnpm --dir editors/code run package --target <target> -o wgsl-analyzer-<target>.vsix

Example: pnpm --dir editors/code run package --target linux-x64 -o wgsl-analyzer-linux-x64.vsix

where the target is one of the targets listed as platform-specific extension targets.

The output is a file such as editors/code/wgsl-analyzer-linux-x64.vsix

3. Install the extension:

Open the VSIX with VS Code, for example, by running the VS Code command (F1):

> Extensions: Install from VSIX...

About

A language server implementation for WGSL and WESL

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages