Documentation
¶
Overview ¶
Package domain provides functionality for converting tasks, responses, and classes to and from protocol messages used in the refactoring process.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClassesToMsg ¶
ClassesToMsg compiles a protocol message from a list of classes.
Types ¶
type Class ¶
Class represents a code or text entity with a name and content.
func RespToClass ¶
func RespToClass(resp *protocol.JSONRPCResponse) (Class, error)
RespToClass converts a JSONRPCResponse into a Class, decoding file parts as needed.
func RespToClasses ¶
func RespToClasses(resp *protocol.JSONRPCResponse) ([]Class, error)
RespToClasses converts a protocol.JSONRPCResponse to a slice of Class objects.
type Critic ¶
type Critic interface {
Review(class Class) ([]Suggestion, error)
}
Critic represents an interface to review a class and provide suggestions.
type Facilitator ¶
Facilitator represents an interface to refactor tasks into multiple classes.
type Fixer ¶
type Fixer interface {
Fix(class Class, suggestions []Suggestion, example Class) (Class, error)
}
Fixer represents an interface to fix a class based on suggestions and an example.
type Suggestion ¶
type Suggestion interface {
Text() string
}
Suggestion represents a proposed improvement or fix for a class.
func NewSuggestion ¶
func NewSuggestion(text string) Suggestion
NewSuggestion creates a new Suggestion instance with the given text.
func RespToSuggestions ¶
func RespToSuggestions(resp *protocol.JSONRPCResponse) []Suggestion
RespToSuggestions converts a protocol.JSONRPCResponse to a slice of Suggestion objects.