godoctor: github.com/godoctor/godoctor/engine Index | Files | Directories

package engine

import "github.com/godoctor/godoctor/engine"

Package engine is the programmatic entrypoint to the Go refactoring engine.

Index

Package Files

engine.go

func AddDefaultRefactorings Uses

func AddDefaultRefactorings()

AddDefaultRefactorings invokes AddRefactoring on each of the Go Doctor's built-in refactorings.

Clients implementing a custom Go Doctor may: 1. not invoke this at all, 2. invoke it after adding custom refactorings, or 3. invoke it before adding custom refactorings. The choice between #2 and #3 will determine whether the client's custom refactorings are listed before or after the built-in refactorings when "godoctor -list" is run.

func AddRefactoring Uses

func AddRefactoring(shortName string, newRefac refactoring.Refactoring) error

AddRefactoring allows custom refactorings to be added to the refactoring engine. Invoke this method before starting the command line or protocol driver.

func AllRefactoringNames Uses

func AllRefactoringNames() []string

AllRefactoringNames returns the short names of all refactorings in an order suitable for display in a menu.

func ClearRefactorings Uses

func ClearRefactorings()

ClearRefactorings removes all registered refactorings from the engine. This should only be used for testing.

func GetRefactoring Uses

func GetRefactoring(shortName string) refactoring.Refactoring

GetRefactoring returns a Refactoring keyed by the given short name. The short name must be one of the keys in the map returned by AllRefactorings.

Directories

PathSynopsis
cliThe cli package provides a command-line interface for the Go Doctor.
protocolPackage protocol provides an implementation of the OpenRefactory protocol (server-side), which provides a standard mechanism for text editors to communicate with refactoring engines.

Package engine imports 2 packages (graph) and is imported by 5 packages. Updated 2018-05-18. Refresh now. Tools for package owners.