actions

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 5 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

This section is empty.

Variables

This section is empty.

Functions

func FprintActions

func FprintActions(w io.Writer, es *EditScript) error

func NodeToString

func NodeToString(n *treesitter.ASTNode) string

Types

type Action

type Action struct {
	Type     ActionType
	Node     *treesitter.ASTNode
	Parent   *treesitter.ASTNode
	Position int
	Value    string
	Subtree  bool
	GroupID  string
}

func (Action) String

func (a Action) String() string

type ActionType

type ActionType int
const (
	Insert ActionType = iota
	Delete
	Update
	Move
)

func (ActionType) String

func (t ActionType) String() string

type EditScript

type EditScript struct {
	// contains filtered or unexported fields
}

func GenerateEditScript

func GenerateEditScript(
	src, dst *treesitter.ASTNode,
	ms *engine.Mapping,
) *EditScript

func NewEditScript

func NewEditScript() *EditScript

func (*EditScript) Actions

func (es *EditScript) Actions() []Action

func (*EditScript) Add

func (es *EditScript) Add(a Action)

func (*EditScript) Size

func (es *EditScript) Size() int

Jump to

Keyboard shortcuts

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