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
 VA is confusing definitions with the same name!
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

MrDoomMaster
Tomato Guru

251 Posts

Posted - Oct 27 2006 :  3:21:39 PM  Show Profile  Reply with Quote
As you know, std::list has a member called 'iterator'. I also have a list class with an 'iterator' class:

XUTIL::xList::iterator iter;


When I create an iterator from my own list class, visual assist lists members for std::list::iterator instead of the ones in my own iterator! It's obviously getting the definitions confused just because they have the same name. Why doesn't VA check namespaces and class names? Can't it be a little smarter about it? Obviously if VA looked at which class 'iterator' is declared in, or what namespace its in, it would see that they are completely different objects.

Is there a work-around for this? Has this problem already been reported? If the problem is known, is there an expected date for the fix? I really hate having to give all of my classes "unique" names just to get the intellisence working correctly.

feline
Whole Tomato Software

United Kingdom
18950 Posts

Posted - Oct 28 2006 :  12:34:22 PM  Show Profile  Reply with Quote
That is rather unexpected. Normally VA is fairly good at working out what is going on, and looking at the correct class / namespace.

case=3298

For me turning on the two options:
VA Options -> Text Editor -> listboxes -> bold non-inherited members
VA Options -> Text Editor -> listboxes -> list non-inherited entries first

separates out the local functions and places them at the top of the completion listbox. Alternatively turning on:

VA Options -> Text Editor -> listboxes -> get content from default intellisense

fixes the problem completely, but may have some side effects. Some of the time the IDE's intellisense is more helpful, and other times VAX is more helpful.

zen is the art of being at one with the two'ness

Edited by - feline on Oct 28 2006 12:37:12 PM
Go to Top of Page

MrDoomMaster
Tomato Guru

251 Posts

Posted - Oct 29 2006 :  10:43:55 PM  Show Profile  Reply with Quote
Thanks for your reply.

Concerning your first suggestion: I already had them enabled.

The second suggestion: I totally understand the side-effects you're talking about. I notice random things wrong when I enable default intellisense. However, enabling that now is not an option. A few guys I work with have found out that the intellisense in Visual Studio 8 has serious issues. Deleting the DLL responsible for supporting intellisense parsing in VS8 provides a VERY significant performance boost. Projects load instantly. The IDE itself loads instantly. No random crashes. Overall, it's just a great improvement.

Anyway, thanks for the two suggestions. I see that you have listed a case number. Apparently that means this is an issue? Hopefully it's fixed soon! Thanks :)
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18950 Posts

Posted - Oct 30 2006 :  2:00:59 PM  Show Profile  Reply with Quote
There is another approach to stopping VS2005's Intellisense:

http://docs.wholetomato.com?W133

I have often done this myself The case number does indeed mean that this is in our list of things to fix:

http://docs.wholetomato.com?W318

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

MrDoomMaster
Tomato Guru

251 Posts

Posted - Oct 30 2006 :  7:16:36 PM  Show Profile  Reply with Quote
File 1 - [list.h]
---------------------------------
namespace blah
{
	// Obviously this is a commonly used name, especially
	// in STL. Note that it is in a different namespace.
	class list
	{
	public:
		void DoSomethingStupid( void )
		{
		}
	};
}


File 2 - [OtherCrap.h]
---------------------------------
namespace blah
{
	class OtherCrap
	{
	public:
		void DoAnotherStupidThing( void )
		{
			list* vec = new vector;
			vec->DoSomethingStupid();
		}
	};
}


Above I have provided a better example of what causes the namespace confusion. I have bolded the lines of code above that are the source of the problem.

When I have two classes in the same namespace, but in different files, accessing one class from the other causes the incorrect members to be listed.

In the example above, I'm creating my own 'vector' class from within the class named 'OtherCrap'. Note that I don't explicitly use "blah::vector" in my vector declaration, since I'm already inside of the namespace 'blah'. When I type vec->, this causes the STL member listing to appear. If I add the explicit blah:: to the front of my vector declaration, THEN and ONLY THEN do I get the correct member listing.

Of course the classes I'm working with have very common names and confuses Visual Assist, even though I'm using namespaces but not explicitly typing the scope resolution operator since I'm already inside of the namespace declaration scope.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18950 Posts

Posted - Oct 31 2006 :  11:21:18 AM  Show Profile  Reply with Quote
I have updated the case with this example. Interestingly this looks very similar to an existing bug with duplicate class names in different namespaces (case 734), more so that the original example.

They probably both stem from the same underlying problem.

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

MrDoomMaster
Tomato Guru

251 Posts

Posted - Oct 31 2006 :  11:44:03 AM  Show Profile  Reply with Quote
lol I just made a stupid mistake above:

list* vec = new vector;

this should be:

list* newList = new list;

Anyway, you get the point :)
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