Genet JSON FormatterComplete JSON toolkit with intelligent formatting Genet JSON Formatter provides a comprehensive suite of JSON tools with intelligent, adaptive formatting. Keep small objects compact for readability while properly formatting complex structures, plus minification, selection-based formatting, compact list formatting, interactive list sorting, and comprehensive JSON validation. 🎬 Feature DemosSmart JSON Formatting (
|
| Command | Description | Keyboard Shortcut | Usage |
|---|---|---|---|
Genet: JSON Format |
Smart formatting with intelligent compact/expanded layout | Ctrl+Alt+F / Ctrl+Cmd+Option+F |
Command Palette, Format Document, or shortcut |
Genet: JSON Format List Compact |
Format arrays with each item on new line as compact single-line objects | Ctrl+Alt+L / Ctrl+Cmd+Option+L |
Command Palette or shortcut |
Genet: JSON Sort List |
Sort JSON arrays by any property and format compact with interactive property selection | Ctrl+Alt+S / Ctrl+Cmd+Option+S |
Command Palette or shortcut |
Genet: JSON Minify |
Ultra-compact single-line JSON output | Ctrl+Alt+M / Ctrl+Cmd+Option+M |
Command Palette or shortcut |
Genet: JSON Validate |
Validate JSON syntax with detailed error reporting | Ctrl+Alt+V / Ctrl+Cmd+Option+V |
Command Palette or shortcut |
| Format Document | VS Code's built-in formatter (uses Genet when set as default) | Shift+Alt+F / Shift+Option+F |
Built-in VS Code shortcut, right-click menu |
| Format Selection | Format only selected JSON text | Ctrl+K Ctrl+F / Cmd+K Cmd+F |
Built-in VS Code shortcut, right-click menu |
VS Code Integration Notes
- Format Document and Format Selection appear in VS Code's right-click context menu when available
- Custom commands (
Genet: JSON Format,Format List Compact,Sort List,Minify,Validate) are accessed via Command Palette or keyboard shortcuts - No custom context menu items - integration works through VS Code's built-in formatting system
🔌 VS Code Integration
Document & Range Formatting Providers
- Format Document - Integrates with VS Code's Format Document feature (
Shift+Alt+F) - Format Selection - Integrates with VS Code's Format Selection feature (
Ctrl+K Ctrl+F) - Available in "Format Document With..." menu and right-click "Format Document"/"Format Selection"
- Can be set as default JSON formatter
- Works with format-on-save functionality
Language Support
- JSON file recognition (
.jsonfiles) - Proper MIME type handling (
application/json) - Language-specific configuration options
Keyboard Shortcuts
- Context-aware shortcuts that only work in JSON files
- Non-conflicting keybindings designed to work alongside VS Code defaults
- Cross-platform support with proper Windows/Linux and macOS variants
| Action | Windows/Linux | macOS |
|---|---|---|
| Format JSON | Ctrl+Alt+F |
Ctrl+Cmd+Option+F |
| Format List | Ctrl+Alt+L |
Ctrl+Cmd+Option+L |
| Sort List | Ctrl+Alt+S |
Ctrl+Cmd+Option+S |
| Minify JSON | Ctrl+Alt+M |
Ctrl+Cmd+Option+M |
| Validate JSON | Ctrl+Alt+V |
Ctrl+Cmd+Option+V |
🛠️ Technical Features
Type Safety & Code Quality
- Full TypeScript implementation with strict type checking
- Comprehensive error handling for invalid JSON
- Input validation and bounds checking for configuration
- Professional code structure with proper interfaces and constants
Performance & Reliability
- Efficient JSON parsing and formatting algorithms
- Memory-conscious handling of large JSON files
- Progress indicators for large file operations (>50KB)
- Robust error recovery that doesn't break VS Code
- Optimized for real-time formatting operations
Testing & Quality Assurance
- 118 comprehensive unit tests covering all functionality
- Sorting algorithm tests for all array types (objects, primitives, mixed)
- Edge case testing (empty arrays, null values, malformed JSON)
- Performance testing for large datasets and deep nesting
- Integration testing with VS Code APIs and commands
- Cross-platform validation ensuring consistent behavior
📝 Release Notes
1.0.1 - 2025-10-22
- NEW: JSON List Compact Formatting -
Genet: JSON Format List Compactcommand formats arrays with each item on a single line for optimal data scanning - NEW: Interactive Array Sorting -
Genet: JSON Sort Listcommand with property selection, ascending/descending direction choice, and automatic compact formatting - NEW: Mixed-Type Array Support - Sort arrays containing both objects and primitives intelligently (primitives first by value, then objects by property)
- NEW: Sort Direction Control - Choose ascending (A→Z, 0→9) or descending (Z→A, 9→0) for all sorting operations
- NEW: Enhanced Keyboard Shortcuts - Added
Ctrl+Alt+Lfor list formatting andCtrl+Alt+Sfor array sorting - ENHANCED: Smart Sorting Algorithm - Type-aware sorting handles strings, numbers, booleans, null values, and mixed types with proper fallback comparisons
- ENHANCED: Interactive UI - Visual property picker with icons and descriptions for intuitive sorting
- ENHANCED: Comprehensive Testing - Added 118+ unit tests covering all sorting scenarios, edge cases, and performance validation
- TECHNICAL: Full TypeScript Safety - Maintained strict type checking with enhanced error handling for new features
1.0.0
- Initial release with comprehensive JSON toolkit
- Smart compact formatting with intelligent layout decisions
- JSON minification for ultra-compact output
- JSON validation with detailed syntax error reporting and position information
- Selection support for formatting specific parts of JSON
- VS Code integration with Format Document and Format Selection providers
- Format on save with configurable automatic formatting
- Progress indicators for large file operations to provide user feedback
- Comprehensive keyboard shortcuts for formatting (
Ctrl+Alt+F), minification (Ctrl+Alt+M), and validation (Ctrl+Alt+V) with macOS variants - Full configurability with line length, indentation, and save behavior settings
- Type-safe implementation with comprehensive error handling
- Professional code structure with proper TypeScript types
- Language association for seamless VS Code integration
- Error-safe operations that never interfere with file saving
- Comprehensive test suite with 118+ automated tests covering functionality, performance, sorting algorithms, and edge cases
🧪 Testing & Quality Assurance
Comprehensive Test Coverage
This extension includes a robust testing suite ensuring reliability and performance:
- 🎯 Functional Tests: 118+ automated tests covering all features including advanced sorting ✅
- ⚡ Performance Tests: Large file handling (1MB+ JSON) and stress testing ✅
- 🔧 Integration Tests: Complete VS Code API integration validation ✅
- 🐛 Edge Case Tests: Invalid JSON, malformed data, and error scenarios ✅
- 📊 Benchmarking: Performance monitoring and regression detection ✅
Test Categories
- Core Algorithm Tests: Smart formatting logic validation
- VS Code Integration: Document providers, commands, and configuration
- Performance Benchmarks: Large JSON files (1MB+), deep nesting (100+ levels)
- Error Handling: Malformed JSON, edge cases, and graceful degradation
- Memory Management: Leak detection and concurrent operation testing
For detailed testing documentation, see TESTING.md.


