Module cache
Source - SessionCache
- Structure to hold cache data for a session
- add_results_to_cache
- Add search results to the cache
- debug_print_cache
- Debug function to print cache contents (only used when DEBUG=1)
- filter_matched_lines_with_cache
- Filter matched lines using the cache to skip already cached blocks
This is applied early in the search process, right after ripgrep results
- filter_results_with_cache
- Filter search results using the cache without adding to the cache
- generate_cache_key
- Generate a cache key for a search result
Format: “file.rs:23-45” (file path with start-end line numbers)
- generate_session_id
- Generate a unique 4-character alphanumeric session ID
Returns a tuple of (session_id, is_new) where is_new indicates if this is a newly generated ID
- hash_query
- Generate a hash for a query string
This is used to create a unique identifier for each query