Files
Decodal/packages/decodal-language-tools/README.md
T
2026-07-09 18:34:41 +09:00

975 B

decodal-language-tools

Source-level language tooling for Decodal.

This package is generated from the Rust crate in crates/decodal-language-tools with wasm-pack. It currently exposes a comment-preserving formatter that is shared by the official playground and future editor/LSP tooling.

Use decodal-codemirror separately when you need CodeMirror 6 language support. Use decodal-wasm separately when you need to evaluate Decodal in a browser.

Install

npm install decodal-language-tools

JSR:

deno add jsr:@hare/decodal-language-tools

Usage

import init, { formatSource } from 'decodal-language-tools';

await init();

const result = JSON.parse(formatSource('Server={# host\nhost=String default "localhost";};'));

if (result.ok) {
  console.log(result.source);
} else {
  console.error(result.error);
}

The exported functions return JSON strings so callers can handle diagnostics without depending on Rust data structures.