monaco editor extension for PlantUML with better intellisense
yarn add @sinm/monaco-plantuml
import { PUmlExtension } from '@sinm/monaco-plantuml';
const extension = new PUmlExtension();
const disposer = extension.active(editor);
// when destroyed
disposer.dispose();
- create
puml.worker.ts
file in current directory
// editor/puml.worker.ts
import '@sinm/monaco-plantuml/lib/puml.worker'
- user worker in
editor.ts
file
// editor/editor.ts
import { PUmlExtension } from '@sinm/monaco-plantuml';
const worker = new Worker(new URL('./puml.worker.ts', import.meta.url));
const extension = new PUmlExtension(worker);
import { PUmlExtension } from '@sinm/monaco-plantuml';
import PUmlWorker from '@sinm/monaco-plantuml/lib/puml.worker?worker';
// relative
const worker = new PUmlWorker();
const extension = new PUmlExtension(worker);