zlacker

[parent] [thread] 2 comments
1. virapt+(OP)[view] [source] 2025-07-28 10:19:38
I don't think you understand what I mean with the language aware rename. It's not even close to %s. Let's say I've got a c# app and I rename a class in VS. This will rename the class in the file, all class usages (but not as text - if I rename A.B, then it will not touch X.B due to different namespaces), including other projects in the solution, optionally will rename the file it lives in and optionally will/won't replace the text in comments. All listed for review and approval and I don't have to have any of those files open ahead of time.
replies(1): >>63stac+E6
2. 63stac+E6[view] [source] 2025-07-28 11:17:08
>>virapt+(OP)
This is something that the LSP provides (even in VScode), and is available in nvim yes. The command is vim.lsp.buf.rename(), and it is bound to "grn" by default.

https://neovim.io/doc/user/lsp.html#vim.lsp.buf.rename() (HN seems to not link the () part, you have to add it yourself)

All the other similar fanciness like renaming a file and automatically updating module references is also provided by the LSP, and is also available in nvim.

replies(1): >>virapt+yb
◧◩
3. virapt+yb[view] [source] [discussion] 2025-07-28 11:58:18
>>63stac+E6
That's cool. This was not easily accessible last time I used plain nvim. I'm glad the functionality has made its way there.
[go to top]