pipeline

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const MaxASTFileLines = 10000

MaxASTFileLines caps the line count for AST parsing before falling back to line diffing.

View Source
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

func HasConflictMarkers(data []byte) bool

HasConflictMarkers checks if the buffer contains Git merge conflict markers.

func IsBinary added in v0.8.0

func IsBinary(data []byte) bool

IsBinary detects whether a byte buffer contains binary data (null bytes in the first 8000 bytes).

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL