1-Click compare clipboard with selection, compare two active editor tabs, compare text files, and structural JSON diff in a side-by-side diff viewer without touching Git.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
DiffCraft: Clipboard & Active Selection Diff Pro ⚖️
1-Click compare clipboard with selection, compare two arbitrary editor selections, compare files, and perform structural sorted JSON diffs inside VS Code without creating temporary files or touching Git!
✨ Features
📋 Clipboard ↔ Selection Diff: Select any code in the editor, right-click, and compare it with the text currently on your system clipboard in a side-by-side diff view.
📌 Two Selections Compare:
Highlight Selection A and run "Mark Selection as Base".
Highlight Selection B (even in another file or tab) and run "Compare Current Selection with Marked Base".
📁 File Diff Dialog: Quickly pick any two files from your workspace or disk to compare side-by-side with full syntax highlighting.
🧩 Structural JSON Diff: Automatically sorts object keys alphabetically and reformats two JSON payloads before diffing, eliminating false positives caused by unordered keys!
⚡ In-Memory Virtual Buffers: Uses VS Code virtual document providers (diffcraft://), leaving your disk and git history clean.
🛠️ Usage
1. Compare Clipboard with Selection
Highlight code in your editor.
Right-click and choose "DiffCraft: Compare Clipboard with Selection".
2. Compare Two Independent Code Blocks
Highlight the first code block -> right click "DiffCraft: Mark Selection as Base".
Navigate to any other file or block -> right click "DiffCraft: Compare Current Selection with Marked Base".
3. Structural JSON Compare
Copy one JSON to clipboard, highlight another JSON in the editor, and run:
DiffCraft: Structural JSON Diff (Formatted & Sorted) from the Command Palette (Ctrl+Shift+P / Cmd+Shift+P).