Complete WGSL language server, VS Code extension and analyzer CLI
TypeScript
5
14 commits
updated Oct 19, 2026

WGSL language support for .wgsl files and WGSL templates embedded in JS/TS: a VS Code extension, the wgsl-lint command-line tool and a dependency-free analyzer library. Shaders are validated the way Chrome does, with all the errors reported at once.
All but semantic highlighting also work in JS/TS template literals tagged wgsl:
const shader = wgsl`
${common}
@compute @workgroup_size(${size}) fn main() {}
`;
Diagnostics depending on the ${} substitutions are suppressed. Templates are formatted with the "Format WGSL template" code action.
wgsl-lint [--tag <name>]... [--prelude <file>] <file or directory>...
Reports the diagnostics of the .wgsl files and, with --tag, of the tagged templates in JS/TS files; exits with 1 on errors.
import { Document, hover, lint } from "wgsl-linter";
const diagnostics = lint(source);
const info = hover(new Document(source), offset);
Positions are UTF-16 offsets.
import { register } from "wgsl-linter/vscode";
export function activate(context: vscode.ExtensionContext) {
register(context, { tags: ["wgsl", "shader"], prelude: engineDeclarations });
}
tags: tags of the template literals holding WGSL; wgsl by default.prelude: WGSL declarations available to all the shaders, such as engine-provided structs.extensions, features: the enable-extensions and language features the target supports; Chrome's by default.For highlighting, contribute the wgsl language with the configuration and grammars in syntaxes, as this repository's package.json does.
To format all the templates in a document at once, for example from a command, call formatTemplates(editor, edit, tags) within a text editor command.
bun run lint, bun run test, bun run build; bun run vsce packages the extension.bun run publish publishes the package to npm and the extension to the VS Code Marketplace.bun run cts [query...] runs the WebGPU conformance tests against the analyzer.bun scripts/builtins.ts and bun scripts/docs.ts regenerate the builtin tables from Tint and the hover descriptions from the spec.Complete WGSL language server, VS Code extension and analyzer CLI
TypeScript
5
14 commits
updated Oct 19, 2026

WGSL language support for .wgsl files and WGSL templates embedded in JS/TS: a VS Code extension, the wgsl-lint command-line tool and a dependency-free analyzer library. Shaders are validated the way Chrome does, with all the errors reported at once.
All but semantic highlighting also work in JS/TS template literals tagged wgsl:
const shader = wgsl`
${common}
@compute @workgroup_size(${size}) fn main() {}
`;
Diagnostics depending on the ${} substitutions are suppressed. Templates are formatted with the "Format WGSL template" code action.
wgsl-lint [--tag <name>]... [--prelude <file>] <file or directory>...
Reports the diagnostics of the .wgsl files and, with --tag, of the tagged templates in JS/TS files; exits with 1 on errors.
import { Document, hover, lint } from "wgsl-linter";
const diagnostics = lint(source);
const info = hover(new Document(source), offset);
Positions are UTF-16 offsets.
import { register } from "wgsl-linter/vscode";
export function activate(context: vscode.ExtensionContext) {
register(context, { tags: ["wgsl", "shader"], prelude: engineDeclarations });
}
tags: tags of the template literals holding WGSL; wgsl by default.prelude: WGSL declarations available to all the shaders, such as engine-provided structs.extensions, features: the enable-extensions and language features the target supports; Chrome's by default.For highlighting, contribute the wgsl language with the configuration and grammars in syntaxes, as this repository's package.json does.
To format all the templates in a document at once, for example from a command, call formatTemplates(editor, edit, tags) within a text editor command.
bun run lint, bun run test, bun run build; bun run vsce packages the extension.bun run publish publishes the package to npm and the extension to the VS Code Marketplace.bun run cts [query...] runs the WebGPU conformance tests against the analyzer.bun scripts/builtins.ts and bun scripts/docs.ts regenerate the builtin tables from Tint and the hover descriptions from the spec.