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

Identifier renaming also for Emacs? #1738

Open
dunric opened this issue Mar 2, 2024 · 4 comments
Open

Identifier renaming also for Emacs? #1738

dunric opened this issue Mar 2, 2024 · 4 comments

Comments

@dunric
Copy link

dunric commented Mar 2, 2024

Vim's plugin offers a command to rename an identifier under a cursor (or passed as an argument), however I can't find a similar feature for Emacs.
There is support for finding/highlight of identifier's occurrences but no for renaming?

edit: Reference to current Vim's implementation:
merlin_find#IncrementalRename()

@voodoos
Copy link
Collaborator

voodoos commented Mar 4, 2024

I would expect there to be a standard way to rename occurrences from the occur-mode but maybe I am wrong ?
@xvw do you use the standard merlin-mode for Emacs ? Do you know if such a feature exists ?

Anyway if it doesn't exists natively we would welcome a PR adding support for renaming :-)

@xvw
Copy link
Collaborator

xvw commented Mar 4, 2024

From my knowledge of occur, you can only use regular expressions to match specific lines and I must confess I don't know how to use them at all (and I don't think it's possible to rename).

In general, when I want to rename an identifier, I use xref-find-references-and-replace which uses merlin-occurences to find the occurrences of the term to be replaced.

@dunric
Copy link
Author

dunric commented Mar 7, 2024

@xvw It seems xref-find-references-and-replace can mitigate the issue. Strange it didn't worked until merlin-eldoc package was installed.

@xvw
Copy link
Collaborator

xvw commented Mar 7, 2024

Indeed, I use Doom-emacs with the OCaml layout that includes merlin-eldoc. Interesting that it only works if eldoc is installed. I'll investigate.

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

No branches or pull requests

3 participants