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
 Strange context determination in nav toolbar 1819
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jrynd
New Member

USA
8 Posts

Posted - Apr 19 2010 :  11:07:01 AM  Show Profile  Reply with Quote
I'm in Visual C++ 6.0 (yeah yeah, I know) and using VAx 10.6.1819.0

Obviously there is no Java or .NET here. Yet my sample code:

typedef struct _FP
  {
  unsigned short int rows;
  unsigned short int cols;
  double array[FP_arraysize];
  } FP;


void f(void)
{
FP retval;
#define notevalue retval.array[0]
#define notedelta retval.array[1]
#define notevega retval.array[2]
#define notedv01 retval.array[3]
#define optvalue retval.array[4]
#define optdelta retval.array[5]
#define optvega retval.array[6]
#define optdv01 retval.array[7]
notevalue=0;
}


when I click on one of these variable names, the navigator toolbar suggests "class Array : public System::Array{...}" as the context instead of showing the #define or the declaration of retval.

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Apr 19 2010 :  2:31:07 PM  Show Profile  Reply with Quote
This is because there is a helper code for the class "array" for C++/CLI codes in VA's stdafx.h. If you comment out the following lines in this file, it will solve this problem for you:

// namespace cli
// {
// 	template<typename T>
// 		class array : public System::Array
// 	{
// 		T operator[]();
// 	};
// 	
// 	template<typename T>
// 		class interior_ptr
// 	{
// 		T* operator*();
// 	};
// 	
// 	template<typename T>
// 		class pin_ptr
// 	{
// 		T* operator*();
// 	};
// 	
// 	template<typename T>
// 		class safe_cast
// 	{
// 	};
// }


You will find instruction on how can you edit this file, here:
http://docs.wholetomato.com?W302

I know, I know, this is a workaround. This is because VA handles symbols globally, it is aware of all parsed symbols, so this way features like "Add Include" refactoring are possible (you don't need to include a file for VA in order to recognize it)
Go to Top of Page

jrynd
New Member

USA
8 Posts

Posted - Apr 21 2010 :  10:54:05 AM  Show Profile  Reply with Quote
I can understand why you can't have a separate namespace for everything, but shouldn't members of a struct/class be thought of as distinct from classnames?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19024 Posts

Posted - Apr 21 2010 :  4:02:34 PM  Show Profile  Reply with Quote
Some code can confuse our parser, especially code making heavy use of macros. Our parser does not have the luxury of fully compiling the code before trying trying to understand it. We are working to improve this over time, but it is not an easy problem.

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