filipdutescu / renamer.nvim

VS Code-like renaming UI for Neovim, writen in Lua.
Apache License 2.0
298 stars 11 forks source link

[Bug] Rename prompt will be displayed even if no LSP is attached #96

Closed EtiamNullam closed 2 years ago

EtiamNullam commented 2 years ago

Describe the bug

Attempting to rename text with no LSP attached will fail silently after displaying prompt for new name.

To reproduce

Steps to reproduce the behavior:

  1. Open file with no LSP attached.
  2. Run lua require('renamer').rename() on any word.
  3. Notice that nothing happens just like operation would be successful.

Expected behavior

A discreet message should be displayed and no input box should be opened if there is nothing to rename.

Environment

Screenshots

image

Additional context

When LSP is attached the prompt will be shown also for invalid elements, but at least there is a warning displayed afterward.

filipdutescu commented 2 years ago

Thanks for reporting the bug! However, I am not sure how/if I can check if an LSP client is active for the current buffer. Will need to look into it.