Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Add "introduce method" refactoring #303

Closed
roben opened this issue Sep 21, 2017 · 4 comments
Closed

Suggestion: Add "introduce method" refactoring #303

roben opened this issue Sep 21, 2017 · 4 comments

Comments

@roben
Copy link

roben commented Sep 21, 2017

It would be great to eventually implement all the great refactoring tools Netbeans provides. One of the more important features is the "introduce method" refactoring: http://wiki.netbeans.org/Refactoring#Replace_block_of_code_with_a_method

@roben
Copy link
Author

roben commented Sep 21, 2017

VS Code just added this for typescript, which maybe provides some reusability: https://code.visualstudio.com/updates/v1_16#_javascript-and-typescript-refactorings

@yaohaizh
Copy link
Collaborator

@fbricon This is exactly I planned to do after the code action after exception. Would like to implement this.

@fbricon
Copy link
Collaborator

fbricon commented Oct 12, 2017

eclipse-jdtls/eclipse.jdt.ls#381 looking promising :
extract-method

@fbricon fbricon added this to the Mid October 2017 milestone Oct 16, 2017
@fbricon
Copy link
Collaborator

fbricon commented Oct 16, 2017

The feature has been added in 0.12.0, but we still need to improve it by chaining the refactoring with a rename action on the new method name. Currently, you have to manually trigger the rename action (eg. using F2 to rename the method).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants