Scriprting Define Blocks in Visual Studio are the opposite of what they should be

For some reason yesterday my current project went from working fine in Unity and Visual Studio to suddenly - the code that is inside a correctly defined code block is grayed out - but still active in Unity. In other words, if there is a syntax error in the grayed-out block, I get an error message in Unity, but cannot see the error message in visual studio.

Example:

#if SYMBOL_DEFINED_HARDWARE_CODE
bool isThisHardwareAvailable;
bool canHardwareBeActivated       // <-----missing semicolon
bool isFinished;

void DoSomething()
{
     DidThat = isFinished;
}
#endif

In the above code even though I am working on a project that is correctly defining the hardware - the color of the code is gray and therefore not being analyzed by the intellesense etc. In Unity I do get the error message for the missing punctuation.