Expand description
Extract command functionality for extracting code blocks from files.
This module provides functions for extracting code blocks from files based on file paths and optional line numbers. When a line number is specified, it uses tree-sitter to find the closest suitable parent node (function, struct, class, etc.) for that line.
Modules§
- symbol_
finder - Functions for finding symbols in files.
Structs§
- Extract
Options - Options for the extract command
Enums§
- Prompt
Template - Enum representing different prompt template sources
Functions§
- extract_
file_ paths_ from_ git_ diff - Extract file paths from git diff format
- extract_
file_ paths_ from_ text - Extract file paths from text (for stdin mode)
- format_
and_ print_ extraction_ results - Format and print the extraction results in the specified format
- format_
extraction_ dry_ run - Format the extraction results for dry-run mode (only file names and line numbers)
- format_
extraction_ results - Format the extraction results in the specified format and return as a string
- handle_
extract - Handle the extract command
- is_
git_ diff_ format - Check if content is in git diff format
- parse_
file_ with_ line - Parse a file path with optional line number or range (e.g., “file.rs:10” or “file.rs:1-60”)
- process_
file_ for_ extraction - Process a single file and extract code blocks