This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 233581 - [Javascript] Please add 'Introduce Method' refactoring
Summary: [Javascript] Please add 'Introduce Method' refactoring
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal with 3 votes (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-29 10:31 UTC by tomzi
Modified: 2015-02-28 11:19 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tomzi 2013-07-29 10:31:21 UTC
If you are used to refactorings in Java, then you really don't want to miss it in Javascript as well :)


Product Version = NetBeans IDE 7.4 Beta (Build 201307092200)
Operating System = Linux version 3.8.0-26-generic running on amd64
Java; VM; Vendor = 1.7.0_25
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.25-b01
Comment 1 elennaro 2015-02-28 11:19:30 UTC
We can split/divide this task to steps.


At first it'd be great to have move to a function method which (exactely like in java) will allow you to:
1) mark piece of code
2) choose Refactoring -> move to a funtion
3) In menu appeared we must be able to:
 3.a) choose in which scope to put this newly created function, eg global or current function's one 
 3.b) choose what type of function do we want to create: anonymous (e.g. var myCreatedFunction = function (p1, p2){etc}) or plain (function myCreatedFuction(p1, p2))
 3.c) Choose the name of the function
 3.d) Choose (like in java) for other appearance of code


Next steps for more great JS refactoring can be considered based on Learning JavaScript Design Patterns book (http://addyosmani.com/resources/essentialjsdesignpatterns/book/)