[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Adding refactoring capabilities to Emacs
From: |
Eshel Yaron |
Subject: |
Re: Adding refactoring capabilities to Emacs |
Date: |
Fri, 08 Sep 2023 15:18:29 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
João Távora <joaotavora@gmail.com> writes:
>> > Also, it would be very good if we could have an early backend which is
>> > *not* LSP. An obvious candidate is Elisp.
>>
>> FWIW, I think `sweeprolog`, my NonGNU ELPA package for SWI-Prolog can
>> also a good non-LSP backend. Elisp would be perfect, no doubt.
>> But `sweeprolog` is interesting because it does a lot of code analysi
> [...]
>> insert a new name, and it renames the variable at once. That's alright
>> for renaming local variables, but it would be great to simply plug in to
>> a generic refactoring UI.
>
> Great. Precise project-wide analysis (as opposed to more-or-less dumb
> grep-based) is exactly the main thing we should be targeting IMO.
> Is "rename" the only thing it does or can you, say, extract subexpressions
> to variables, organize imports, etc?
Yes, there are some other things already in place, like updating imports
and adding exports. I have a work-in-progress implementation for
extracting subexpressions (subterms, in Prolog), but nothing in terms of
existing commands. A relevant feature that's already in place is
creating a definition for an undefined predicate at point. Its relevant
because I had to consider where to put this new definition, which
applies also to extracting subexpressions. Currently there's a user
option that controls where to put new definitions, by default it's right
below the predicate at point (the one that references the new predicate).
Re: Adding refactoring capabilities to Emacs, Dmitry Gutov, 2023/09/07
Re: Adding refactoring capabilities to Emacs, Eshel Yaron, 2023/09/08
- Re: Adding refactoring capabilities to Emacs, João Távora, 2023/09/08
- Re: Adding refactoring capabilities to Emacs,
Eshel Yaron <=
- [semi off topic] grep-based refactoring [was: Adding refactoring capabilities to Emacs], tomas, 2023/09/08
- Re: [semi off topic] grep-based refactoring [was: Adding refactoring capabilities to Emacs], João Távora, 2023/09/08
- Re: [semi off topic] grep-based refactoring [was: Adding refactoring capabilities to Emacs], Dmitry Gutov, 2023/09/08
- Re: [semi off topic] grep-based refactoring [was: Adding refactoring capabilities to Emacs], tomas, 2023/09/08