Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 How to configure refactor?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Mordachai
Tomato Guru

USA
224 Posts

Posted - Aug 08 2016 :  10:28:00 AM  Show Profile  Reply with Quote
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?

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Aug 08 2016 :  7:31:45 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

Mordachai
Tomato Guru

USA
224 Posts

Posted - Aug 09 2016 :  12:00:32 PM  Show Profile  Reply with Quote
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). ;)
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Aug 09 2016 :  8:42:08 PM  Show Profile  Reply with Quote
Thanks, I have added a comment to the case with your idea of a replacement table.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000