Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 How to configure refactor?

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
Mordachai Posted - Aug 08 2016 : 10:28:00 AM
I love the "introduce variable" feature...
but (sorry)
... I want to set the data types NOT TO BE the LPCTSTR style abominations.

e.g.

_T("foo") -> refactor -> const TCHAR kMyString[] = _T("foo");

NOT

LPCTSTR kMyString = _T("foo");

I can live with

const TCHAR * kMyString = _T("foo");

but the LPCTSTR (and its ilk) rub me the wrong way (generally speaking, pointers should never be hidden inside of a typedef in C++ - that accommodation was for C back in the '90s, and was obsolete by C++ '03.

so... how I can configure how refactoring chooses its data types?
3   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Aug 09 2016 : 8:42:08 PM
Thanks, I have added a comment to the case with your idea of a replacement table.
Mordachai Posted - Aug 09 2016 : 12:00:32 PM
Thanks. Having a few such options would be nice. The other LPxxxx struct-pointers that Windows.h and its ilk use are also verboten in my code (e.g. LPRECT). Just a pointer to the underlying type would be a fine option for the refactoring tool, IMO.

Maybe there's an opportunity for a more generalized substitution table - just a simple "if you're reaching for X, use Y instead" (LPCTSTR -> const TCHAR *, LPRECT -> RECT *, etc.)
Such a "substitution table" could be a simple text file, and would be trivial to maintain, and should be easy to parse into a map for good performance, and would be generic enough to handle more than this one issue I'm presenting.

Anyway, just a thought from an "outside" perspective (I can't see under the hood to know if this is a good or bad suggestion). ;)
accord Posted - Aug 08 2016 : 7:31:45 PM
You cannot configure it right now, but this is a very sensible request so I have put in a feature request:

case=99250

At least changing it to const TCHAR * would be sensible.

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