That's a royal PITA because of the port bit definitions. Instead, its better to #define pins named by function and localize the brain damage by avoiding all use of PORTA vs GPIO and TRISA vs TRISIO except in your hardware.h
That's what I do as well. The definitions are the net names (usually) from the schematic. It makes coding a lot more apparent.
// Hardware definitions
#define HB_LED LATBbits.LATB6 // Used for heartbeat
#define ADC1 LATDbits.LATD5
#define ADC2 LATDbits.LATD3
#define DIO1 LATBbits.LATB3
#define DIO2 LATAbits.LATA3
#define DIO3 LATCbits.LATC1
#define DDS_SEL LATAbits.LATA6
#define POT_OFFSET_CS LATCbits.LATC0
#define POT_GAIN_CS LATEbits.LATE0
#define POT_INC LATAbits.LATA5
#define POT_DIR LATAbits.LATA4
#define PWM1 LATCbits.LATC2
#define PWM2 LATDbits.LATD1