Files
openidea/src/features/database/jsonValue.worker.ts
T
Vadim LazukandInf1mum 6c3e5ae469 feat(database): JSON-aware value editor for json cells (#2410)
Refs #2333

Editing json / jsonb / MySQL JSON cells showed one long plain text line, and invalid JSON only failed on Submit. The Value panel and the grid's ⇧Enter window now open the IDE's code editor for JSON cells, pretty-printed (big integers and duplicate keys preserved, large values formatted off the main thread) with highlighting, folding and find; validation as you type blocks Apply only for JSON columns; Reformat; Apply of an unchanged value creates no pending edit, and drafts survive opening the window. XML and bytea modes from #2333 remain.

Co-authored-by: Inf1mum <8135225+Inf1mum@users.noreply.github.com>
2026-11-10 05:22:56 +08:00

7 lines
267 B
TypeScript

import { formatJson, jsonErrorOf } from "./jsonValue";
self.onmessage = (event: MessageEvent<{ text: string; format: boolean }>) => {
const { text, format } = event.data;
self.postMessage({ text: format ? formatJson(text) : text, error: jsonErrorOf(text) });
};