jsonl-line-editor
Marketplace ID: zhengxiang.jsonl-line-editor
Open any .jsonl file and expand or edit exactly the record you want.
The viewer keeps VS Code-style JSON colors, physical-record line numbers, connected document selections, whitespace dots, bracket guides, diagnostics, and line-end hit areas. Expanding one record adds visual formatting lines without adding line numbers or renumbering later records. Dragging across records and Ctrl/Cmd+A select the JSONL document like ordinary text. Ctrl/Cmd+F opens a Text Editor-style find bar with case, whole-word, regular-expression, result-count, navigation, selection-scope, and replace controls; matches use a restrained light-gray highlight. Fold state and horizontal/vertical scroll positions are remembered per file. Unsaved text is owned by the same VS Code TextDocument used by Text Editor, including invalid JSON and hot-exit restoration.
Usage
- Open a file whose name ends in
.jsonl.
- Move the pointer beside a line number to reveal the native-style folding chevron.
- Click the chevron to expand a JSON-like object or array row. Collapsing always uses the current unsaved text; invalid text collapses without being rewritten and keeps its red diagnostic. If invalid collapsed JSON cannot be expanded, the view stays collapsed and VS Code shows a short warning. The extension never repairs or rewrites it automatically. Ordinary prose and scalar rows have no chevron. Nested balanced objects and arrays get independent hover chevrons while the remaining visible text stays editable.
- Edit the syntax-colored JSON directly. Syntax errors receive red wavy diagnostics. Cross-record dragging, Ctrl/Cmd+A, copy, cut, paste, deletion, and replacement follow document-wide ordinary-text behavior. Ctrl/Cmd+S saves the current text even when JSON is invalid; validation never changes the text or blocks an explicit save.
- Real edits immediately enter VS Code's shared text buffer and show the native unsaved dot. The extension contributes a JSONL-only VS Code default that keeps Auto Save off without changing the user's global Auto Save preference, so the dot remains until an explicit save decision. Use Ctrl/Cmd+S to save. When closing a dirty file, VS Code's native Save / Don't Save / Cancel dialog decides whether the current text is written, discarded, or kept open.
The extension opens .jsonl files in JSONL View by default; VS Code identifies it as JSONL View - jsonl-line-editor in the editor picker. Every collapsed row is a syntax-colored, directly editable physical record. Expanded formatting lines never receive independent line numbers. Collapsing always renders the current unsaved record, including invalid JSON and its red diagnostic; only an impossible invalid expansion emits a warning. Balanced nested structures fold independently with VS Code's native ⋯ glyph, spacing, and closing-bracket layout, and the projected textarea remains editable outside hidden sections. Formatting whitespace exists only in the expanded view: record edits are mapped losslessly back to one physical line, preserving untouched spaces, escapes, numeric spelling, and key order. Document-wide selection treats physical records as ordinary text, while whole-record copy, cut, paste, deletion, replacement, and full-selection drag/drop carry the exact source line, including JSON hidden by a nested fold. Outer and nested folds share ordered undo/redo with document edits; view-only folds never mark the file dirty. JSONL View and Text Editor share one native text buffer, so dirty state, save, revert, hot exit, and cross-editor unsaved invalid text follow VS Code's normal semantics. A language-scoped VS Code default keeps files.autoSave off for JSONL while leaving the global preference untouched; disk writes occur through Ctrl/Cmd+S or VS Code's native close-confirmation Save choice. To use the regular raw editor, choose Reopen Editor With... → Text Editor.
Privacy
All parsing happens locally inside VS Code. The extension has no network requests, telemetry, accounts, or extension-specific settings.