Bug 467425 - [quickfix] Quick fix to create undefined function
Summary: [quickfix] Quick fix to create undefined function
Status: REOPENED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: JS Tools (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2015-05-15 13:34 EDT by John Arthorne CLA
Modified: 2017-02-14 17:48 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2015-05-15 13:34:18 EDT
It would be useful to have a quick fix that will add a function declaration for an undefined function. So I could type this:

var y = divide(divisor/dividend);

And a quick fix could then declare the function:

function divide(divisor, dividend) {
}

This is like the "Create method" quick fix in JDT.

It may be hard to guess the right scope to insert the function in, but inserting into the parent scope of the caller would be a reasonable starting point, and the user could move it around from there.
Comment 1 Michael Rennie CLA 2017-01-10 15:46:02 EST
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:

https://dev.eclipse.org/mhonarc/lists/orion-dev/msg04002.html
Comment 2 Michael Rennie CLA 2017-02-14 17:11:27 EST
Reopening, this is still a good idea.

We should also provide a fix for variables to create a local var in the enclosing scope.