codemirror-lang-hcl
v0.0.0-beta.2
Published
hcl language support for CodeMirror
Downloads
2,485
Readme
codemirror-lang-hcl
This package implements HCL language support for the CodeMirror code editor.
The lezer grammar is ported from tree-sitter-hcl.
Getting Started
Installation
npm i codemirror-lang-hcl
Usage
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
});
Example
This example is from tree-sitter-hcl.
Theme: https://thememirror.net/tomorrow.