This is a WGSL (WebGPU Shading Language) language package for CodeMirror editor.
You can try it online.
$ git clone [email protected]:iizukak/codemirror-lang-wgsl.git
$ cd codemirror-lang-wgsl.git
$ npm install
$ npm run prepare
$ npm test
wgslLanguage:
LRLanguage
wgsl()->
LanguageSupport
You can use like below code.
import { EditorView, basicSetup } from "codemirror";
import { wgsl } from "@iizukak/codemirror-lang-wgsl";
let editor = new EditorView({
extensions: [basicSetup, wgsl()],
parent: document.body,
});
This repository is based on some other libraries.
- Basic design of this repo is from codemirror/lang-example
src/syntax.grammar
is based on use.gpu.src/index.ts
is based on arsiliath/codemirror-lang-wgsl.