'Refactor - Extract Method' support in constructor class body
I'd like to be able to extract methods in the class body (implicitly part of the primary constructor body).
While this feature is supported, it doesn't remove the selected lines of code - resulting in an party done refactoring.
While this feature is supported, it doesn't remove the selected lines of code - resulting in an party done refactoring.
class ExtractMethodTest(nums: Int*){
var sum = 0
for (num <- nums)
sum += num
println(sum)
}
object ExtractMethodTest extends App{
new ExtractMethodTest()
new ExtractMethodTest(5)
new ExtractMethodTest(1, 1, 2, 3, 5)
}
Leave a comment
@Mirko
Do you want this assigned to you directly?
Do you want this assigned to you directly?
on 2011-08-30 06:00 *
By Mirko Stocker
I agree, that would be a nice enhancement. What makes it slightly more complicated than an ordinary extract method is that we mustn't extract definitions that are used from anywhere else in the program. But in principle, this shouldn't be too hard.
on 2015-03-12 12:24 *
By Simon Schäfer
Eclipse version changed from Helios to Luna - Eclipse 4.4
Version changed from 2.0.0-beta09-29 to 4.0.0
Assigned to changed from Mirko Stocker to -none-
Description changed from Not sure if should be a bug... to I'd like to be able to extr...
Status changed from New to Accepted