Documentation
¶
Index ¶
Constants ¶
const MaxASTFileLines = 10000
MaxASTFileLines caps the line count for AST parsing before falling back to line diffing.
const MaxASTFileSize = 1024 * 1024
MaxASTFileSize caps the file size for AST parsing before falling back to line diffing.
Variables ¶
This section is empty.
Functions ¶
func HasConflictMarkers ¶
HasConflictMarkers checks if the buffer contains Git merge conflict markers.
Types ¶
type DiffOptions ¶
type DiffOptions struct {
ParseErrorLimit int
DisableErrorFallback bool
DisableSizeLimit bool
MaxASTFileSize int
DisableLineLimit bool
MaxASTFileLines int
IsConflict bool
IgnoreComments bool
EnvelopeOpts serialize.EnvelopeOptions
}
DiffOptions configures parsing limits, comment handling, and output options.
type DiffResult ¶
type DiffResult struct {
SrcBytes []byte
DstBytes []byte
SrcFile string
DstFile string
IsBinary bool
SrcAST *treesitter.ASTNode
DstAST *treesitter.ASTNode
MatchResult *engine.MatchResult
EditScript *actions.EditScript
Envelope *serialize.Envelope
}
DiffResult holds the computed ASTs, mappings, edit script, and serialized envelope.
func Run ¶
func Run(srcBytes, dstBytes []byte, srcFile, dstFile string, opts DiffOptions) (*DiffResult, error)
Run executes the diffmantic semantic diff pipeline on in-memory buffers. It parses ASTs and computes line partitions concurrently.
func RunFiles ¶
func RunFiles(fileA, fileB string, opts DiffOptions) (*DiffResult, error)
RunFiles reads two files from disk and executes the diffmantic pipeline.