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 243217

Summary: Create variable declaration from selected code.
Product: javascript Reporter: Christian Lenz <chrizzly>
Component: RefactoringAssignee: Petr Pisl <ppisl>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P2    
Version: 8.0   
Hardware: PC   
OS: Windows 7   
Issue Type: ENHANCEMENT Exception Reporter:

Description Christian Lenz 2014-03-24 14:31:38 UTC
When I want to refactor some code and maybe I see this:

http://pastebin.com/wkWKKYR2

I want to select the phrase: myObject.thisIsAnArray.length and type a hotkey or right click > refactor > create variable.

and this should be look like this: http://pastebin.com/GX2QLvJp

This feature is already implemented in intelliJ and very helpfull.


Regards

Chris
Comment 1 Christian Lenz 2014-09-30 11:42:54 UTC
Here I mean the part which Java already has: Select a text and press alt + enter and you see the hint: introduce Variable..., field..., member... Assign return value to new Variable. Those options are missing for JavaScript.
Comment 2 Petr Pisl 2014-09-30 19:27:30 UTC
I'm going to look at this. Hope there will be more time to implement this soon.
Comment 3 Christian Lenz 2017-06-27 15:34:58 UTC
I will close it, because it will handled now at the JIRA board: https://issues.apache.org/jira/browse/NETBEANS-14. Please feel free to change the state of the ticket.