Wiki

Options

Case Status
Log In

Wiki

Options

 
Whole Tomato Software - Home
  • RSS Feed

Inactive code is always colored

Visual Studio 2005 and newer

In C/C++, it is common to use preprocessor macros to define code that should be active during compile:

#ifdef UNIX
    
    // this code is inactive

#else
    
    // this code is active

#endif

The IDE dims or alters the color of inactive code based on the current configuration. Visual Assist always parses and applies enhanced syntax coloring to such inactive code because Visual Assist assumes you need assistance on all code being edited, not just code that will be compiled in the next build. For this reason, in the following example, Visual Assist always knows and shows both definitions of the variable foo:

#ifdef UNIX
    
    int foo;

#else

        float foo;

#endif

 

Visual Studio 2013 and newer

In C/C++, opacity of inactive code is controlled by Tools | Options | Text Editor | C/C++ | View | Inactive Code | Inactive Code Opacity Percent

Visual Studio 2010 - 2012

In C/C++, opacity of inactive code is controlled by Tools | Options | Text Editor | C/C++ | Formatting | Inactive Code | Inactive Code Opacity Percent