# @lucy/codemirror-lang

> CodeMirror 6 language support for Lucy

Latest version **0.3.0** (published 2026-11-20) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install @lucy/codemirror-lang
pnpm add @lucy/codemirror-lang
yarn add @lucy/codemirror-lang
bun add @lucy/codemirror-lang
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2026-11-20 |
| First published | 2021-05-15 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Matthew Phillips |
| Maintainers | matthewp |
| Keywords | lucy, codemirror |

## Links

- npm: https://www.npmjs.com/package/@lucy/codemirror-lang
- Repository: https://github.com/lucydsl/codemirror-lang
- Homepage: https://github.com/lucydsl/codemirror-lang#readme
- Issues: https://github.com/lucydsl/codemirror-lang/issues
- npm.io page: https://npm.io/package/@lucy/codemirror-lang

## Recent versions

- 0.3.0 (latest) — 2026-11-20
- 0.2.0 — 2026-11-15
- 0.1.0 — 2021-05-15

## README

# @lucy/codemirror-lang

This package implements Lucy language support for [CodeMirror 6](https://codemirror.net/6).

## Usage

Language extensions are used with an EditorState object like so:

```js
import {EditorState, EditorView, basicSetup} from "@codemirror/basic-setup";
import {Compartment} from "@codemirror/state"
import {defaultTabBinding} from "@codemirror/commands";
import {keymap} from "@codemirror/view";
import {lucy} from '@lucy/codemirror-lang';

const language = new Compartment();
const tabSize = new Compartment();

const lucySrc = `
state idle {
  start => guard(:loggedIn) => downloading
}

state downloading {

}
`;

const view = new EditorView({
  state: EditorState.create({
    doc: lucySrc.trim(),
    extensions: [
      basicSetup,
      keymap.of([defaultTabBinding]),
      language.of(lucy()),
      tabSize.of(EditorState.tabSize.of(2)),
    ]
  }),
  parent: document.querySelector('#app')
});
```

## License

BSD-2-Clause

---
_Source: https://npm.io/package/@lucy/codemirror-lang · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
