High-performance, GPU-accelerated desktop viewer and editor for structured data.
Built with Rust and GPUI. Handcrafted zero-dependency parsers with exact source spans, bidirectional AST tree navigation, diagnostics, and instant formatting.
Supported Formats • Key Features • Shortcuts • Installation • Getting Started • Architecture
FileViewer automatically identifies the document format from the file extension (with seamless fallback to JSON for unrecognized extensions).
| Format | Extensions | AST & Tree View | Format / Minify | Syntax Highlighting | Comments & Roundtrip |
|---|---|---|---|---|---|
| JSON | .json |
Yes | Yes | Yes | Strict RFC 8259 parser with exact source byte spans |
| JSONC | .jsonc |
Yes | Yes | Yes | Accepts // and /* */ comments, trailing commas preserved |
| JSONL | .jsonl, .ndjson |
Yes | Yes | Yes | Line-oriented stream parsed into synthetic root array |
| TOML | .toml |
Yes | Yes | Yes | Tables, inline tables, dotted keys, multiline CRLF & LF |
| YAML | .yaml, .yml |
Yes | Yes | Yes | Block/flow collections, multiline folded/literal scalars, anchors & aliases |
- JSON & JSONC: Accepts
//and/* */comments and allows trailing commas in JSONC mode. Formatting and minification are line-oriented and never reserialize the AST, guaranteeing comments and blank lines survive intact. - JSONL / NDJSON: Parsed as an ordered sequence of records, rendered in the tree view as a synthetic root array. UTF-8 BOMs are automatically stripped, and source spans are offset by the BOM length so cursor sync lands exactly on target.
- TOML: Robust support for standard key-value pairs, dotted keys, inline tables, table arrays (
[[table]]), and multiline strings across both LF and Windows CRLF line endings. - YAML: Covers block mappings, block sequences, flow collections, plain and quoted scalars (single and double-quoted with escape folding), block scalars with chomping and explicit indent indicators, anchors, aliases, and merge keys. Alias expansion is protected by a strict node budget to prevent expansion bombs without exhausting memory.
Tip
Check samples/feature-tour.yml for a comprehensive demonstration of YAML constructs, anchors, folded scalars, and tree synchronization.
- GPU-Accelerated Rendering: Built on GPUI (the UI framework developed for the Zed editor), providing hardware-accelerated 120 FPS rendering and smooth scrolling.
- Bidirectional Tree Navigation: Two-way synchronization between the code editor and the structural AST tree view. Clicking any node in the tree highlights its precise span in the document; moving the cursor in the editor automatically tracks and focuses the corresponding tree node.
- Handcrafted Parsers: Zero external parsing crates for JSON, JSONC, JSONL, TOML, and YAML. Every token, bracket, and node records precise byte offsets and line/column positions.
- Non-Destructive Formatting: Pretty-printing and minification normalize indentation without losing comments or whitespace context.
- Real-Time Validation Diagnostics: Instant feedback on syntax errors with exact line and column locations, visual markers, and a jump-to-error shortcut.
- Find, Replace & Symbol Search: Full in-document search, symbol jumping (Alt+Down / Alt+Up), soft word wrap (Alt+Z), and unlimited undo/redo.
- Native OS Integration: Professional Windows installer with Explorer context menu ("Open with FileViewer"), default file associations, and portable releases for both Windows and Linux.
| Shortcut | Action |
|---|---|
| Ctrl + O | Open file |
| Ctrl + S | Save document |
| Ctrl + Shift + F | Format document |
| Ctrl + F | Find in document |
| Ctrl + Z / Ctrl + Y | Undo / Redo |
| Ctrl + T | Toggle tree panel |
| Ctrl + Shift + E | Expand all tree nodes |
| Ctrl + Shift + C | Collapse all tree nodes |
| Alt + Z | Toggle word wrap |
| Alt + Down / Alt + Up | Jump to next / previous symbol |
Download prebuilt binaries directly from the Releases page.
- Installer (
FileViewer-Setup-0.1.0.exe):- Automatically installs FileViewer to
AppData\Local\Programs\FileViewer. - Configures optional Desktop and Start Menu shortcuts.
- Registers the Windows Explorer right-click context menu: "Open with FileViewer" for all supported formats and generic files.
- Optionally associates
.json,.jsonc,.jsonl,.ndjson,.toml,.yaml, and.ymlfiles to open with FileViewer by default. - Clean uninstaller via Windows Add or remove programs.
- Automatically installs FileViewer to
- Portable (
FileViewer-0.1.0-windows-x86_64.zip):- Standalone executable requiring no installation or admin rights.
- Embedded high-resolution multi-size Windows PE icon resources.
-
Debian Package (
.deb):sudo apt install ./file-viewer_0.1.0_amd64.deb
-
Portable Bundle (
.tar.xz):tar -xf file-viewer_0.1.0_linux-x86_64.tar.xz cd bundle ./install.sh # use --prefix DIR to choose custom directory file-viewer config.toml
Run
./uninstall.shto remove cleanly. -
Integrity Verification:
sha256sum -c SHA256SUMS
Prebuilt macOS binaries will be available in future releases. To build from source on macOS:
cargo build --releaseLaunch FileViewer directly with a path argument or press Ctrl+O from inside the application:
file-viewer path/to/document.yaml- Rust 1.76+ (
rustup update) - On Linux, GPUI link-time libraries:
sudo apt install libxcb1-dev libxkbcommon-dev libxkbcommon-x11-dev
# Debug build & run
cargo run -- config.jsonc
# Release build
cargo build --releasepowershell -ExecutionPolicy Bypass -File scripts\build-installer.ps1Generates:
dist/FileViewer-Setup-0.1.0.exe(Inno Setup installer)dist/FileViewer-0.1.0-windows-x86_64.zip(Portable ZIP)dist/SHA256SUMS
packaging/linux/build_release.shGenerates:
dist/file-viewer_0.1.0_amd64.debdist/file-viewer_0.1.0_linux-x86_64.tar.xzdist/SHA256SUMS
-
Zero-Bloat Custom Parsers: Hand-written lexers and parsers designed specifically for precise byte-span tracking (
$O(n)$ single-pass scanning). Unlike standard deserializers, FileViewer retains document structure, trivia, and exact coordinates. -
Line & Byte Span Synchronization: The editor maps visual screen lines and cursor offsets to AST node paths in
$O(\log n)$ to$O(n)$ time, ensuring instant selection feedback without frame drops. - Memory Safety & Expansion Budgets: Parsers enforce recursion depth bounds (default 128) and node expansion limits to prevent billion-laughs or deeply nested stack overflows.
The project maintains a comprehensive test suite covering all parser dialects, round-tripping, syntax folding, BOM handling, and bidirectional synchronization:
cargo testThis project is licensed under the MIT License.