Documentation
¶
Index ¶
- type AnalyzeDependenciesOperation
- func (op *AnalyzeDependenciesOperation) Description() string
- func (op *AnalyzeDependenciesOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
- func (op *AnalyzeDependenciesOperation) Type() types.OperationType
- func (op *AnalyzeDependenciesOperation) Validate(ws *types.Workspace) error
- type BackwardDep
- type BatchOperation
- func CreateExtractAndRenameWorkflow(structName, methodName, newMethodName string, sourceFile string, ...) *BatchOperation
- func CreateInterfaceExtractionWorkflow(sourceStruct, interfaceName string, methods []string, targetPackage string) *BatchOperation
- func CreateMoveAndUpdateWorkflow(symbolName, fromPackage, toPackage string) *BatchOperation
- type BatchOperationBuilder
- func (b *BatchOperationBuilder) AddExtractInterfaceOperation(sourceStruct, interfaceName string, methods []string, targetPackage string) *BatchOperationBuilder
- func (b *BatchOperationBuilder) AddExtractMethodOperation(sourceFile string, startLine, endLine int, methodName, targetStruct string) *BatchOperationBuilder
- func (b *BatchOperationBuilder) AddExtractVariableOperation(sourceFile string, startLine, endLine int, variableName, expression string) *BatchOperationBuilder
- func (b *BatchOperationBuilder) AddInlineConstantOperation(constantName, sourceFile string, scope types.RenameScope) *BatchOperationBuilder
- func (b *BatchOperationBuilder) AddInlineFunctionOperation(functionName, sourceFile string, targetFiles []string) *BatchOperationBuilder
- func (b *BatchOperationBuilder) AddInlineMethodOperation(methodName, sourceStruct, targetFile string) *BatchOperationBuilder
- func (b *BatchOperationBuilder) AddInlineVariableOperation(variableName, sourceFile string, startLine, endLine int) *BatchOperationBuilder
- func (b *BatchOperationBuilder) AddMoveOperation(symbolName, fromPackage, toPackage string) *BatchOperationBuilder
- func (b *BatchOperationBuilder) AddOperation(op types.Operation) *BatchOperationBuilder
- func (b *BatchOperationBuilder) AddRenameOperation(symbolName, newName, packagePath string, scope types.RenameScope) *BatchOperationBuilder
- func (b *BatchOperationBuilder) Build() *BatchOperation
- func (b *BatchOperationBuilder) SetAtomic(atomic bool) *BatchOperationBuilder
- type BatchOperationOperation
- type BlockInfo
- type ChangeSignatureOperation
- func (op *ChangeSignatureOperation) Description() string
- func (op *ChangeSignatureOperation) Execute(ws *pkgtypes.Workspace) (*pkgtypes.RefactoringPlan, error)
- func (op *ChangeSignatureOperation) Type() pkgtypes.OperationType
- func (op *ChangeSignatureOperation) Validate(ws *pkgtypes.Workspace) error
- type CleanAliasesOperation
- type ConstantReference
- type ConvertAliasesOperation
- type CreateFacadeOperation
- type DefaultEngine
- func (e *DefaultEngine) AnalyzeDependencies(ws *types.Workspace, req types.AnalyzeDependenciesRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) AnalyzeImpact(ws *types.Workspace, op types.Operation) (*types.ImpactAnalysis, error)
- func (e *DefaultEngine) BatchOperations(ws *types.Workspace, req types.BatchOperationRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) BatchRefactor(ws *types.Workspace, ops []types.Operation) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) CleanAliases(ws *types.Workspace, req types.CleanAliasesRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) ConvertAliases(ws *types.Workspace, req types.ConvertAliasesRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) CreateFacade(ws *types.Workspace, req types.CreateFacadeRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) CreatePlan(ws *types.Workspace, req types.PlanOperationRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) ExecutePlan(plan *types.RefactoringPlan) error
- func (e *DefaultEngine) ExecutePlanFromFile(req types.ExecuteOperationRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) ExtractFunction(ws *types.Workspace, req types.ExtractFunctionRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) ExtractInterface(ws *types.Workspace, req types.ExtractInterfaceRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) ExtractMethod(ws *types.Workspace, req types.ExtractMethodRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) ExtractVariable(ws *types.Workspace, req types.ExtractVariableRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) FixCycles(ws *types.Workspace, req types.FixCyclesRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) GenerateFacades(ws *types.Workspace, req types.GenerateFacadesRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) InlineFunction(ws *types.Workspace, req types.InlineFunctionRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) InlineMethod(ws *types.Workspace, req types.InlineMethodRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) InlineVariable(ws *types.Workspace, req types.InlineVariableRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) LoadWorkspace(path string) (*types.Workspace, error)
- func (e *DefaultEngine) MoveByDependencies(ws *types.Workspace, req types.MoveByDependenciesRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) MoveDir(ws *types.Workspace, req types.MoveDirRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) MovePackage(ws *types.Workspace, req types.MovePackageRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) MovePackages(ws *types.Workspace, req types.MovePackagesRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) MoveSymbol(ws *types.Workspace, req types.MoveSymbolRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) OrganizeByLayers(ws *types.Workspace, req types.OrganizeByLayersRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) PreviewPlan(plan *types.RefactoringPlan) (string, error)
- func (e *DefaultEngine) RenameInterfaceMethod(ws *types.Workspace, req types.RenameInterfaceMethodRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) RenameMethod(ws *types.Workspace, req types.RenameMethodRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) RenamePackage(ws *types.Workspace, req types.RenamePackageRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) RenameSymbol(ws *types.Workspace, req types.RenameSymbolRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) ResolveAliasConflicts(ws *types.Workspace, req types.ResolveAliasConflictsRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) RollbackOperations(req types.RollbackOperationRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) SaveWorkspace(ws *types.Workspace) error
- func (e *DefaultEngine) StandardizeImports(ws *types.Workspace, req types.StandardizeImportsRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) UpdateFacades(ws *types.Workspace, req types.UpdateFacadesRequest) (*types.RefactoringPlan, error)
- func (e *DefaultEngine) ValidateRefactoring(plan *types.RefactoringPlan) error
- type DependencyAnalysis
- type EngineConfig
- type ExecuteOperation
- type ExtractBlockOperation
- type ExtractConstantOperation
- func (op *ExtractConstantOperation) Description() string
- func (op *ExtractConstantOperation) Execute(ws *pkgtypes.Workspace) (*pkgtypes.RefactoringPlan, error)
- func (op *ExtractConstantOperation) Type() pkgtypes.OperationType
- func (op *ExtractConstantOperation) Validate(ws *pkgtypes.Workspace) error
- type ExtractFunctionOperation
- type ExtractInterfaceOperation
- type ExtractMethodOperation
- type ExtractVariableOperation
- type FixCyclesOperation
- type GenerateFacadesOperation
- type InlineConstantOperation
- type InlineFunctionOperation
- type InlineMethodOperation
- type InlineVariableOperation
- type LiteralOccurrence
- type MethodCall
- type MoveByDependenciesOperation
- func (op *MoveByDependenciesOperation) Description() string
- func (op *MoveByDependenciesOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
- func (op *MoveByDependenciesOperation) Type() types.OperationType
- func (op *MoveByDependenciesOperation) Validate(ws *types.Workspace) error
- type MoveDirOperation
- type MovePackageOperation
- type MovePackagesOperation
- type MoveSymbolOperation
- type OrganizeByLayersOperation
- type PackageMetric
- type Parameter
- type PlanOperation
- type RefactorEngine
- type RefactoringPlanFile
- type RenameInterfaceMethodOperation
- func (op *RenameInterfaceMethodOperation) Description() string
- func (op *RenameInterfaceMethodOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
- func (op *RenameInterfaceMethodOperation) Type() types.OperationType
- func (op *RenameInterfaceMethodOperation) Validate(ws *types.Workspace) error
- type RenameMethodOperation
- type RenamePackageOperation
- type RenameSymbolOperation
- type ResolveAliasConflictsOperation
- func (op *ResolveAliasConflictsOperation) Description() string
- func (op *ResolveAliasConflictsOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
- func (op *ResolveAliasConflictsOperation) Type() types.OperationType
- func (op *ResolveAliasConflictsOperation) Validate(ws *types.Workspace) error
- type RollbackOperation
- type SafeDeleteOperation
- type Serializer
- func (s *Serializer) ApplyChanges(ws *refactorTypes.Workspace, changes []refactorTypes.Change) error
- func (s *Serializer) BackupFile(filePath string) (string, error)
- func (s *Serializer) GenerateDiff(filePath string, originalContent, modifiedContent string) (string, error)
- func (s *Serializer) GetFileLines(filePath string, startLine, endLine int) ([]string, error)
- func (s *Serializer) PreviewChanges(ws *refactorTypes.Workspace, changes []refactorTypes.Change) (string, error)
- func (s *Serializer) RestoreFromBackup(filePath, backupPath string) error
- func (s *Serializer) ValidateFileStructure(filePath string) error
- type StandardizeImportsOperation
- func (op *StandardizeImportsOperation) Description() string
- func (op *StandardizeImportsOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
- func (op *StandardizeImportsOperation) Type() types.OperationType
- func (op *StandardizeImportsOperation) Validate(ws *types.Workspace) error
- type SuggestedMove
- type UpdateFacadesOperation
- type Validator
- func (v *Validator) ValidateMove(ws *refactorTypes.Workspace, req refactorTypes.MoveSymbolRequest) []refactorTypes.Issue
- func (v *Validator) ValidatePlan(plan *refactorTypes.RefactoringPlan) error
- func (v *Validator) ValidatePlanWithConfig(plan *refactorTypes.RefactoringPlan, config *EngineConfig) error
- func (v *Validator) ValidateRename(ws *refactorTypes.Workspace, req refactorTypes.RenameSymbolRequest) []refactorTypes.Issue
- type VariableReference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalyzeDependenciesOperation ¶
type AnalyzeDependenciesOperation struct {
Request types.AnalyzeDependenciesRequest
}
AnalyzeDependenciesOperation implements analyzing dependency flow
func (*AnalyzeDependenciesOperation) Description ¶
func (op *AnalyzeDependenciesOperation) Description() string
func (*AnalyzeDependenciesOperation) Execute ¶
func (op *AnalyzeDependenciesOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*AnalyzeDependenciesOperation) Type ¶
func (op *AnalyzeDependenciesOperation) Type() types.OperationType
type BackwardDep ¶
type BatchOperation ¶
type BatchOperation struct {
Operations []types.Operation
Name string
Atomic bool // If true, all operations must succeed or none are applied
}
BatchOperation implements executing multiple operations as a single transaction
func CreateExtractAndRenameWorkflow ¶
func CreateExtractAndRenameWorkflow(structName, methodName, newMethodName string, sourceFile string, startLine, endLine int) *BatchOperation
CreateRefactoringWorkflow creates common refactoring workflows
func CreateInterfaceExtractionWorkflow ¶
func CreateInterfaceExtractionWorkflow(sourceStruct, interfaceName string, methods []string, targetPackage string) *BatchOperation
func CreateMoveAndUpdateWorkflow ¶
func CreateMoveAndUpdateWorkflow(symbolName, fromPackage, toPackage string) *BatchOperation
func (*BatchOperation) Description ¶
func (op *BatchOperation) Description() string
func (*BatchOperation) Execute ¶
func (op *BatchOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*BatchOperation) Type ¶
func (op *BatchOperation) Type() types.OperationType
type BatchOperationBuilder ¶
type BatchOperationBuilder struct {
// contains filtered or unexported fields
}
BatchOperationBuilder provides a fluent interface for building batch operations
func NewBatchOperation ¶
func NewBatchOperation(name string) *BatchOperationBuilder
func (*BatchOperationBuilder) AddExtractInterfaceOperation ¶
func (b *BatchOperationBuilder) AddExtractInterfaceOperation(sourceStruct, interfaceName string, methods []string, targetPackage string) *BatchOperationBuilder
func (*BatchOperationBuilder) AddExtractMethodOperation ¶
func (b *BatchOperationBuilder) AddExtractMethodOperation(sourceFile string, startLine, endLine int, methodName, targetStruct string) *BatchOperationBuilder
func (*BatchOperationBuilder) AddExtractVariableOperation ¶
func (b *BatchOperationBuilder) AddExtractVariableOperation(sourceFile string, startLine, endLine int, variableName, expression string) *BatchOperationBuilder
func (*BatchOperationBuilder) AddInlineConstantOperation ¶
func (b *BatchOperationBuilder) AddInlineConstantOperation(constantName, sourceFile string, scope types.RenameScope) *BatchOperationBuilder
func (*BatchOperationBuilder) AddInlineFunctionOperation ¶
func (b *BatchOperationBuilder) AddInlineFunctionOperation(functionName, sourceFile string, targetFiles []string) *BatchOperationBuilder
func (*BatchOperationBuilder) AddInlineMethodOperation ¶
func (b *BatchOperationBuilder) AddInlineMethodOperation(methodName, sourceStruct, targetFile string) *BatchOperationBuilder
func (*BatchOperationBuilder) AddInlineVariableOperation ¶
func (b *BatchOperationBuilder) AddInlineVariableOperation(variableName, sourceFile string, startLine, endLine int) *BatchOperationBuilder
func (*BatchOperationBuilder) AddMoveOperation ¶
func (b *BatchOperationBuilder) AddMoveOperation(symbolName, fromPackage, toPackage string) *BatchOperationBuilder
func (*BatchOperationBuilder) AddOperation ¶
func (b *BatchOperationBuilder) AddOperation(op types.Operation) *BatchOperationBuilder
func (*BatchOperationBuilder) AddRenameOperation ¶
func (b *BatchOperationBuilder) AddRenameOperation(symbolName, newName, packagePath string, scope types.RenameScope) *BatchOperationBuilder
func (*BatchOperationBuilder) Build ¶
func (b *BatchOperationBuilder) Build() *BatchOperation
func (*BatchOperationBuilder) SetAtomic ¶
func (b *BatchOperationBuilder) SetAtomic(atomic bool) *BatchOperationBuilder
type BatchOperationOperation ¶
type BatchOperationOperation struct {
Request types.BatchOperationRequest
}
BatchOperationOperation implements executing multiple operations atomically
func (*BatchOperationOperation) Description ¶
func (op *BatchOperationOperation) Description() string
func (*BatchOperationOperation) Execute ¶
func (op *BatchOperationOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*BatchOperationOperation) Type ¶
func (op *BatchOperationOperation) Type() types.OperationType
type BlockInfo ¶
type BlockInfo struct {
StartLine int
EndLine int
BlockType string // "if", "for", "switch", "function", etc.
}
BlockInfo represents information about a detected block
type ChangeSignatureOperation ¶
type ChangeSignatureOperation struct {
FunctionName string
SourceFile string
NewParams []Parameter
NewReturns []string
Scope pkgtypes.RenameScope // PackageScope or WorkspaceScope
}
ChangeSignatureOperation implements changing function/method signatures
func (*ChangeSignatureOperation) Description ¶
func (op *ChangeSignatureOperation) Description() string
func (*ChangeSignatureOperation) Execute ¶
func (op *ChangeSignatureOperation) Execute(ws *pkgtypes.Workspace) (*pkgtypes.RefactoringPlan, error)
func (*ChangeSignatureOperation) Type ¶
func (op *ChangeSignatureOperation) Type() pkgtypes.OperationType
type CleanAliasesOperation ¶
type CleanAliasesOperation struct {
Request types.CleanAliasesRequest
}
CleanAliasesOperation implements cleaning import aliases
func (*CleanAliasesOperation) Description ¶
func (op *CleanAliasesOperation) Description() string
func (*CleanAliasesOperation) Execute ¶
func (op *CleanAliasesOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*CleanAliasesOperation) Type ¶
func (op *CleanAliasesOperation) Type() types.OperationType
type ConstantReference ¶
type ConvertAliasesOperation ¶
type ConvertAliasesOperation struct {
Request types.ConvertAliasesRequest
}
ConvertAliasesOperation implements converting between aliased and non-aliased imports
func (*ConvertAliasesOperation) Description ¶
func (op *ConvertAliasesOperation) Description() string
func (*ConvertAliasesOperation) Execute ¶
func (op *ConvertAliasesOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*ConvertAliasesOperation) Type ¶
func (op *ConvertAliasesOperation) Type() types.OperationType
type CreateFacadeOperation ¶
type CreateFacadeOperation struct {
Request types.CreateFacadeRequest
}
CreateFacadeOperation implements creating facade packages
func (*CreateFacadeOperation) Description ¶
func (op *CreateFacadeOperation) Description() string
func (*CreateFacadeOperation) Execute ¶
func (op *CreateFacadeOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*CreateFacadeOperation) Type ¶
func (op *CreateFacadeOperation) Type() types.OperationType
type DefaultEngine ¶
type DefaultEngine struct {
// contains filtered or unexported fields
}
DefaultEngine implements the Engine interface
func (*DefaultEngine) AnalyzeDependencies ¶
func (e *DefaultEngine) AnalyzeDependencies(ws *types.Workspace, req types.AnalyzeDependenciesRequest) (*types.RefactoringPlan, error)
AnalyzeDependencies implements analyzing dependency flow
func (*DefaultEngine) AnalyzeImpact ¶
func (e *DefaultEngine) AnalyzeImpact(ws *types.Workspace, op types.Operation) (*types.ImpactAnalysis, error)
AnalyzeImpact analyzes the impact of a refactoring operation
func (*DefaultEngine) BatchOperations ¶
func (e *DefaultEngine) BatchOperations(ws *types.Workspace, req types.BatchOperationRequest) (*types.RefactoringPlan, error)
BatchOperations implements executing multiple operations atomically
func (*DefaultEngine) BatchRefactor ¶
func (e *DefaultEngine) BatchRefactor(ws *types.Workspace, ops []types.Operation) (*types.RefactoringPlan, error)
BatchRefactor executes multiple refactoring operations as a batch
func (*DefaultEngine) CleanAliases ¶
func (e *DefaultEngine) CleanAliases(ws *types.Workspace, req types.CleanAliasesRequest) (*types.RefactoringPlan, error)
CleanAliases implements cleaning import aliases
func (*DefaultEngine) ConvertAliases ¶
func (e *DefaultEngine) ConvertAliases(ws *types.Workspace, req types.ConvertAliasesRequest) (*types.RefactoringPlan, error)
ConvertAliases implements converting between aliased and non-aliased imports
func (*DefaultEngine) CreateFacade ¶
func (e *DefaultEngine) CreateFacade(ws *types.Workspace, req types.CreateFacadeRequest) (*types.RefactoringPlan, error)
CreateFacade implements creating facade packages
func (*DefaultEngine) CreatePlan ¶
func (e *DefaultEngine) CreatePlan(ws *types.Workspace, req types.PlanOperationRequest) (*types.RefactoringPlan, error)
CreatePlan implements creating a refactoring plan
func (*DefaultEngine) ExecutePlan ¶
func (e *DefaultEngine) ExecutePlan(plan *types.RefactoringPlan) error
ExecutePlan applies a refactoring plan to the workspace
func (*DefaultEngine) ExecutePlanFromFile ¶
func (e *DefaultEngine) ExecutePlanFromFile(req types.ExecuteOperationRequest) (*types.RefactoringPlan, error)
ExecutePlanFromFile implements executing a previously created plan
func (*DefaultEngine) ExtractFunction ¶
func (e *DefaultEngine) ExtractFunction(ws *types.Workspace, req types.ExtractFunctionRequest) (*types.RefactoringPlan, error)
ExtractFunction implements function extraction from code blocks
func (*DefaultEngine) ExtractInterface ¶
func (e *DefaultEngine) ExtractInterface(ws *types.Workspace, req types.ExtractInterfaceRequest) (*types.RefactoringPlan, error)
ExtractInterface implements interface extraction from structs
func (*DefaultEngine) ExtractMethod ¶
func (e *DefaultEngine) ExtractMethod(ws *types.Workspace, req types.ExtractMethodRequest) (*types.RefactoringPlan, error)
ExtractMethod implements method extraction from code blocks
func (*DefaultEngine) ExtractVariable ¶
func (e *DefaultEngine) ExtractVariable(ws *types.Workspace, req types.ExtractVariableRequest) (*types.RefactoringPlan, error)
ExtractVariable implements variable extraction from expressions
func (*DefaultEngine) FixCycles ¶
func (e *DefaultEngine) FixCycles(ws *types.Workspace, req types.FixCyclesRequest) (*types.RefactoringPlan, error)
FixCycles implements detecting and fixing circular dependencies
func (*DefaultEngine) GenerateFacades ¶
func (e *DefaultEngine) GenerateFacades(ws *types.Workspace, req types.GenerateFacadesRequest) (*types.RefactoringPlan, error)
GenerateFacades implements auto-generating facades
func (*DefaultEngine) InlineFunction ¶
func (e *DefaultEngine) InlineFunction(ws *types.Workspace, req types.InlineFunctionRequest) (*types.RefactoringPlan, error)
InlineFunction implements function call inlining
func (*DefaultEngine) InlineMethod ¶
func (e *DefaultEngine) InlineMethod(ws *types.Workspace, req types.InlineMethodRequest) (*types.RefactoringPlan, error)
InlineMethod implements method call inlining
func (*DefaultEngine) InlineVariable ¶
func (e *DefaultEngine) InlineVariable(ws *types.Workspace, req types.InlineVariableRequest) (*types.RefactoringPlan, error)
InlineVariable implements variable inlining
func (*DefaultEngine) LoadWorkspace ¶
func (e *DefaultEngine) LoadWorkspace(path string) (*types.Workspace, error)
LoadWorkspace loads and parses a complete workspace
func (*DefaultEngine) MoveByDependencies ¶
func (e *DefaultEngine) MoveByDependencies(ws *types.Workspace, req types.MoveByDependenciesRequest) (*types.RefactoringPlan, error)
MoveByDependencies implements moving symbols based on dependency analysis
func (*DefaultEngine) MoveDir ¶
func (e *DefaultEngine) MoveDir(ws *types.Workspace, req types.MoveDirRequest) (*types.RefactoringPlan, error)
MoveDir implements moving directory structures
func (*DefaultEngine) MovePackage ¶
func (e *DefaultEngine) MovePackage(ws *types.Workspace, req types.MovePackageRequest) (*types.RefactoringPlan, error)
MovePackage implements moving entire packages
func (*DefaultEngine) MovePackages ¶
func (e *DefaultEngine) MovePackages(ws *types.Workspace, req types.MovePackagesRequest) (*types.RefactoringPlan, error)
MovePackages implements moving multiple packages atomically
func (*DefaultEngine) MoveSymbol ¶
func (e *DefaultEngine) MoveSymbol(ws *types.Workspace, req types.MoveSymbolRequest) (*types.RefactoringPlan, error)
MoveSymbol implements symbol moving between packages
func (*DefaultEngine) OrganizeByLayers ¶
func (e *DefaultEngine) OrganizeByLayers(ws *types.Workspace, req types.OrganizeByLayersRequest) (*types.RefactoringPlan, error)
OrganizeByLayers implements organizing packages by architectural layers
func (*DefaultEngine) PreviewPlan ¶
func (e *DefaultEngine) PreviewPlan(plan *types.RefactoringPlan) (string, error)
PreviewPlan generates a preview of the changes without applying them
func (*DefaultEngine) RenameInterfaceMethod ¶
func (e *DefaultEngine) RenameInterfaceMethod(ws *types.Workspace, req types.RenameInterfaceMethodRequest) (*types.RefactoringPlan, error)
RenameInterfaceMethod implements interface method renaming
func (*DefaultEngine) RenameMethod ¶
func (e *DefaultEngine) RenameMethod(ws *types.Workspace, req types.RenameMethodRequest) (*types.RefactoringPlan, error)
RenameMethod implements renaming methods on specific types (structs or interfaces)
func (*DefaultEngine) RenamePackage ¶
func (e *DefaultEngine) RenamePackage(ws *types.Workspace, req types.RenamePackageRequest) (*types.RefactoringPlan, error)
RenamePackage implements package renaming
func (*DefaultEngine) RenameSymbol ¶
func (e *DefaultEngine) RenameSymbol(ws *types.Workspace, req types.RenameSymbolRequest) (*types.RefactoringPlan, error)
RenameSymbol implements symbol renaming
func (*DefaultEngine) ResolveAliasConflicts ¶
func (e *DefaultEngine) ResolveAliasConflicts(ws *types.Workspace, req types.ResolveAliasConflictsRequest) (*types.RefactoringPlan, error)
ResolveAliasConflicts implements resolving import alias conflicts
func (*DefaultEngine) RollbackOperations ¶
func (e *DefaultEngine) RollbackOperations(req types.RollbackOperationRequest) (*types.RefactoringPlan, error)
RollbackOperations implements rolling back operations
func (*DefaultEngine) SaveWorkspace ¶
func (e *DefaultEngine) SaveWorkspace(ws *types.Workspace) error
SaveWorkspace saves all changes in the workspace to disk
func (*DefaultEngine) StandardizeImports ¶
func (e *DefaultEngine) StandardizeImports(ws *types.Workspace, req types.StandardizeImportsRequest) (*types.RefactoringPlan, error)
StandardizeImports implements standardizing import aliases
func (*DefaultEngine) UpdateFacades ¶
func (e *DefaultEngine) UpdateFacades(ws *types.Workspace, req types.UpdateFacadesRequest) (*types.RefactoringPlan, error)
UpdateFacades implements updating existing facades
func (*DefaultEngine) ValidateRefactoring ¶
func (e *DefaultEngine) ValidateRefactoring(plan *types.RefactoringPlan) error
ValidateRefactoring validates a complete refactoring plan
type DependencyAnalysis ¶
type DependencyAnalysis struct {
Workspace string `json:"workspace"`
TotalPackages int `json:"total_packages"`
BackwardsDeps []BackwardDep `json:"backwards_dependencies,omitempty"`
SuggestedMoves []SuggestedMove `json:"suggested_moves,omitempty"`
PackageMetrics map[string]PackageMetric `json:"package_metrics"`
}
type EngineConfig ¶
EngineConfig contains configuration options for the refactoring engine
func DefaultConfig ¶
func DefaultConfig() *EngineConfig
DefaultConfig returns the default engine configuration
type ExecuteOperation ¶
type ExecuteOperation struct {
Request types.ExecuteOperationRequest
}
ExecuteOperation implements executing a previously created plan
func (*ExecuteOperation) Description ¶
func (op *ExecuteOperation) Description() string
func (*ExecuteOperation) Execute ¶
func (op *ExecuteOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*ExecuteOperation) Type ¶
func (op *ExecuteOperation) Type() types.OperationType
type ExtractBlockOperation ¶
type ExtractBlockOperation struct {
SourceFile string
Position int // Line or character position within the target block
NewFunctionName string
}
ExtractBlockOperation implements extracting a function from a block (auto-detects boundaries)
func (*ExtractBlockOperation) Description ¶
func (op *ExtractBlockOperation) Description() string
func (*ExtractBlockOperation) Execute ¶
func (op *ExtractBlockOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*ExtractBlockOperation) Type ¶
func (op *ExtractBlockOperation) Type() types.OperationType
type ExtractConstantOperation ¶
type ExtractConstantOperation struct {
SourceFile string
Position token.Pos // Position of the literal to extract
ConstantName string
Scope pkgtypes.RenameScope // PackageScope or WorkspaceScope
TargetFile string // Optional: specific file to place the constant
}
ExtractConstantOperation implements extracting a literal value into a constant
func (*ExtractConstantOperation) Description ¶
func (op *ExtractConstantOperation) Description() string
func (*ExtractConstantOperation) Execute ¶
func (op *ExtractConstantOperation) Execute(ws *pkgtypes.Workspace) (*pkgtypes.RefactoringPlan, error)
func (*ExtractConstantOperation) Type ¶
func (op *ExtractConstantOperation) Type() pkgtypes.OperationType
type ExtractFunctionOperation ¶
type ExtractFunctionOperation struct {
SourceFile string
StartLine int
EndLine int
NewFunctionName string
}
ExtractFunctionOperation implements extracting a function from a code block
func (*ExtractFunctionOperation) Description ¶
func (op *ExtractFunctionOperation) Description() string
func (*ExtractFunctionOperation) Execute ¶
func (op *ExtractFunctionOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*ExtractFunctionOperation) Type ¶
func (op *ExtractFunctionOperation) Type() types.OperationType
type ExtractInterfaceOperation ¶
type ExtractInterfaceOperation struct {
SourceStruct string
InterfaceName string
Methods []string
TargetPackage string
}
ExtractInterfaceOperation implements extracting an interface from a struct
func (*ExtractInterfaceOperation) Description ¶
func (op *ExtractInterfaceOperation) Description() string
func (*ExtractInterfaceOperation) Execute ¶
func (op *ExtractInterfaceOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*ExtractInterfaceOperation) Type ¶
func (op *ExtractInterfaceOperation) Type() types.OperationType
type ExtractMethodOperation ¶
type ExtractMethodOperation struct {
SourceFile string
StartLine int
EndLine int
NewMethodName string
TargetStruct string
}
ExtractMethodOperation implements extracting a method from a code block
func (*ExtractMethodOperation) Description ¶
func (op *ExtractMethodOperation) Description() string
func (*ExtractMethodOperation) Execute ¶
func (op *ExtractMethodOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*ExtractMethodOperation) Type ¶
func (op *ExtractMethodOperation) Type() types.OperationType
type ExtractVariableOperation ¶
type ExtractVariableOperation struct {
SourceFile string
StartLine int
EndLine int
VariableName string
Expression string
}
ExtractVariableOperation implements extracting a variable from an expression
func (*ExtractVariableOperation) Description ¶
func (op *ExtractVariableOperation) Description() string
func (*ExtractVariableOperation) Execute ¶
func (op *ExtractVariableOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*ExtractVariableOperation) Type ¶
func (op *ExtractVariableOperation) Type() types.OperationType
type FixCyclesOperation ¶
type FixCyclesOperation struct {
Request types.FixCyclesRequest
}
FixCyclesOperation implements detecting and fixing circular dependencies
func (*FixCyclesOperation) Description ¶
func (op *FixCyclesOperation) Description() string
func (*FixCyclesOperation) Execute ¶
func (op *FixCyclesOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*FixCyclesOperation) Type ¶
func (op *FixCyclesOperation) Type() types.OperationType
type GenerateFacadesOperation ¶
type GenerateFacadesOperation struct {
Request types.GenerateFacadesRequest
}
GenerateFacadesOperation implements auto-generating facades
func (*GenerateFacadesOperation) Description ¶
func (op *GenerateFacadesOperation) Description() string
func (*GenerateFacadesOperation) Execute ¶
func (op *GenerateFacadesOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*GenerateFacadesOperation) Type ¶
func (op *GenerateFacadesOperation) Type() types.OperationType
type InlineConstantOperation ¶
type InlineConstantOperation struct {
ConstantName string
SourceFile string
Scope types.RenameScope
}
InlineConstantOperation implements inlining a constant
func (*InlineConstantOperation) Description ¶
func (op *InlineConstantOperation) Description() string
func (*InlineConstantOperation) Execute ¶
func (op *InlineConstantOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*InlineConstantOperation) Type ¶
func (op *InlineConstantOperation) Type() types.OperationType
type InlineFunctionOperation ¶
InlineFunctionOperation implements inlining a function
func (*InlineFunctionOperation) Description ¶
func (op *InlineFunctionOperation) Description() string
func (*InlineFunctionOperation) Execute ¶
func (op *InlineFunctionOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*InlineFunctionOperation) Type ¶
func (op *InlineFunctionOperation) Type() types.OperationType
type InlineMethodOperation ¶
InlineMethodOperation implements inlining a method call with its implementation
func (*InlineMethodOperation) Description ¶
func (op *InlineMethodOperation) Description() string
func (*InlineMethodOperation) Execute ¶
func (op *InlineMethodOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*InlineMethodOperation) Type ¶
func (op *InlineMethodOperation) Type() types.OperationType
type InlineVariableOperation ¶
type InlineVariableOperation struct {
VariableName string
SourceFile string
StartLine int
EndLine int
}
InlineVariableOperation implements inlining a variable with its value
func (*InlineVariableOperation) Description ¶
func (op *InlineVariableOperation) Description() string
func (*InlineVariableOperation) Execute ¶
func (op *InlineVariableOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*InlineVariableOperation) Type ¶
func (op *InlineVariableOperation) Type() types.OperationType
type LiteralOccurrence ¶
LiteralOccurrence represents a location where a literal value appears
type MoveByDependenciesOperation ¶
type MoveByDependenciesOperation struct {
Request types.MoveByDependenciesRequest
}
MoveByDependenciesOperation implements moving symbols based on dependency analysis
func (*MoveByDependenciesOperation) Description ¶
func (op *MoveByDependenciesOperation) Description() string
func (*MoveByDependenciesOperation) Execute ¶
func (op *MoveByDependenciesOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*MoveByDependenciesOperation) Type ¶
func (op *MoveByDependenciesOperation) Type() types.OperationType
type MoveDirOperation ¶
type MoveDirOperation struct {
Request types.MoveDirRequest
}
MoveDirOperation implements moving directory structures
func (*MoveDirOperation) Description ¶
func (op *MoveDirOperation) Description() string
func (*MoveDirOperation) Execute ¶
func (op *MoveDirOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*MoveDirOperation) Type ¶
func (op *MoveDirOperation) Type() types.OperationType
type MovePackageOperation ¶
type MovePackageOperation struct {
Request types.MovePackageRequest
}
MovePackageOperation implements moving entire packages
func (*MovePackageOperation) Description ¶
func (op *MovePackageOperation) Description() string
func (*MovePackageOperation) Execute ¶
func (op *MovePackageOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*MovePackageOperation) Type ¶
func (op *MovePackageOperation) Type() types.OperationType
type MovePackagesOperation ¶
type MovePackagesOperation struct {
Request types.MovePackagesRequest
}
MovePackagesOperation implements moving multiple packages atomically
func (*MovePackagesOperation) Description ¶
func (op *MovePackagesOperation) Description() string
func (*MovePackagesOperation) Execute ¶
func (op *MovePackagesOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*MovePackagesOperation) Type ¶
func (op *MovePackagesOperation) Type() types.OperationType
type MoveSymbolOperation ¶
type MoveSymbolOperation struct {
Request types.MoveSymbolRequest
}
MoveSymbolOperation implements moving symbols between packages
func (*MoveSymbolOperation) Description ¶
func (op *MoveSymbolOperation) Description() string
func (*MoveSymbolOperation) Execute ¶
func (op *MoveSymbolOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*MoveSymbolOperation) Type ¶
func (op *MoveSymbolOperation) Type() types.OperationType
type OrganizeByLayersOperation ¶
type OrganizeByLayersOperation struct {
Request types.OrganizeByLayersRequest
}
OrganizeByLayersOperation implements organizing packages by architectural layers
func (*OrganizeByLayersOperation) Description ¶
func (op *OrganizeByLayersOperation) Description() string
func (*OrganizeByLayersOperation) Execute ¶
func (op *OrganizeByLayersOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*OrganizeByLayersOperation) Type ¶
func (op *OrganizeByLayersOperation) Type() types.OperationType
type PackageMetric ¶
type PlanOperation ¶
type PlanOperation struct {
Request types.PlanOperationRequest
}
PlanOperation implements creating a refactoring plan
func (*PlanOperation) Description ¶
func (op *PlanOperation) Description() string
func (*PlanOperation) Execute ¶
func (op *PlanOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*PlanOperation) Type ¶
func (op *PlanOperation) Type() types.OperationType
type RefactorEngine ¶
type RefactorEngine interface {
// Workspace management
LoadWorkspace(path string) (*types.Workspace, error)
SaveWorkspace(ws *types.Workspace) error
// Refactoring operations
MoveSymbol(ws *types.Workspace, req types.MoveSymbolRequest) (*types.RefactoringPlan, error)
RenameSymbol(ws *types.Workspace, req types.RenameSymbolRequest) (*types.RefactoringPlan, error)
RenamePackage(ws *types.Workspace, req types.RenamePackageRequest) (*types.RefactoringPlan, error)
RenameInterfaceMethod(ws *types.Workspace, req types.RenameInterfaceMethodRequest) (*types.RefactoringPlan, error)
RenameMethod(ws *types.Workspace, req types.RenameMethodRequest) (*types.RefactoringPlan, error)
ExtractMethod(ws *types.Workspace, req types.ExtractMethodRequest) (*types.RefactoringPlan, error)
ExtractFunction(ws *types.Workspace, req types.ExtractFunctionRequest) (*types.RefactoringPlan, error)
ExtractInterface(ws *types.Workspace, req types.ExtractInterfaceRequest) (*types.RefactoringPlan, error)
ExtractVariable(ws *types.Workspace, req types.ExtractVariableRequest) (*types.RefactoringPlan, error)
InlineMethod(ws *types.Workspace, req types.InlineMethodRequest) (*types.RefactoringPlan, error)
InlineVariable(ws *types.Workspace, req types.InlineVariableRequest) (*types.RefactoringPlan, error)
InlineFunction(ws *types.Workspace, req types.InlineFunctionRequest) (*types.RefactoringPlan, error)
BatchRefactor(ws *types.Workspace, ops []types.Operation) (*types.RefactoringPlan, error)
// Bulk operations
MovePackage(ws *types.Workspace, req types.MovePackageRequest) (*types.RefactoringPlan, error)
MoveDir(ws *types.Workspace, req types.MoveDirRequest) (*types.RefactoringPlan, error)
MovePackages(ws *types.Workspace, req types.MovePackagesRequest) (*types.RefactoringPlan, error)
// Facade operations
CreateFacade(ws *types.Workspace, req types.CreateFacadeRequest) (*types.RefactoringPlan, error)
GenerateFacades(ws *types.Workspace, req types.GenerateFacadesRequest) (*types.RefactoringPlan, error)
UpdateFacades(ws *types.Workspace, req types.UpdateFacadesRequest) (*types.RefactoringPlan, error)
// Import alias operations
CleanAliases(ws *types.Workspace, req types.CleanAliasesRequest) (*types.RefactoringPlan, error)
StandardizeImports(ws *types.Workspace, req types.StandardizeImportsRequest) (*types.RefactoringPlan, error)
ResolveAliasConflicts(ws *types.Workspace, req types.ResolveAliasConflictsRequest) (*types.RefactoringPlan, error)
ConvertAliases(ws *types.Workspace, req types.ConvertAliasesRequest) (*types.RefactoringPlan, error)
// Dependency graph operations
MoveByDependencies(ws *types.Workspace, req types.MoveByDependenciesRequest) (*types.RefactoringPlan, error)
OrganizeByLayers(ws *types.Workspace, req types.OrganizeByLayersRequest) (*types.RefactoringPlan, error)
FixCycles(ws *types.Workspace, req types.FixCyclesRequest) (*types.RefactoringPlan, error)
AnalyzeDependencies(ws *types.Workspace, req types.AnalyzeDependenciesRequest) (*types.RefactoringPlan, error)
// Batch operations with rollback
BatchOperations(ws *types.Workspace, req types.BatchOperationRequest) (*types.RefactoringPlan, error)
CreatePlan(ws *types.Workspace, req types.PlanOperationRequest) (*types.RefactoringPlan, error)
ExecutePlanFromFile(req types.ExecuteOperationRequest) (*types.RefactoringPlan, error)
RollbackOperations(req types.RollbackOperationRequest) (*types.RefactoringPlan, error)
// Analysis
AnalyzeImpact(ws *types.Workspace, op types.Operation) (*types.ImpactAnalysis, error)
ValidateRefactoring(plan *types.RefactoringPlan) error
// Execution
ExecutePlan(plan *types.RefactoringPlan) error
PreviewPlan(plan *types.RefactoringPlan) (string, error)
}
Engine is the main interface for refactoring operations
func CreateEngine ¶
func CreateEngine() RefactorEngine
func CreateEngineWithConfig ¶
func CreateEngineWithConfig(config *EngineConfig) RefactorEngine
type RefactoringPlanFile ¶
type RenameInterfaceMethodOperation ¶
type RenameInterfaceMethodOperation struct {
Request types.RenameInterfaceMethodRequest
}
RenameInterfaceMethodOperation implements interface method renaming
func (*RenameInterfaceMethodOperation) Description ¶
func (op *RenameInterfaceMethodOperation) Description() string
func (*RenameInterfaceMethodOperation) Execute ¶
func (op *RenameInterfaceMethodOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*RenameInterfaceMethodOperation) Type ¶
func (op *RenameInterfaceMethodOperation) Type() types.OperationType
type RenameMethodOperation ¶
type RenameMethodOperation struct {
Request types.RenameMethodRequest
}
RenameMethodOperation implements renaming methods on specific types (structs or interfaces)
func (*RenameMethodOperation) Description ¶
func (op *RenameMethodOperation) Description() string
func (*RenameMethodOperation) Execute ¶
func (op *RenameMethodOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*RenameMethodOperation) Type ¶
func (op *RenameMethodOperation) Type() types.OperationType
type RenamePackageOperation ¶
type RenamePackageOperation struct {
Request types.RenamePackageRequest
}
RenamePackageOperation implements package renaming
func (*RenamePackageOperation) Description ¶
func (op *RenamePackageOperation) Description() string
func (*RenamePackageOperation) Execute ¶
func (op *RenamePackageOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*RenamePackageOperation) Type ¶
func (op *RenamePackageOperation) Type() types.OperationType
type RenameSymbolOperation ¶
type RenameSymbolOperation struct {
Request types.RenameSymbolRequest
}
RenameSymbolOperation implements symbol renaming
func (*RenameSymbolOperation) Description ¶
func (op *RenameSymbolOperation) Description() string
func (*RenameSymbolOperation) Execute ¶
func (op *RenameSymbolOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*RenameSymbolOperation) Type ¶
func (op *RenameSymbolOperation) Type() types.OperationType
type ResolveAliasConflictsOperation ¶
type ResolveAliasConflictsOperation struct {
Request types.ResolveAliasConflictsRequest
}
ResolveAliasConflictsOperation implements resolving import alias conflicts
func (*ResolveAliasConflictsOperation) Description ¶
func (op *ResolveAliasConflictsOperation) Description() string
func (*ResolveAliasConflictsOperation) Execute ¶
func (op *ResolveAliasConflictsOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*ResolveAliasConflictsOperation) Type ¶
func (op *ResolveAliasConflictsOperation) Type() types.OperationType
type RollbackOperation ¶
type RollbackOperation struct {
Request types.RollbackOperationRequest
}
RollbackOperation implements rolling back operations
func (*RollbackOperation) Description ¶
func (op *RollbackOperation) Description() string
func (*RollbackOperation) Execute ¶
func (op *RollbackOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*RollbackOperation) Type ¶
func (op *RollbackOperation) Type() types.OperationType
type SafeDeleteOperation ¶
type SafeDeleteOperation struct {
SymbolName string
SourceFile string
Scope pkgtypes.RenameScope // PackageScope or WorkspaceScope
Force bool // If true, delete even if references exist
}
SafeDeleteOperation implements safe deletion of symbols with usage verification
func (*SafeDeleteOperation) Description ¶
func (op *SafeDeleteOperation) Description() string
func (*SafeDeleteOperation) Execute ¶
func (op *SafeDeleteOperation) Execute(ws *pkgtypes.Workspace) (*pkgtypes.RefactoringPlan, error)
func (*SafeDeleteOperation) Type ¶
func (op *SafeDeleteOperation) Type() pkgtypes.OperationType
type Serializer ¶
type Serializer struct {
// contains filtered or unexported fields
}
Serializer applies refactoring changes to files while preserving formatting
func NewSerializer ¶
func NewSerializer() *Serializer
func (*Serializer) ApplyChanges ¶
func (s *Serializer) ApplyChanges(ws *refactorTypes.Workspace, changes []refactorTypes.Change) error
ApplyChanges applies a list of changes to the workspace files
func (*Serializer) BackupFile ¶
func (s *Serializer) BackupFile(filePath string) (string, error)
BackupFile creates a backup of a file before modifications
func (*Serializer) GenerateDiff ¶
func (s *Serializer) GenerateDiff(filePath string, originalContent, modifiedContent string) (string, error)
GenerateDiff generates a unified diff between original and modified content
func (*Serializer) GetFileLines ¶
func (s *Serializer) GetFileLines(filePath string, startLine, endLine int) ([]string, error)
GetFileLines reads a file and returns its lines with line numbers
func (*Serializer) PreviewChanges ¶
func (s *Serializer) PreviewChanges(ws *refactorTypes.Workspace, changes []refactorTypes.Change) (string, error)
PreviewChanges generates a preview of what changes would be applied
func (*Serializer) RestoreFromBackup ¶
func (s *Serializer) RestoreFromBackup(filePath, backupPath string) error
RestoreFromBackup restores a file from its backup
func (*Serializer) ValidateFileStructure ¶
func (s *Serializer) ValidateFileStructure(filePath string) error
ValidateFileStructure ensures that the file structure is valid after changes
type StandardizeImportsOperation ¶
type StandardizeImportsOperation struct {
Request types.StandardizeImportsRequest
}
StandardizeImportsOperation implements standardizing import aliases
func (*StandardizeImportsOperation) Description ¶
func (op *StandardizeImportsOperation) Description() string
func (*StandardizeImportsOperation) Execute ¶
func (op *StandardizeImportsOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*StandardizeImportsOperation) Type ¶
func (op *StandardizeImportsOperation) Type() types.OperationType
type SuggestedMove ¶
type UpdateFacadesOperation ¶
type UpdateFacadesOperation struct {
Request types.UpdateFacadesRequest
}
UpdateFacadesOperation implements updating existing facades
func (*UpdateFacadesOperation) Description ¶
func (op *UpdateFacadesOperation) Description() string
func (*UpdateFacadesOperation) Execute ¶
func (op *UpdateFacadesOperation) Execute(ws *types.Workspace) (*types.RefactoringPlan, error)
func (*UpdateFacadesOperation) Type ¶
func (op *UpdateFacadesOperation) Type() types.OperationType
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator validates refactoring operations for safety
func NewValidator ¶
func NewValidator() *Validator
func (*Validator) ValidateMove ¶
func (v *Validator) ValidateMove(ws *refactorTypes.Workspace, req refactorTypes.MoveSymbolRequest) []refactorTypes.Issue
ValidateMove validates a move operation specifically
func (*Validator) ValidatePlan ¶
func (v *Validator) ValidatePlan(plan *refactorTypes.RefactoringPlan) error
ValidatePlan validates a complete refactoring plan
func (*Validator) ValidatePlanWithConfig ¶
func (v *Validator) ValidatePlanWithConfig(plan *refactorTypes.RefactoringPlan, config *EngineConfig) error
ValidatePlanWithConfig validates a complete refactoring plan with configuration options
func (*Validator) ValidateRename ¶
func (v *Validator) ValidateRename(ws *refactorTypes.Workspace, req refactorTypes.RenameSymbolRequest) []refactorTypes.Issue
ValidateRename validates a rename operation specifically