Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 VA is confusing definitions with the same name!

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
MrDoomMaster Posted - Oct 27 2006 : 3:21:39 PM
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.
6   L A T E S T    R E P L I E S    (Newest First)
MrDoomMaster Posted - Oct 31 2006 : 11:44:03 AM
lol I just made a stupid mistake above:

list* vec = new vector;

this should be:

list* newList = new list;

Anyway, you get the point :)
feline Posted - Oct 31 2006 : 11:21:18 AM
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.
MrDoomMaster Posted - Oct 30 2006 : 7:16:36 PM
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.
feline Posted - Oct 30 2006 : 2:00:59 PM
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
MrDoomMaster Posted - Oct 29 2006 : 10:43:55 PM
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 :)
feline Posted - Oct 28 2006 : 12:34:22 PM
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.

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