refactor

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckResult

type CheckResult struct {
	Success     bool     `json:"success"`
	BuildOK     bool     `json:"buildOK"`
	VetOK       bool     `json:"vetOK"`
	BuildErrors []string `json:"buildErrors,omitempty"`
	VetErrors   []string `json:"vetErrors,omitempty"`
}

func Check

func Check(dir string) (*CheckResult, error)

type ContextResult

type ContextResult struct {
	Success  bool   `json:"success"`
	File     string `json:"file"`
	Line     int    `json:"line"`
	Column   int    `json:"column"`
	Scope    string `json:"scope"`
	Func     string `json:"func,omitempty"`
	Type     string `json:"type,omitempty"`
	Package  string `json:"package"`
	InBody   bool   `json:"inBody,omitempty"`
	LineText string `json:"lineText,omitempty"`
}

func Context

func Context(pos string) (*ContextResult, error)

type DefinitionResult

type DefinitionResult struct {
	Success  bool          `json:"success"`
	Symbol   string        `json:"symbol"`
	Location GoplsLocation `json:"location"`
}

func Definition

func Definition(symbol string) (*DefinitionResult, error)

type FindResult

type FindResult struct {
	Success bool             `json:"success"`
	Query   string           `json:"query"`
	Matches []SymbolLocation `json:"matches"`
	Count   int              `json:"count"`
}

func FindConst

func FindConst(name, dir string) (*FindResult, error)

func FindField

func FindField(name, dir string) (*FindResult, error)

func FindFunc

func FindFunc(name, dir string) (*FindResult, error)

func FindSymbol

func FindSymbol(name, dir string) (*FindResult, error)

func FindType

func FindType(name, dir string) (*FindResult, error)

func FindVar

func FindVar(name, dir string) (*FindResult, error)

type FormatResult

type FormatResult struct {
	Success      bool     `json:"success"`
	FilesChanged []string `json:"filesChanged"`
	Errors       []string `json:"errors,omitempty"`
}

func Format

func Format(target string) (*FormatResult, error)

type FuncLocalsResult

type FuncLocalsResult struct {
	Success bool       `json:"success"`
	Func    string     `json:"func"`
	File    string     `json:"file"`
	Params  []LocalVar `json:"params"`
	Results []LocalVar `json:"results"`
	Locals  []LocalVar `json:"locals"`
}

func FuncLocals

func FuncLocals(name string) (*FuncLocalsResult, error)

type GoplsLocation

type GoplsLocation struct {
	File   string `json:"file"`
	Line   int    `json:"line"`
	Column int    `json:"column"`
	Func   string `json:"func,omitempty"`
	Text   string `json:"text,omitempty"`
}

type LocalVar

type LocalVar struct {
	Name string `json:"name"`
	Kind string `json:"kind"`
	Type string `json:"type,omitempty"`
	Line int    `json:"line"`
}

type ModifyResult

type ModifyResult struct {
	Success bool   `json:"success"`
	File    string `json:"file"`
	Message string `json:"message"`
}

func AddFunc

func AddFunc(file string, newCode io.Reader) (*ModifyResult, error)

func Delete

func Delete(name, file string) (*ModifyResult, error)

func DeleteFunc

func DeleteFunc(name, file string) (*ModifyResult, error)

func DeleteType

func DeleteType(name, file string) (*ModifyResult, error)

func DeleteVarConst

func DeleteVarConst(name, file string) (*ModifyResult, error)

func Move

func Move(name, dstFile string) (*ModifyResult, error)

func MoveFunc

func MoveFunc(name, dstFile, srcFile string) (*ModifyResult, error)

func MoveType

func MoveType(name, dstFile, srcFile string) (*ModifyResult, error)

func MoveVarConst

func MoveVarConst(name, dstFile, srcFile string) (*ModifyResult, error)

func Replace

func Replace(name, file string, newCode io.Reader) (*ModifyResult, error)

func ReplaceFunc

func ReplaceFunc(name, file string, newCode io.Reader) (*ModifyResult, error)

func ReplaceType

func ReplaceType(name, file string, newCode io.Reader) (*ModifyResult, error)

func ReplaceVarConst

func ReplaceVarConst(name, file string, newCode io.Reader) (*ModifyResult, error)

type PackageAPIResult

type PackageAPIResult struct {
	Success  bool     `json:"success"`
	Package  string   `json:"package"`
	Path     string   `json:"path"`
	Symbols  []Symbol `json:"symbols"`
	NumFiles int      `json:"numFiles"`
}

func PackageAPI

func PackageAPI(pkgPath string) (*PackageAPIResult, error)

type PackageInfo

type PackageInfo struct {
	Name     string `json:"name"`
	Path     string `json:"path"`
	NumFiles int    `json:"numFiles"`
}

type PackagesResult

type PackagesResult struct {
	Success  bool          `json:"success"`
	Packages []PackageInfo `json:"packages"`
	Count    int           `json:"count"`
}

func ListPackages

func ListPackages(dir string) (*PackagesResult, error)

type ProjectInfo

type ProjectInfo struct {
	Success   bool     `json:"success"`
	Name      string   `json:"name"`
	Path      string   `json:"path"`
	Module    string   `json:"module,omitempty"`
	GoVersion string   `json:"goVersion,omitempty"`
	Packages  int      `json:"packages"`
	GoFiles   int      `json:"goFiles"`
	TestFiles int      `json:"testFiles"`
	Dirs      []string `json:"dirs"`
}

