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
 Disable automaticaly added not required namespace
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Jorgos
New Member

2 Posts

Posted - Dec 21 2016 :  06:47:28 AM  Show Profile  Reply with Quote
Hello,
I'm developing in Cpp, and i have following issue. Let say i have following code (It is only a snippet so I don't expect it to compile :) ):

file.h
namespace A{
class B{
B();
}
}
and in file.cpp i have "using namespace A" clause. Now i want to use Create Implementation option. There will be created following method:

file.cpp
using namespace A;
A::B::B()
{}

Adding namespace A:: in this case is not required, and makes code less readable, especially when namespace name is not very short. Is there any option to disable this unnecessary namespace?


ChrisG
Whole Tomato Software

USA
299 Posts

Posted - Dec 22 2016 :  07:18:19 AM  Show Profile  Reply with Quote
Hello Jorgos,

Thank you for your feedback. It looks like we have already started tracking this issue. I have added your voice to the case, 20637.
Go to Top of Page

pjwhams
Senior Member

25 Posts

Posted - May 18 2017 :  4:43:39 PM  Show Profile  Reply with Quote
I also have this problem on a daily basis. The problem gets worse when you have something that uses several types from the same namespace. Every time I do 'create implementation' I have to do lots of manual deletion:


// file.h
namespace Company {
namespace Product {
struct ValueType {};

template <T>
class TClass {};

class MyClass
{
public:
	TClass<ValueType>  getValue(); // nice and short...
};
}} // end namespace


// file.cpp - create implementation
namespace Company {
namespace Product {
// woah.
Company::Product::TClass<Company::Product::ValueType> MyClass::getValue()
{

}

}}

Edited by - pjwhams on May 18 2017 4:45:16 PM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18748 Posts

Posted - May 18 2017 :  5:53:41 PM  Show Profile  Reply with Quote
Sorry about this, it is still on our list of things to fix. If you are having a lot of problems like this, you might find it easier to start typing out the class name and member name for the implementation manually. VA should help you insert the correct class name and member name quickly and easily. Also, if the function takes parameters, VA will give you a tooltip offering to insert these when you are typing the implementation.

Not the same, but hopefully something that will help a bit.

zen is the art of being at one with the two'ness
Go to Top of Page

pjwhams
Senior Member

25 Posts

Posted - May 18 2017 :  6:30:59 PM  Show Profile  Reply with Quote
Thanks for the fast response. Fortunately I use VsVim and judicious use of '4dw' is enough to quickly remove the extraneous namespace.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18748 Posts

Posted - May 19 2017 :  06:42:29 AM  Show Profile  Reply with Quote
That also works Personally I was never able to think both Vim and IDE at the same time, but I do sometimes miss the power and control of Vim.

zen is the art of being at one with the two'ness
Go to Top of Page

pjwhams
Senior Member

25 Posts

Posted - May 19 2017 :  07:16:41 AM  Show Profile  Reply with Quote
If I didn't have VisualAssist and VsVim then my productivity would plummet!
Go to Top of Page

ChrisG
Whole Tomato Software

USA
299 Posts

Posted - Jun 18 2020 :  01:35:16 AM  Show Profile  Reply with Quote
case=20637 is fixed in build 2380.
https://support.wholetomato.com/default.asp?W404#2380
Go to Top of Page

pjwhams
Senior Member

25 Posts

Posted - Jun 18 2020 :  03:26:45 AM  Show Profile  Reply with Quote
quote:
Originally posted by ChrisG

case=20637 is fixed in build 2380.
https://support.wholetomato.com/default.asp?W404#2380



Excellent, thank you!
Go to Top of Page

Jorgos
New Member

2 Posts

Posted - Jun 18 2020 :  03:36:36 AM  Show Profile  Reply with Quote
quote:
Originally posted by ChrisG

case=20637 is fixed in build 2380.
https://support.wholetomato.com/default.asp?W404#2380



Thank you as well for the fix :)
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