Skip to main content

Module common

Module common 

Source
Expand description

Common utility functions shared across command modules

This module provides helper functions that were previously duplicated across multiple command modules (find_cmd, query_cmd, refs_cmd, get_cmd).

Functionsยง

detect_language_from_path
Detect programming language from file path extension
extract_context_safe
Safely extract context lines from source bytes around a byte span
extract_symbol_content_safe
Safely extract symbol content from source bytes, handling multi-byte UTF-8 boundaries
format_symbol_kind
Format a SymbolKind for display
parse_symbol_kind
Parse a string into a SymbolKind (case-insensitive)
resolve_path
Resolve a file path against an optional root directory
safe_slice
Safely extract a byte slice from source with bounds checking
safe_str_slice
Safely extract a UTF-8 string slice with bounds checking