This package implements HCL language support for the CodeMirror code editor.
The lezer grammar is ported from tree-sitter-hcl.
npm i codemirror-lang-hcl
import {EditorView} from '@codemirror/view';
import {EditorState} from '@codemirror/state';
import {hcl} from "codemirror-lang-hcl";
const state = EditorState.create({
doc: 'my hcl code',
extensions: [
hcl(),
]
});
const view = new EditorView({
parent: document.querySelector('#editor'),
state
});
This example is from tree-sitter-hcl.
Theme: https://thememirror.net/tomorrow.