This project aims to provide rich editor support for WebGPU shading language via a standalone language server (implementing the language server protocol), and a VS Code client extension that interfaces with it.
This workspace is a monorepo. Specific documentation for the individual packages
contained in this repo can be found under their respective project directories
(under packages
).
User-facing documentation for the VS Code extension can be found under
packages/client/README.md
.
packages/client
— The VS Code extension / LSP client implementationpackages/grammar
— The TextMate grammar, providing fast first-pass syntax highlighting for VS Codepackages/parser
— A fast, standalone, hand-written recursive descent parser for WGSLpackages/server
— The LSP server implementation
- Install Node.js LTS ≥ v20.12.2
- Install Rust Stable and Nightly channels
- Install JavaScript dependencies
npm ci
- Build and install the extension locally
npx nx build client --package --install
Note
Nightly Rust is needed only for the server's build
command, because it uses
the unstable --out-dir
argument to place the compiled executable in the
correct location for local development.
The repo is managed by Nx, a flexible, polyglot monorepo
manager and build-system framework written in TypeScript. Workspace
configuration is defined in nx.json
at the root of the repository, while
individual project configurations are defined in project.json
files inside the
corresponding project directories.
Commands can be written in the form
npx nx <target> <project> [options]
or
npx nx run <project>:<target> [options]
Where <project>
is the name
specified in the project.json
for a given
project, and <target>
is a key of the targets
object in that same file.
All of the heavy lifting is done with purpose-built Nx plugins maintained by this project's primary contributor:
@vscode-devkit/nx
— https://github.com/dannymcgee/vscode-devkit@nxrs/cargo
— https://github.com/nxrs/cargo