A Neovim plugin for smart, customizable insertion of various log statements using Treesitter for intelligent variable detection and placement.
nvim-chainsaw is a Neovim plugin that provides smart and highly customizable insertion of various log statements for debugging. It uses Treesitter to intelligently detect variables and determine correct insertion locations, supporting multiple log types like variable logging, assertions, time measurements, and stack traces across many programming languages.
Neovim users, particularly developers who frequently debug code across languages like JavaScript, Python, Lua, and Rust, and want a unified, efficient logging workflow within their editor.
Developers choose nvim-chainsaw for its Treesitter-powered smart detection and placement, extensive language support, and rich customization options, offering a more integrated and error-resistant debugging experience compared to basic logging plugins.
Smart and highly customizable insertion of various kinds of log statements.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses Treesitter to automatically select the correct field of an object under the cursor, as shown in examples for JavaScript and Lua, reducing manual errors in complex code.
Adjusts log statement placement based on language syntax to prevent invalid code, such as inserting after multi-line assignments or before return statements, supported in languages like Python and Lua.
Supports over a dozen log types including assertions, stack traces, sound alerts, and emoji logs, catering to various debugging needs like control flow inspection and audible feedback.
Offers an opt-in pre-commit hook that automatically prevents committing files containing the marker string, enhancing code hygiene without manual intervention.
Smart features like variable detection and insertion location require Treesitter parsers for each language, adding setup overhead and potential incompatibility if not configured.
Customizing log statements involves Lua templates with placeholders and multiline setups, which can be daunting for users unfamiliar with Neovim configuration or scripting.
Log statements can be broken by formatters like Prettier, necessitating additional configuration with ignore comments, as admitted in the README's 'Make the formatter ignore' section.