Community
Participate
Working Groups
Build Identifier: Add editor support for the refactorings: 1- extract method 2- create method As a side note, this summer some interns conducted a survey on the lombok mailing list via a large google docs spreadsheet. They crunched the results and have a top 15 refactorings used in eclipse for java development (by lombok users at least: 1) Rename Method 2) Organize Imports 3) Rename Class 4) Rename Field 5) Extract method 6) Rename Local Variable 7) Extract Local Variable 8) Rename Method Arguments 9) Toggle Comment (Ctrl + /) 10) Inline Local Variable 11) Override/Implement Methods 12) Inline Method 13) Extract Constant 14) Handle uncaught exception by adding try/catch 15) Create new method for references to method that can not be resolved This enhancement request is for 5 and 15. I'm surprised 15 is so low. Part of me thinks its because it is worded poorly. Personally, I write code like this constantly: start at a high level of abstraction and type method names that dont exist, then ctrl+1 and have it generate the method stub. This is how I write everything, so I'm really missing #15 right now. Reproducible: Always
Cool, thanks for the list. Seems like we did prioritization right so far :-) It also pretty much looks like the stuff I do most often. What do you mean by "create method"?
Yes agreed! I was really happy to use the rename successfully :-) The create method is this: I'm creating a class like: 1 class ZombieScout { 2 3 def scout() { 4 val zombiesFound = isZombiesHere(); 5 if (zombiesFound) { 6 startShooting(); 7 } 8 } 9} So as I'm typing (at my highest business-ey level of abstraction) and I get to line #4 no method names isZombiesHere exists. In the java editor, I almost without thinking just hit ctrl+1 and it offers me a quick-fix of "create method isZombiesHere()" which I hit enter, and then it invokes the template allowing me to fill in the param types and names and return types or accept the defaults. Same would be true of line #6 as well. Then once I have my high level scout() method, I go flesh out the private helper isZombiesHere() and startShooting() methods. This is a pretty big deal for me because I just do it all the time, but maybe that's not very typical. Its only #15 on the lambok list, but like I said-- I think that's mainly because it is worded poorly. As an FYI: here is the survey its quite comprehensive: http://www.google.com/url?sa=D&q=https://spreadsheets.google.com/spreadsheet/viewform%3Fformkey%3DdGkxQXVxU3ZDMkpJc0ctd3doSDVyTGc6MQ&usg=AFQjCNHETBxPJCtMOnuyYxlOxTY1yQaegA
I see. Could you do me a favor and copy your description to a separate ticket.
Yep- create Bug 364687
First shot commited. Missing parts: - rename of method parameters - methods with type parameters - check parameter order wrt. varargs
Parameters renamable, support for type parameters added. Vararg parameters are handed through as arrays anyway, so I can live without the validation. Pushed to MASTER
Requested via bug 522520. -M.