@opentalon/monaco-talon
v0.1.0
Published
Monaco Editor language plugin for Talon — syntax highlighting, snippets, autocomplete, hover docs, themes.
Downloads
167
Maintainers
Readme
@opentalon/monaco-talon
Monaco Editor language plugin for Talon.
Ships a Monarch tokenizer, language configuration (brackets, comments, auto-close), block-scaffold snippets, keyword autocomplete, hover docs, and talon-light / talon-dark themes.
Install
npm install @opentalon/monaco-talonmonaco-editor is a peer dependency.
Usage
import * as monaco from 'monaco-editor';
import { registerTalon } from '@opentalon/monaco-talon';
registerTalon(monaco);
monaco.editor.create(document.getElementById('editor')!, {
language: 'talon',
theme: 'talon-dark',
value: `detect "Service overdue" {
for records where type == "item" and status == "active"
flag matching items
label "{item.name}: overdue"
priority HIGH
}`,
});registerTalon returns a monaco.IDisposable that unregisters everything.
Options
registerTalon(monaco, { registerThemes: false }); // skip theme registrationWhat's included
| Feature | Source |
| --- | --- |
| Tokenizer | Mirrors keywords from talon-language/internal/lexer/lexer.go |
| Block scaffolds | detect, rule, define, recommend, forecast, workflow, test |
| Themes | talon-light (vs base), talon-dark (vs-dark base) |
Keeping in sync
If new keywords are added to the Talon lexer, update src/keywords.ts and re-run tests.
License
Apache-2.0
