My ESP32 platformio.ini is below. I had to add a few source paths in order for ‘jump to definition’ to work.
Is there a simple way to include automatically all the source directories?
If not, is it a reasonable to file a feature request for it?
platform = espressif32
board = esp32dev
framework = espidf
monitor_speed = 115200
; Adjust to the actual serial port on your comptuer.
board_build.partitions = partitions_singleapp_large.csv
; Pathes are for IntelliSense. Notice the embded framework id in the path.
build_type = release
build_type = debug
I installed today ESPIDF for VSCode and it does have ‘jump to definition’ working for ESP libraries references. This leads me to think that the problem is specific to the platformio configuration of ESPIDF.
When you have the problem, are any of the header files, #included in your source file(s), showing up with red squiggles underneath? This would possibly indicate that intellisense cannot access those headers, and as such, F12/Jump to definition, for anything in those headers, fails?
I have had this problem in the past, both with PlatformIO code, and non-PlatformIO code. IN fact, when I write C code for my ancient Sinclair QL emulator, I dont have the compiler headers on my Linux system, so the F12/Jump to definition doesn’t work for me. Obviously.
If you do get the squiggles, it might be worth checking Help->Toggle Developer Tools->Console for any red or amber warnings and errors. Alternatively, rebuild intellisense with View->Command Palette->PlatformIO rebuild intellisense index.