Bug 411586 - Add a "Create method" Quick fix.
Summary: Add a "Create method" Quick fix.
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-refactoring (show other bugs)
Version: 8.1.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-25 07:05 EDT by E J CLA
Modified: 2020-09-04 15:24 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description E J CLA 2013-06-25 07:05:49 EDT
Overview: A Quick Fix to fix the "Method could not be resolved"-problem by adding the method to the class.

Steps to reproduce:
1. Write a method call via object or pointer, for example "x.method()" where x is of type X, and X is a C++ class or struct.

2. "method" is underlined in red, place the marker there and press Ctrl-1.

Actual result:
The proposals "Rename in file" and "Rename in workspace" are displayed.

Result after enhancement:
"Create this method." is also displayed. If the user selects this option
a refactoring wizard with preview option starts. On perform finish the method is added to class X. The return type, number of parameters and parameter types of the new method are infered from the method call. The user can supply the parameter names.

(I have implemented a solution for this as a plug-in but would also like to have it included in CDT)
Comment 1 Sergey Prigogin CLA 2013-06-25 13:08:16 EDT
(In reply to comment #0)

Very nice. Please put the patch implementing this feature in CDT to Gerrit (http://wiki.eclipse.org/CDT/git#Using_Gerrit_for_CDT).
Comment 2 E J CLA 2013-07-03 05:04:23 EDT
Must I sign the contributor license agreement? I have a copied a couple of functions from Another eclipse Project and added comments stating this in the code... but the CLA states 100% of the content must be authored by me?
Comment 3 E J CLA 2013-07-03 05:21:25 EDT
While waiting for response i will actually go ahead and sign it and try to upload again. If there is problem with this i guess it will be solved in 
the Review process.
Comment 4 E J CLA 2013-07-03 07:11:58 EDT
New Changes:
https://git.eclipse.org/r/14214