A Neovim plugin framework for running functions on Tree-sitter nodes to transform code.
TS Node Action is a Neovim plugin framework that allows developers to run functions on Tree-sitter nodes and update the buffer with the result. It solves the problem of performing language-aware code transformations—like cycling case styles, toggling booleans, or converting between multiline and single-line formats—directly within the editor.
Neovim users, particularly developers who work with multiple programming languages and want to enhance their editing workflow with automated, syntax-aware code manipulations.
Developers choose TS Node Action for its extensible framework, support for numerous languages via Tree-sitter, and seamless integration with Neovim's ecosystem, including LSP via null-ls, making complex refactors simple and repeatable.
Neovim Plugin for running functions on nodes.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows users to write custom node actions using a simple function API that returns replacement text, enabling tailored code transformations for specific needs.
Includes built-in actions for multiple languages like JavaScript, TypeScript, Ruby, and Python, with a detailed table showing coverage for common refactorings such as cycling case and toggling booleans.
Integrates with vim-repeat for dot-repeatable actions and null-ls to display node actions alongside LSP code actions, enhancing workflow without leaving the editor.
Supports defining multiple actions per node type with optional vim.ui.select prompts, allowing context-aware choices without cluttering keymaps.
Some built-in actions, like toggle_block or toggle_hash_style, are only available for specific languages like Ruby, limiting utility in mixed-language projects.
Creating custom actions requires familiarity with Tree-sitter node APIs and Lua, which can be daunting for users not versed in Neovim's internals.
Relies on Tree-sitter parsers being correctly installed and configured, and full LSP integration needs null-ls, adding setup overhead and potential for conflicts.