Why ESP32 library files are not visible in 'jump to definition'?

My ESP32 platformio.ini is below. I had to add a few source paths in order for ‘jump to definition’ to work.

  1. Is there a simple way to include automatically all the source directories?

  2. If not, is it a reasonable to file a feature request for it?


; Base
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_flags =

build_type = release

build_type = debug

It might be one of many VSCode problems. vscode "jump to definition" not working at DuckDuckGo

Just a thought.



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.

I opened the “espidf-arduino-wifiscan” example.
All 'jump to definition’s are working without any issues here.

I suspect you have a broken VS code installation and the problem is not caused by PlatformIO.

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.