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
 Feature Requests
 Supply namespace qualified names, etc.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Mordachai
Tomato Guru

USA
224 Posts

Posted - Aug 16 2016 :  11:14:52 AM  Show Profile  Reply with Quote
Refactor is able to add the needed include file on demand. It can sense when a known symbol isn't in the current scope, and one option is to add the include.

It would also be really useful / time-saving / exactly the sort of function VA excels at if it offered to add the necessary namespace qualifiers as well.

So - it detects a symbol is known, but not in scope.
It could then detect that the scope is known, but in a different name space (vs. not being included at all).
If in another name space, then one of the refactors could be "qualify name".

A common scenario for me might be to have a bunch of char-type dependent "smart" function overloads in namespace Toolbox::SmartChar.

So when I type:

get_length(pszName)

VA's refactor menu could include:
"Add Include"
"Fully Qualify Name"
"Introduce Namespace into local scope"
"Introduce Namespace into file scope"

Fully Qualify name would result in:

Toolbox::SmartChar::get_length(pszName)

Add include - does what it always has (and maybe it's a default pref for whether that also fully qualifies the name for me by default?)

Introduce Namespace... add:

using namespace Toolbox::SmartChar;

for me - at various scopes (local being the most local, file being after include files, but before everything else...

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Aug 20 2016 :  02:01:32 AM  Show Profile  Reply with Quote
This is a good idea, I have added a feature request for a refactoring command to fully qualify a symbol:

case=99537

In this case, I mention that Add Include could automatically invoke this command.

We're also considering adding an add using namespace command:

case=32045

I have added your comments about the idea to add 2 different command for local scope and file scope.
Go to Top of Page