On my system,
[drivers home]/variants/RASPBERRY_PI_PICO/pinmode_arduino.h
does NOT actually have the
#include "PinNamesTypes.h"
line, whereas the
[drivers home]/cores/arduino/as_mbed_library/pinmode_arduino.h
does include this line. If I put
[drivers home]/variants/RASPBERRY_PI_PICO/
in front of
[drivers home]/cores/arduino/as_mbed_library/
in my include search, then I do not get the missing PinNamesTypes.h error.
To address your final concern, I have gotten my pico to program the ssd1306 with the u8g2 library on the Arduino IDE. I have also gotten Arduino code ported to Vs Code via the platformio extension.