An open API service indexing awesome lists of open source software.

https://github.com/dannymcgee/vscode-wgsl

Rich language support for WebGPU Shading Language
https://github.com/dannymcgee/vscode-wgsl

Last synced: 6 months ago
JSON representation

Rich language support for WebGPU Shading Language

Awesome Lists containing this project

README

        

# WGSL Language Server and VS Code Extension

This project aims to provide rich editor support for
[WebGPU shading language](https://google.github.io/tour-of-wgsl/)
via a standalone language server (implementing the
[language server protocol](https://microsoft.github.io/language-server-protocol/)),
and a VS Code client extension that interfaces with it.

## Architecture

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`.

### Workspace Overview

* `packages/client` — The VS Code extension / LSP client implementation
* `packages/grammar` — The TextMate grammar, providing fast first-pass
syntax highlighting for VS Code
* `packages/parser` — A fast, standalone, hand-written recursive descent parser
for WGSL
* `packages/server` — The LSP server implementation

### Quick Start

* Install [Node.js LTS](https://nodejs.org/en/download) ≥ v20.12.2
* Install [Rust](https://www.rust-lang.org/learn/get-started) Stable and Nightly
channels
* Install JavaScript dependencies
```sh
npm ci
```
* Build and install the extension locally
```sh
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.

### Build System Overview

The repo is managed by [Nx](https://nx.dev), 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
```sh
npx nx [options]
```
or
```sh
npx nx run : [options]
```
Where `` is the `name` specified in the `project.json` for a given
project, and `` 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