Skip to content

docs: update refactoring.nvim capabilities #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TheLeoP
Copy link

@TheLeoP TheLeoP commented Jun 25, 2025

I'm the current maintainer of refactoring.nvim, so I updated the README to better reflect its current capabilities.

@@ -240,25 +240,25 @@ should be used.
| ------------------------------------------------------------------------ | ------------------------------ | ----------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------- | -------------------------------------------------------------------- | --------------------------------------------------- | ----------------------------------------------------- |
| Include line numbers in log lines | :+1: | :+1: (via user config) | :+1: (via user config) | :+1: | :+1: | :x: | :+1: |
| Include other location information in log lines | :+1: | :x: | :+1: (via user config) | :+1: | :+1: | :x: | :+1: |
| Persistent location counter between NeoVim sessions | :+1: | :x: | :x: | :x: | :x: | :x: | :x: |
| Persistent location counter between NeoVim sessions | :+1: | :x: | :x: | :x: | :+1: (depends on buffer state, not tracked internally in Lua) | :x: | :x: |
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. What does this mean? As best as I can tell from the documentation, refactoring.nvim doesn't support a location counter at all (I mean a monotonically increasing counter to help distinguish lines). I can't actually get refactoring.nvim to work for me right now (I'm seeing refactoring.nvim/lua/refactoring/debug/printf.lua:65: assertion failed! whatever I do) so I can't see it working in practice...

Copy link
Author

@TheLeoP TheLeoP Jun 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/ThePrimeagen/refactoring.nvim/blob/master/lua/refactoring/tests/debug/printf/lua/count/printf.expected.lua

is an example of this working. Instead of keeping track inside of the lua code of what parts of the buffer have debug print statements, it counts all of them each time a new one is inserted in the buffer and modifies them accordingly. This is only implemented for printf not print_var

Copy link
Owner

@andrewferrier andrewferrier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I've left just a few comments here to make sure we're talking about similar / equivalent capability (quite possible I should make some of my descriptions more self-explanatory too).

@@ -267,14 +267,14 @@ should be used.
| Extra visual emphasis of log statements | :+1: Highlights inserted lines | :+1: Flashes to highlight lines on insertion | :+1: status line counter, signcolumn, line-highlight, scrollbar | :x: | :x: | :x: | :x: |
| Can insert logs in batches | :+1: (using registers) | :+1: | :x: | :x: | :x: | :x: | :x: |
| Log watcher mechanism | :x: | :+1: | :x: | :x: | :x: | :x: | :x: |
| Dynamic filetype configuration/log templates | :+1: | :x: | :x: | :x: | :x: | :x: | :x: |
| Completely customizable log templates | :x: | :+1: | :+1: | :+1: | :x: | :x: | :x: |
| Dynamic filetype configuration/log templates | :+1: | :x: | :x: | :x: | :+1: | :x: | :x: |
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. How does one configure the dynamic filetype configuration? In the README I only see an example of statically configuring it at setup() time.

Copy link
Author

@TheLeoP TheLeoP Jun 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setup function simply modifies values in a Lua table. So, modifying it multiple times (i.e. in a filetype plugin) is supported. Or did you meant using functions as configuration values? If it's the later, I can also remove this capability. It may have been a misunderstanding on my side

@TheLeoP TheLeoP force-pushed the update-refactoring.nvim branch from 42fca8e to 4a2822d Compare June 25, 2025 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants