I'm working in a large C Zephyr RTOS workspace in VS Code, and the LSP gives errors on the lines of:
identifier "ENUM_VARIANT" is undefined
and
incomplete type "const struct struct_name" is not allowed
All the header files that have these definitions are included, and when I open these headers in a separate VS Code tab, these errors go away. But when I modify the original C file that had the errors, the errors come back.
The code compiles fine.
The root of the error
I found out that the root of the error is in /zephyr/include/zephyr/audio/codec.h, where it can't find the i2s_config struct:
incomplete type "struct i2s_config" is not allowed
Even though the #include <zephyr/drivers/i2s.h> header is included
Here is a short video that may explain my problem a little better.