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
 Intellisense is incorrect when using List<T>
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ngorleer
New Member

5 Posts

Posted - Sep 02 2014 :  08:00:08 AM  Show Profile  Reply with Quote
I am using C++ CLI in VS2010 SP1 with VAX 10.8.2043.0. When I dereference an item from List<T> then the VAX intellisense shows me the members of List<T> instead of the members of T. Here is a screenshot demonstrating the problem.



It shows AddRange, AsReadOnly, ... instead of Name, Value.

feline
Whole Tomato Software

United Kingdom
18721 Posts

Posted - Sep 04 2014 :  6:15:54 PM  Show Profile  Reply with Quote
I think I have a work around, it is working correctly for me. Can you please create a new text file called "va_stdafx.h" file, and place it in the same directory as your SLN or VCXPROJ file. There is no need to add the file to your solution, VA searches for the file and uses it to help the parser understand code, which is explained here:

http://docs.wholetomato.com/default.asp?W302

Edit the file, and add the code:

namespace System::Collections::Generic
{
	template<typename T>
	class List
	{
		T operator->();
		T operator[]();
		T operator*();
	};
};


Make sure the file ends with a blank line. Now press the button:

VA Options -> Performance -> Rebuild symbol databases

and restart the IDE and reload your solution. Does this fix the problem for you?

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

ngorleer
New Member

5 Posts

Posted - Sep 08 2014 :  08:49:43 AM  Show Profile  Reply with Quote
The workaround is working correctly. It also works when I put interface IList<T> instead of class List<T> in the va_stdafx.h file. I think VAX should be intelligent enough to properly support operator[] on System::Collections::Generic::IList<T> and System::Collections::Generic::IDictionary<T> by default without a va_stdafx.h file.

Here is the contents of my va_stdafx.h file:

namespace System::Collections::Generic
{
template<typename T>
interface IList
{
T operator->();
T operator[]();
T operator*();
};

template<typename K, typename V>
interface IDictionary
{
V operator->();
V operator[]();
V operator*();
};
};

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18721 Posts

Posted - Sep 09 2014 :  2:52:14 PM  Show Profile  Reply with Quote
Thank you for the update, and also for the extra changes you have made to your va_stdafx.h file, I have put in a bug report for the problems you are seeing, and that this work around fixes it:

case=64262

In an ideal world our parser will understand everything perfectly, and this is something we are working on. However the compiler has the luxury of running code through a pre-processor, which expands and resolves all macros. That's not something we can really do, especially not on code you are working on. So sometimes the va_stdafx.h file is used to help our parser with complex code that is just hard to resolve without doing a full compile.

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

ngorleer
New Member

5 Posts

Posted - Sep 10 2014 :  02:34:47 AM  Show Profile  Reply with Quote
I think the IList and IDictionary entries should be added to the standard va_stdafx.h of the Visual Assist installation so that in the future it will work by default in any .NET solution.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18721 Posts

Posted - Sep 12 2014 :  8:50:08 PM  Show Profile  Reply with Quote
This is exactly what we are looking to do at some point, and why I have made a note of the edits we have made on case=64262.

If you work in several projects you can made these changes to the global stdafx.h file, which is explained in the "Visual Assist build 1908 and older" section, which still works. Or you can simply copy your va_stdafx.h file to each of your solutions.

zen is the art of being at one with the two'ness
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