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
 Feature Requests
 Find References and #if
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mvolkar
Junior Member

20 Posts

Posted - Jan 28 2008 :  3:44:42 PM  Show Profile  Reply with Quote
We have several different builds of our C code that are conditionally built using preprocessor directives (e.g., #if, #ifdef, etc.). I frequently use the Find References command from Visual Assist and I've found that this apparently does not take into account the preprocessor directives. So, even though Find References will return results for a symbol, I often find that once I navigate there the code is "inactive" in Visual Studio due to being inside an #if block.

I was wondering if there was any consideration for trying to make Visual Assist handle this by not returning references that are in inactive blocks of code.

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Jan 29 2008 :  09:04:34 AM  Show Profile  Reply with Quote
Unfortunately no. VA is designed to help you with code inside these blocks, so it does not try to ignore them. Also VA does not always have access to all of the information required to work out which blocks are active and which are inactive.

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

mvolkar
Junior Member

20 Posts

Posted - Jan 29 2008 :  09:06:44 AM  Show Profile  Reply with Quote
Thanks for the reply. This is pretty much what I expected, but it never hurts to ask.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Jan 29 2008 :  09:21:39 AM  Show Profile  Reply with Quote
You might be able to "fool" VA, but off hand I am not quite sure how to get this to compile.

You can use VA's "StdAfx.h" file as explained in this FAQ entry:

http://docs.wholetomato.com?W302

and add something like:

#define START_IGNORE_BLOCK /*
#define END_IGNORE_BLOCK */

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

You would need to have these resolve into something suitable while compiling, but I am not quite sure what. Simply using:

#define START_IGNORE_BLOCK #if 0

is unlikely to work.

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