func ProjectOverview

func ProjectOverview(dir string) (*ProjectInfo, error)

type ReadFieldResult

type ReadFieldResult struct {
	Success bool   `json:"success"`
	Name    string `json:"name"`
	Parent  string `json:"parent"`
	File    string `json:"file"`
	Line    int    `json:"line"`
	Type    string `json:"type"`
	Tag     string `json:"tag,omitempty"`
	Code    string `json:"code"`
}

func ReadField

func ReadField(name, file string) (*ReadFieldResult, error)

type ReadFuncResult

type ReadFuncResult struct {
	Success   bool   `json:"success"`
	Name      string `json:"name"`
	File      string `json:"file"`
	Line      int    `json:"line"`
	EndLine   int    `json:"endLine"`
	Receiver  string `json:"receiver,omitempty"`
	Signature string `json:"signature"`
	Code      string `json:"code"`
}

func ReadFunc

func ReadFunc(name, file string) (*ReadFuncResult, error)

type ReadResult

type ReadResult struct {
	Success   bool   `json:"success"`
	Name      string `json:"name"`
	Kind      string `json:"kind"`
	File      string `json:"file"`
	Line      int    `json:"line"`
	EndLine   int    `json:"endLine"`
	Receiver  string `json:"receiver,omitempty"`
	Signature string `json:"signature,omitempty"`
	Code      string `json:"code"`
	Value     string `json:"value,omitempty"`
	Type      string `json:"type,omitempty"`
}

type ReadResults

type ReadResults struct {
	Success bool         `json:"success"`
	Results []ReadResult `json:"results"`
	Count   int          `json:"count"`
}

func Read

func Read(name, file string) (*ReadResults, error)

type ReadTypeResult

type ReadTypeResult struct {
	Success bool   `json:"success"`
	Name    string `json:"name"`
	Kind    string `json:"kind"`
	File    string `json:"file"`
	Line    int    `json:"line"`
	EndLine int    `json:"endLine"`
	Code    string `json:"code"`
}

func ReadType

func ReadType(name, file string) (*ReadTypeResult, error)

type ReadVarConstResult

type ReadVarConstResult struct {
	Success bool   `json:"success"`
	Name    string `json:"name"`
	Kind    string `json:"kind"`
	File    string `json:"file"`
	Line    int    `json:"line"`
	EndLine int    `json:"endLine"`
	Type    string `json:"type,omitempty"`
	Value   string `json:"value,omitempty"`
	Code    string `json:"code"`
}

func ReadVarConst

func ReadVarConst(name, file string) (*ReadVarConstResult, error)

type ReferencesResult

type ReferencesResult struct {
	Success    bool            `json:"success"`
	Symbol     string          `json:"symbol"`
	References []GoplsLocation `json:"references"`
	Count      int             `json:"count"`
}

func Callers

func Callers(funcName string) (*ReferencesResult, error)

func Implementations

func Implementations(symbol string) (*ReferencesResult, error)

func References

func References(symbol string) (*ReferencesResult, error)

type RenamePackageResult

type RenamePackageResult struct {
	Success      bool     `json:"success"`
	OldName      string   `json:"oldName"`
	NewName      string   `json:"newName"`
	FilesChanged []string `json:"filesChanged"`
	ImportsFixed int      `json:"importsFixed"`
}

func RenamePackage

func RenamePackage(oldName, newName string) (*RenamePackageResult, error)

type RenameResult

type RenameResult struct {
	Error        string   `json:"error,omitempty"`
	Success      bool     `json:"success"`
	OldName      string   `json:"oldName"`
	NewName      string   `json:"newName"`
	FilesChanged []string `json:"filesChanged"`
}

func Rename

func Rename(oldName, newName string) (*RenameResult, error)

func RenameLocal

func RenameLocal(funcName, oldVar, newVar string) (*RenameResult, error)

type Symbol

type Symbol struct {
	Name      string `json:"name"`
	Kind      string `json:"kind"`
	Exported  bool   `json:"exported"`
	Line      int    `json:"line"`
	EndLine   int    `json:"endLine"`
	Signature string `json:"signature,omitempty"`
	Receiver  string `json:"receiver,omitempty"`
}

type SymbolLocation

type SymbolLocation struct {
	Name      string `json:"name"`
	Kind      string `json:"kind"`
	File      string `json:"file"`
	Line      int    `json:"line"`
	Column    int    `json:"column"`
	EndLine   int    `json:"endLine"`
	Exported  bool   `json:"exported"`
	Signature string `json:"signature,omitempty"`
	Receiver  string `json:"receiver,omitempty"`
	Value     string `json:"value,omitempty"`
	Type      string `json:"type,omitempty"`
	Parent    string `json:"parent,omitempty"`
}

type SymbolsResult

type SymbolsResult struct {
	Success bool     `json:"success"`
	Path    string   `json:"path"`
	Package string   `json:"package,omitempty"`
	Symbols []Symbol `json:"symbols"`
	Count   int      `json:"count"`
}

func Symbols

func Symbols(path string) (*SymbolsResult, error)

type TestResult

type TestResult struct {
	Success bool   `json:"success"`
	Passed  bool   `json:"passed"`
	Output  string `json:"output"`
}

func Test

func Test(pkg string) (*TestResult, error)

Jump to

Keyboard shortcuts

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