Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Refactor: Extract expression / extract constant

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
peterchen Posted - Jul 17 2008 : 1:03:58 PM
A feature that I am missing regulary is this to extract an selected subexpression as a variable.

In the code

key = CxGetProfileString(file, _T("Section"), _T("key"));


I select the _T("Section"), and select "extract expression" from the refactoring context menu.

I am asked for name and type of the variable. If I enter "section", the code gets changed to this:

LPCTSTR section = _T("Section");
key = CxGetProfileString(file, section, _T("key"));


Suggestion: keep type and name in one long edit field, rather than requiring two

Bonus: Make a good suggestion for the type
Bonus: optionally allow replacing the expression in the current function/file/project. (IMO project is dangerous, but people will want it).
Bonus: move the extracted assignment to a suitable location depending on the "replace" option

Caret position after input would probably be the beginning of the newly inserted line, since the most likely action is moving the declaration somewhere. Alt-Back takes me back to the start of the replaced expression.

This would be very Very VERY helpful even without the replace.



3   L A T E S T    R E P L I E S    (Newest First)
sean Posted - Nov 07 2014 : 10:08:01 AM
case=1492 is implemented in build 2052
peterchen Posted - Jul 29 2008 : 05:06:10 AM
feline Posted - Jul 17 2008 : 2:17:38 PM
We are considering adding a refactoring command to extract a piece of code and turn it into a variable:

case=1492

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000