cursive icon indicating copy to clipboard operation
cursive copied to clipboard

Refactor: Extract Function

Open markmandel opened this issue 11 years ago • 35 comments

The ability to highlight an s-expression and extract a new function out from it in the same module, much like you can with Ruby/JS/Java etc.

markmandel avatar Nov 05 '13 07:11 markmandel

+1 from me

fatlazycat avatar Dec 09 '13 10:12 fatlazycat

+1

cprice404 avatar Dec 09 '13 16:12 cprice404

+1

KevinCorcoran avatar Jan 28 '14 18:01 KevinCorcoran

+1

lucascs avatar May 05 '14 15:05 lucascs

yeah, this would be really, really handy! Any chance of this being added soon?

albertlatacz avatar Jun 23 '14 07:06 albertlatacz

Fingers crossed, I'd like this myself!

cursive-ghost avatar Jul 04 '14 17:07 cursive-ghost

+1

tomassommar avatar Sep 22 '14 09:09 tomassommar

+1

fatlazycat avatar Oct 14 '14 20:10 fatlazycat

+1

arnelandwehr avatar Jan 15 '15 14:01 arnelandwehr

I have to +1 the feature too.

DjebbZ avatar Jan 22 '15 10:01 DjebbZ

+1. I tried using "extract variable" option and then move it out manually. However it is error prone when symbols are bound in outer scope.

kurman-zz avatar Feb 26 '15 00:02 kurman-zz

+1

jitlogic avatar Apr 30 '15 17:04 jitlogic

Also, 'inline function' feature would be useful so it can work in both ways. Just as Extract Method and Inline Method in IntelliJ Java refactoring tools.

jitlogic avatar Apr 30 '15 17:04 jitlogic

back to using intellij as main clojure dev env, and ... if any help to test ... drop me a line.

hellonico avatar Sep 15 '15 00:09 hellonico

+1, yes please.

verma avatar Aug 01 '16 16:08 verma

+1, yes please.

marcolisi avatar Aug 18 '16 18:08 marcolisi

  • 1, yes please

dinuksw avatar Sep 02 '16 13:09 dinuksw

+1, please

ruttenberg avatar Nov 03 '16 14:11 ruttenberg

+1, please

smartoma avatar Nov 04 '16 09:11 smartoma

+1

kacyw avatar May 13 '17 20:05 kacyw

+1

aadrian avatar May 13 '17 20:05 aadrian

Sorry to bump this issue again. I would really love this kind of refactoring to be available in Cursive, as well as being able to extract anything to the top level scope of the namespace. I'm a huge "refactorer".

Idea :

  • highlight an s-expression
  • execute the Extract command
  • in the scope selection, have "top-level"
  • select the kind of form : def, defn, defmacro, and ideally every stuff marked as def/defn/defmacro in the Cursive options.
  • extract & profit !

DjebbZ avatar Oct 17 '17 12:10 DjebbZ

Is this feature under consideration at all? It is pretty much essential for heaving an IDE driven refactoring workflow IMHO. Work on this would be greatly appreciated! Cheers!

yilazius avatar Jun 05 '18 20:06 yilazius

+1

deepakazad avatar Jun 05 '18 21:06 deepakazad

+1

myeh98 avatar Aug 02 '18 02:08 myeh98

The feature would be very useful.

IvanVas avatar Jun 01 '20 17:06 IvanVas

This is an essential refactoring functionality, unpleasantly surprised that this has been ignored for years :(
Do people know any workarounds?

Stvad avatar Jul 19 '20 23:07 Stvad

Any reason it's not been picked or prioritized?

khangharoth avatar Jan 08 '21 11:01 khangharoth

Eager for this feature

ericauld avatar Jan 10 '21 15:01 ericauld

This would be amazing :)

beatrizanami avatar Jun 24 '21 18:06 beatrizanami