codemirror-lang-circom
v0.1.0
Published
A Codemirror language extension for circom
Downloads
21
Readme
codemirror-lang-circom
A Codemirror language extension for circom.
⚠️ This extension is very rough alpha-quality! There are almost certainly bugs.
Table of Contents
Install
npm i codemirror-lang-circom
Usage
import { EditorState } from "@codemirror/state"
import { EditorView } from "@codemirror/view"
import { circomLanguage } from "codemirror-lang-circom"
import { basicSetup } from "@codemirror/basic-setup"
import { defaultHighlightStyle } from "@codemirror/highlight"
import { keymap } from "@codemirror/view"
import { defaultKeymap } from "@codemirror/commands"
const view = new EditorView({
state: EditorState.create({
extensions: [
circomLanguage,
basicSetup,
defaultHighlightStyle,
keymap.of(defaultKeymap),
],
}),
parent: document.querySelector("#editor"),
})
You can find documentation for the LR parser interface on the Lezer website.
API
import type { LRLanguage } from "@codemirror/language"
export const circomLanguage: LRLanguage
Contributing
This is still under active development so I'm probably not interested in issues or PRs until it stabilizes a little.
License
GPLv3 © 2021 Joel Gustafson