refactor

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package refactor performs AST-aware declaration renaming with optional cross-package callsite updates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Edit

type Edit struct {
	File     string `json:"file"`
	Kind     string `json:"kind"`
	Category string `json:"category"`
	OldName  string `json:"old_name"`
	NewName  string `json:"new_name"`
	Line     int    `json:"line"`
	Column   int    `json:"column"`
	Offset   int    `json:"offset"`
	Applied  bool   `json:"applied"`
	Skipped  bool   `json:"skipped,omitempty"`
	SkipNote string `json:"skip_note,omitempty"`
}

type Options

type Options struct {
	Write                 bool
	UpdateCallsites       bool
	CrossPackageCallsites bool
	Engine                string
}

type Report

type Report struct {
	Root                  string `json:"root"`
	Selector              string `json:"selector"`
	NewName               string `json:"new_name"`
	Engine                string `json:"engine"`
	Write                 bool   `json:"write"`
	UpdateCallsites       bool   `json:"update_callsites"`
	CrossPackageCallsites bool   `json:"cross_package_callsites"`
	MatchCount            int    `json:"match_count"`
	PlannedEdits          int    `json:"planned_edits"`
	PlannedDeclEdits      int    `json:"planned_declaration_edits"`
	PlannedUseEdits       int    `json:"planned_callsite_edits"`
	AppliedEdits          int    `json:"applied_edits"`
	ChangedFiles          int    `json:"changed_files"`
	Edits                 []Edit `json:"edits,omitempty"`
}

func RenameDeclarations

func RenameDeclarations(idx *model.Index, selector query.Selector, newName string, opts Options) (Report, error)

Jump to

Keyboard shortcuts

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