Thanks for the file and the report.
This is caused by a minor bug in Visual Micro workaround below.
I am surprised that the sketch does not also fail to compile in release compile.
A standard part of the build process for arduino is to automatically create/inject prototypes for methods and also to automatically the respective mcu core which in this case is #include "arduino.h". All this happens in the temp file.
In debug mode Visual Micro also injects a #include "vm_dbg.h" for the debugger functions
To do this visual micro attempts to locate the first line of code and insert the prototypes and headers before it.
In the case of your sketch the first line of code is in the condition #ifdef USE_ADAFRUIT_SHIELD_PINOUT
So the result is something like the following. (I have removed your library includes from the top of the code for your privacy but you will see them in the .cpp you sent me)
#include "library1.h"
#include "library2.h"
#ifdef USE_ADAFRUIT_SHIELD_PINOUT
#include "arduino.h"
#include <VM_DBG.h>
//
//
void OnSSHigh();
Adafruit_TFTLCD tft;
#else
(By the way, I notice your code has a manually added prototype for void OnSSHigh();. It's not needed but no problem)
The fix is simply to have some valid init code above the first #ifdef. No doubt the project might grow and a valid/useful variable might be defined but adding
#define anyOldVar will work just as well (and not consume any memory).
#include "library1.h"
#include "library2.h"
//this dummy added
#define anyOldVar 0
#ifdef USE_ADAFRUIT_SHIELD_PINOUT
Adafruit_TFTLCD tft;
#else
if you do that then the result in the temp build folder will be like this
#include "library1.h"
#include "library2.h"
//this dummy added
#define anyOldVar 0
#include "arduino.h"
#include <VM_DBG.h>
//
//
void OnSSHigh();
#ifdef USE_ADAFRUIT_SHIELD_PINOUT
Adafruit_TFTLCD tft;
#else
Hopefully this can be fixed in the next release