Raspberry Pi 3 - How to write code with VScode/PIO on PC and run it on RPi?

I am trying to get my head around the process to use VCode on my PC, write a ‘hello world’ in C/C++, compile it, and run it on the RPi.

I tried adding the RPi as new platform to setup a new project in VScode/PIO and I got to an error box and solution suggestion. One of the suggestions was to PIO REMOTE AGENT.

So after digging into this, I found this link helpful : HowTo: Raspberry Pi 3 as remote agent (Oct. 2020)

After following it I found I was able to get the remote agent working on the RPi.
So if I open a PIO terminal in VScode on the PC I can see my remote machine :

PLC-Dev\Software\Prototype\Sandpit\rpiDev1\helloworld> pio remote device list
Agent rpiDev1

/dev/ttyAMA0

Hardware ID: 20201000.serial
Description: ttyAMA0

But what is the process from here ? I could not find any examples or documentation about compiling and running. Could someone run me through the bit I am missing ?

I am guessing the required process is that the source code needs to be downloaded to the RPi from the VScode and compiled there and run from there. This is the process that works for me with ‘Clion’.

See

https://docs.platformio.org/en/latest/platforms/linux_arm.html

I kind of got that cross-compilation was not supported but what is the suggested temporary solution b) ?

PIO Remote seems to install on the RPi and it talks to other PIO installations. But what use is it ? And how can it be used as temporary solution ?