Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractLines ¶ added in v0.0.11
ExtractLines extracts lines from content based on start and end line numbers. Line numbers are 1-indexed. 0 for start means from beginning, 0 for end means to end.
func FormatFilesXML ¶
func FormatFilesXML(files []FileContent, stdin string) string
FormatFilesXML formats file contents with prompt-safe delimiters.
Types ¶
type FileContent ¶
type FileContent struct {
Path string // File path or special identifier (e.g., "clipboard")
Content string // The text content
}
FileContent represents content read from a file or other source
func ReadFiles ¶
func ReadFiles(paths []string) ([]FileContent, error)
ReadFiles reads content from the given paths Special values:
- "clipboard": reads text from system clipboard
- Glob patterns (e.g., "*.go"): expands and reads all matching files
- Regular paths: reads file content directly
- Line ranges (e.g., "main.go:11-22"): reads only specified lines
type FileSpec ¶ added in v0.0.11
type FileSpec struct {
Path string
StartLine int // 1-indexed, 0 means from beginning
EndLine int // 1-indexed, 0 means to end
HasRegion bool // true if a line range was specified
}
FileSpec represents a file with optional line range
func ParseFileSpec ¶ added in v0.0.11
ParseFileSpec parses a file specification like "main.go:11-22" Supported formats:
- main.go - Entire file (no region)
- main.go:11-22 - Lines 11-22
- main.go:11- - Lines 11 to end of file
- main.go:-22 - Lines 1-22
func (FileSpec) FormatSpecPath ¶ added in v0.0.11
FormatSpecPath returns a display path that includes the region if specified
Click to show internal directories.
Click to hide internal directories.