How to add paths that depend on selected framework version?

(This is an old question that didn’t get a response, edited for simplicity)

In the -I paths below, the ‘espidf’ part refer to the framework version used and should be changed manuall if a different framework version is selected.

Is there a way to define paths such that they will refer to the current framework in use? E.g. using a $FRAMEWORK_DIR like variable.

(These paths are required because ‘jump to definitions’ doesn’t work in stock ESP32 projects).

; Base
platform = espressif32
board = esp32dev
framework = espidf
monitor_speed = 115200
board_build.partitions = partitions_singleapp_large.csv
; For IntelliSense.
build_flags =

build_type = release

build_type = debug