refactoring.nvim is a Neovim plugin that provides automated refactoring operations powered by tree-sitter and LSP.
The plugin addresses the challenge of performing safe, large-scale code transformations in an editor by automating refactoring patterns from Martin Fowler's Refactoring book. It works by combining tree-sitter parsing for syntax-aware code analysis with LSP capabilities for semantic understanding. The tool offers operators that integrate with Neovim's motion and textobject system, supporting dot-repeat for efficient repeated application. Operations include inlining variables and functions, extracting variables and functions, and inserting debug print statements at specific locations with context information.
The plugin suits developers working in Neovim who want to perform refactorings without manual code manipulation. It works best for languages with available tree-sitter parsers and corresponding query definitions, which the project bundles for supported languages. Projects benefit most when they have an LSP server available that supports references and definition lookups, though some operations like extract variable rely only on tree-sitter. The tool provides fine-grained customization through global setup, per-call options, and buffer-local configuration, allowing teams to adapt behavior to their coding standards.
Development shows consistent activity with regular commits addressing bug fixes and feature improvements. The project maintains responsiveness to user-reported issues and pull requests. Updates reflect attention to both expanding language support and refining the reliability of existing operations.