Skip to main content

Module refactoring

Module refactoring 

Source
Expand description

Unified refactoring engine for comprehensive code transformations. Refactoring and modernization helpers. Unified refactoring engine for Perl code transformations

This module provides a comprehensive refactoring engine that combines workspace-level operations with modern code transformations. It serves as the primary entry point for all refactoring operations in the Perl LSP ecosystem.

§LSP Workflow Integration

The refactoring engine operates within the standard LSP workflow: Parse → Index → Navigate → Complete → Analyze

  • Parse Stage: Analyzes Perl syntax to understand code structure
  • Index Stage: Builds cross-file symbol relationships for safe refactoring
  • Navigate Stage: Updates references and maintains navigation integrity
  • Complete Stage: Ensures completion accuracy after refactoring changes
  • Analyze Stage: Validates refactoring results and provides feedback

§Performance Characteristics

Optimized for enterprise Perl development with large codebases:

  • Memory Efficiency: Streaming approach for large file processing
  • Incremental Updates: Only processes changed portions during refactoring
  • Parallel Operations: Thread-safe refactoring for multi-file changes

§Architecture

The unified engine integrates existing specialized refactoring modules:

  • workspace_refactor: Cross-file operations and symbol management
  • modernize: Code modernization and best practice application
  • import_optimizer: Import statement optimization and cleanup

Structs§

BackupCleanupResult
Result of backup cleanup operation
BackupInfo
Backup information for operation rollback
RefactoringConfig
Configuration for refactoring operations
RefactoringEngine
Unified refactoring engine that coordinates all refactoring operations
RefactoringOperation
Record of a refactoring operation for rollback support
RefactoringResult
Result of a refactoring operation

Enums§

ModernizationPattern
Modernization patterns for legacy code
RefactoringScope
Scope of refactoring operations
RefactoringType
Types of refactoring operations supported by the engine