I just got a new laptop, so I actually had to go through this (while I had my coffee).
1) Install VSCode
2) Follow the
IDF extension install instructions. Use version release/5.1 for arduino-esp32 v3.0.x
3) Follow the
basic use instructions to build the blink example.
4) Hit F1 and find "ESP-IDF: Add Arduino ESP32 as IDF component"
5) Hit F1 and find "ESP-IDF: Install ESP Rainmaker" (not so optional, is it?)
6) Hit F1 and find "ESP-IDF: Create project from extension template". Select the arduino template, select a folder.
7) Hit F1 and find "ESP-IDF: Set Espressif device target". Set your device info
8) Copy the
sdkconfig from arduino into your project sdkconfig (at project root). Make sure you get the right one for your variant.
9) Copy the
contents of the example into your main.cpp or make your own.
10) Build your project
Note that ninja is the build process. If it fails, you need to look through the log to troubleshoot the error just like in any build. Sometimes ninja gets very stuck. Hit F1 to do a full clean, and then delete the build directory to start over.