Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateBatchRegexReplaceOptions ¶
func ValidateBatchRegexReplaceOptions(opts *BatchRegexReplaceOptions) error
ValidateBatchRegexReplaceOptions 验证批量正则替换选项
Types ¶
type BatchRegexReplaceOptions ¶
type BatchRegexReplaceOptions struct {
// 正则表达式模式
Pattern string
// 替换字符串
Replacement string
// 捕获组编号(0表示替换整个匹配,>0表示替换指定捕获组)
Group int
// 是否启用详细日志
VerboseLog bool
}
BatchRegexReplaceOptions 批量正则替换选项
type BatchRegexReplaceResult ¶
type BatchRegexReplaceResult struct {
// 修改后的完整代码
ModifiedCode string
// 替换的行数
ReplacementCount int
// 修改的行详情
ModifiedLines []ModifiedLineInfo
// 是否有任何修改
HasModifications bool
}
BatchRegexReplaceResult 批量正则替换结果
func BatchRegexReplace ¶
func BatchRegexReplace(code string, opts *BatchRegexReplaceOptions) (*BatchRegexReplaceResult, error)
BatchRegexReplace 执行批量正则替换
func BatchRegexReplaceMultiPattern ¶
func BatchRegexReplaceMultiPattern(code string, patterns []BatchRegexReplaceOptions) (*BatchRegexReplaceResult, error)
BatchRegexReplaceMultiPattern 支持多个模式的批量替换
type ErrorPattern ¶
type ErrorPattern struct {
Name string
ErrorGlobs []string // Error message patterns
LineGlobs []string // Line content patterns
LineRegexps []string // Line content regexps
Hint string
Examples []string // [incorrect, correct] pairs
}
ErrorPattern represents a pattern for detecting specific syntax errors
type LoopActionHistoryProvider ¶
type LoopActionHistoryProvider interface {
Get(string) string
Set(string, any)
GetLastNAction(int) []*reactloops.ActionRecord
}
LoopActionHistoryProvider 提供 Action 历史记录的接口
type ModifiedLineInfo ¶
type ModifiedLineInfo struct {
LineNumber int // 行号(从1开始)
OriginalLine string // 原始行内容
ModifiedLine string // 修改后行内容
}
ModifiedLineInfo 修改行信息
type ModifyRecord ¶
ModifyRecord 记录单次 modify_code 操作
type YakdocSearchResult ¶
YakdocSearchResult represents a search result from yakdoc
Source Files
¶
- action_batch_regex_replace.go
- action_delete_code.go
- action_grep_yaklang_samples.go
- action_insert_code.go
- action_modify_code.go
- action_search_yaklang_samples.go
- action_write_code.go
- batch_regex_utils.go
- code.go
- code_utils.go
- document_searcher.go
- document_searcher_rag.go
- init_task.go
- spin_detection.go
- syntaxchecking.go
Click to show internal directories.
Click to hide internal directories.