Skip to content
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

[Feature] Option to prompt renaming through nvim's prompt instead of UI #68

Closed
sdushantha opened this issue Nov 9, 2021 · 5 comments · Fixed by #74
Closed

[Feature] Option to prompt renaming through nvim's prompt instead of UI #68

sdushantha opened this issue Nov 9, 2021 · 5 comments · Fixed by #74
Assignees
Labels
feature New feature or request good first issue Good for newcomers
Milestone

Comments

@sdushantha
Copy link

Describe the issue

Great project, I've been looking this type of plugin for a long time!

I personally would like it if there was a option to prompt the rename through the command input (not sure what its called) instead of a popup. It's just a personal thing, as I'm not a huge fan of having the popup.

Proposal

It would be nice to have something like in the screenshot below
image

@sdushantha sdushantha added the feature New feature or request label Nov 9, 2021
@filipdutescu filipdutescu self-assigned this Nov 9, 2021
@filipdutescu
Copy link
Owner

Thanks for submitting feedback and for the proposal! I assume you already used vim.lsp.buf.rename() (since it kind does what you want), but would like to also have reference highlighting/the word to be renamed displayed.

Is this right? I am trying to get a better idea as to how this feature should be designed.

@filipdutescu filipdutescu added the good first issue Good for newcomers label Nov 9, 2021
@filipdutescu filipdutescu added this to the v1.1.0 milestone Nov 9, 2021
@sdushantha
Copy link
Author

sdushantha commented Nov 9, 2021

I assume you already used vim.lsp.buf.rename() (since it kind does what you want), but would like to also have reference highlighting/the word to be renamed displayed.

No I did not try vim.lsp.buf.rename() because I don't think I saw in the README. But after trying it out, I can confirm that what you have mentioned is the same feature I am requesting :)

filipdutescu added a commit that referenced this issue Nov 11, 2021
Add the `with_popup` parameter to determine whether or not to use the
popup to enter the new name. If popup is disabled, use `vim.fn.input`
to receive the new name.

BREAKING CHANGE: Fallback when popup is disabled/not able to be drawn
changed from `vim.lsp.buf.rename()` to using `vim.fn.input()` to ask the
user for input. This is required for:

- setting the quickfix list with the resulting changes
- preserving non-GUI input alternative, since Neovim 0.5.2+ will have
  its own interface for `vim.lsp.buf.rename()`

Closes: GH-68
Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
@filipdutescu
Copy link
Owner

Just added your proposed feature to the develop branch (4ef89d5). Feel free to try it out or wait until I publish v2.0.0, around Sunday (or when I finish the remaining 2 issues). Thanks for your patience!

filipdutescu added a commit that referenced this issue Nov 11, 2021
Add the screenshot provided by @sdushantha in GH-68 to `media/` and to
the `README.md`.

Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
@sdushantha
Copy link
Author

Thank you! I really appreciate you taking the time to implement this feature!!

@filipdutescu
Copy link
Owner

With pleasure! Thanks for suggesting it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants