History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RSRP-33100
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Sergey Shkredov
Reporter: Sebastian Müller
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
ReSharper

Add "virtual" option to extract method dialog.

Created: 07 Dec 06 15:54   Updated: 17 Apr 08 14:59
Component/s: Refactorings - Extract Method
Fix Version/s: Aroha
Security Level: Everybody (All jira users)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Issue Links:
Duplicate
 
This issue is duplicated by:
RSRP-45681 Extract method dialog. Add 'make virt... Normal Closed

Build: 319


 Description  « Hide
The "Extract Method" dialog should offer a "virtual" checkbox which adds the virtual keyword to the method extracted.

95% of the time I extract a method and make it protected, I want it to be virtual. However I always have to add the virtual modifier by hand after the refactoring.
Maybe automatically turn on the virtual checkbox if protected or public access is selected, turn off virtual if private is selected.



 All   Comments   Work Log   Change History      Sort Order:
Adam Vandenberg - 07 Dec 06 15:57
Or possibly even "add empty virtual method to base class [select base class] and extract to overidden method", though perhaps that's getting too specific.

Sebastian Müller - 07 Dec 06 16:02
Or even better offer a "extract factory method"-dialog which slightly differs from the extract method dialog in the following ways:
It suggests a name for the method: namely Create[ReturnTypeName] or Create[NameOfVariableWhichGotAssignedTheReturnValue] and by default use the protected virtual modifiers!

Ilya Ryzhenkov - 14 Oct 07 20:14
Just add "Create virtual method" checkbox, which will switch to "protected" if current setting is "private", and disable "private" choice.

We can also make simple analysis of the body – if extracted body is object creation expression, suggest "factory" names based on return type.