$ show rachartier/tiny-code-action.nvim
This Neovim plugin provides a polished interface for invoking LSP code actions (refactorings, quickfixes, etc.) with real-time diff previews. It supports multiple picker frameworks (telescope, fzf-lua, snacks, vim.ui.select, and a custom buffer picker) and diff backends (vim, delta, difftastic, diff-so-fancy). The architecture is modular: a finder module collects actions from all LSP clients, filters and sorts them, then passes them to a configurable picker. The plugin handles action resolution (LSP resolveProvider), preview generation, and application of workspace edits. It is well-structured with base classes for pickers, previewers, and diff backends, making it easy to extend. The buffer picker is particularly sophisticated, offering hotkeys, category grouping, nested group support, and auto-preview.
The LLM identified 2 files worth highlighting for reuse:
A self-contained module for applying LSP-style text edits to an in-memory list of lines. It handles range normalization, edit ordering (reverse to avoid offset issues), empty/non-empty edits, and snippet syntax stripping. This module has no dependencies on the rest of the plugin and can be extracted for any project needing to simulate LSP workspace edits.
A base class for diff backends (delta, difftastic, diff-so-fancy) that encapsulates temporary file creation, cleanup, and header line removal. It provides a clean OOP interface (`prepare_files`, `cleanup_files`, `process_diff`) that can be reused for integrating any external diff tool with Neovim. The pattern is easily extensible.