raz-override
Override management system for raz with stable key generation that doesn't depend on exact cursor position.
Features
- Stable Key Generation: Uses function signatures and AST analysis for consistent override keys
- Fuzzy Function Detection: Intelligently detects function boundaries even with imprecise cursor positions
- Fallback Resolution: Multi-level key resolution for finding the best matching override
- Tree-sitter Integration: Accurate AST-based function signature extraction
- Debug Commands: Comprehensive tools for inspecting and managing overrides
- Override Preview: See changes before applying them
- Export/Import: Backup and share override configurations
Key Components
Override Key Generation
- Function signature-based keys (e.g.,
fn:test_my_function) - File + line range keys for non-function contexts
- Hierarchical fallback resolution
Function Detection
- Tree-sitter based AST analysis
- Fuzzy boundary detection within tolerance
- Support for nested functions and closures
Override Resolution
- Try exact function signature match
- Try file + expanded line range
- Try file-level override
- Try workspace default
Debugging and Inspection
The crate includes comprehensive debugging tools:
CLI Commands
raz override list- List all overridesraz override inspect <key>- Inspect specific overrideraz override debug <file> <line> [column]- Debug resolutionraz override stats- Show statisticsraz override export/import- Backup and restoreraz override migrate- Migrate legacy overrides
See debugging-commands.md for detailed usage.
Migration from Legacy Overrides
If you have existing overrides using the old cursor position-based format, use the migration tool:
# Auto-detect and migrate legacy overrides
# Preview migration changes
# Migrate specific file
See migration-guide.md for complete migration instructions.