VS Code IntelliSense problem with Mbed OS features

Hi there,

I’m testing VS Code and PlatformIO. To activate Mbed OS features I added -D DPIO_FRAMEWORK_MBED_RTOS_PRESENT into the build flags but it seems it doesn’t define MBED_CONF_RTOS_API_PRESENT because Intellisense cannot find any reference from rtos.h file. The line starting with include keyword in the following code piece is grayed out in mbed.h file:

#include "rtos/rtos.h"

Since that line is grayed out it’s not included in the search paths. However, there’s no problem when building a small application that uses Mbed OS features. Have a look at that example code:


Builds without any problem. You may have noticed that ThisThread is marked and the error states that

name followed by '::' must be a class or namespace name

So it’s not possible to use IntelliSense for Mbed Os features.

If I add -D MBED_CONF_RTOS_API_PRESENT to the build flags then Intellisense starts working properly but in this case build action rebuilds the whole library and applications from beginning in each build which takes a lot of time.

Are there any steps that I’m missing when enabling the Mbed Os features?