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
 Code checking problem
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Paltr
New Member

6 Posts

Posted - Jul 08 2009 :  11:09:17 PM  Show Profile  Reply with Quote
Hi! There is a problem with class body code checking (VA marks almost all the code inside the class as incorrect one) when class' head is generated by macros.
I prepared small example demonstrating this bug, it can be downloaded at http://up-file.com/download/1d28651d87be998b7158109677193f12e . This bug can be seeing in file test.cpp line 37. If it doesn't reproduced try to make some small change (insert space for example) and save the project.

feline
Whole Tomato Software

United Kingdom
18942 Posts

Posted - Jul 09 2009 :  12:59:40 PM  Show Profile  Reply with Quote
I have the files, thank you for these. I am seeing the same problem here. You are using some very complex macro's, it is no wonder that VA is getting confused.

As an initial work around I have edited VA's "StdAfx.h" file as explained in this FAQ entry:

http://docs.wholetomato.com?W302

and add the entry:

#define INTERFACE_MIXIN(INTERFACE_MIXIN, DEFAULT_IMPL_MIXIN) template<class TBase> class INTERFACE_MIXIN


at the bottom. This file is used to help VA's parser with difficult code, and can be used to work around odd effects. After modifying this file you need to rebuild the VA symbol database for the changes to take effect:

VA Options -> Performance -> General -> Rebuild symbol databases

This fixes the underlining in the first problem class in "test.cpp" but not the second problem class, since that uses a separate macro.

I am not sure if this work around will do quite what you need, but it is a good start. I have not tried to work through all of the macro's to work out exactly what is happening here.

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

Paltr
New Member

6 Posts

Posted - Jul 09 2009 :  1:39:53 PM  Show Profile  Reply with Quote
Thanks for advice. But the problem is that I have many such classes that are used to generate more complex ones in compile - time. And all of them are marked as invalid. This make the work harder. If you will watch the macros implementation they are rather simple - they consist from some templates specializations at the top of definition and then follows something like "template<class TBase> class INTERFACE_MIXIN" that is easy to parse (IMHO).
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18942 Posts

Posted - Jul 11 2009 :  4:17:19 PM  Show Profile  Reply with Quote
Does turning on:

VA Options -> Advanced -> Listboxes -> Get content from default Intellisense

help at all? This might help with listboxes on these macro generated classes, or it might make it worse.

When you say "I have many such classes that are used to generate more complex ones" do you mean classes or macros?

If there are a lot of macros that are causing problems, then I wonder if there is a common element to the macro's that we can try and help VA with.

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

Paltr
New Member

6 Posts

Posted - Jul 12 2009 :  04:05:15 AM  Show Profile  Reply with Quote
"Get content from default Intellisense" didn't help...
I mean classes. They work as mixines here(http://en.wikipedia.org/wiki/Mixin).
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18942 Posts

Posted - Jul 13 2009 :  3:40:27 PM  Show Profile  Reply with Quote
I am confused. Returning to your sample project I have now added these two lines to VA's StdAfx.h file:

#define INTERFACE_MIXIN(INTERFACE_MIXIN, DEFAULT_IMPL_MIXIN) template<class TBase> class INTERFACE_MIXIN
#define IMPL_MIXIN(MIXIN_CLASS, INTERFACE_MIXIN, REQUIRED_EXTENSIONS) template<class TBase> class MIXIN_CLASS

and after a symbol database rebuild none of the classes in "test.cpp" are being underlined by VA as mistyped symbols.

If you have lots of classes using the same two or three macro's then we just need to find a suitable work around for the macros and this should fix all of the classes in one go.

If you have a large number of macros then I can see how this would be more of a problem.

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

Paltr
New Member

6 Posts

Posted - Jul 13 2009 :  10:38:46 PM  Show Profile  Reply with Quote
Hmmm... I added these two lines, and now it seems to be working (I don't know what I did wrong the last time I added them)... Thanks a lot for your help!
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